This is an archive of the discontinued LLVM Phabricator instance.

Add support for composite structs in MS inline asm
ClosedPublic

Authored by myatsina on Dec 16 2015, 9:41 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

myatsina updated this revision to Diff 43021.Dec 16 2015, 9:41 AM
myatsina retitled this revision from to Add support for composite structs in MS inline asm.
myatsina updated this object.
myatsina added reviewers: rnk, mcrosier.
myatsina set the repository for this revision to rL LLVM.
myatsina added a subscriber: llvm-commits.
mcrosier edited edge metadata.Dec 16 2015, 9:49 AM

Looks reasonable to me, but I'd prefer Reid take a look before signing off on this one.

rnk accepted this revision.Dec 16 2015, 10:20 AM
rnk edited edge metadata.

lgtm Nice, this is simple. :)

lib/Sema/SemaStmtAsm.cpp
631–634 ↗(On Diff #43021)

Just for (StringRef NextMember : Members)?

test/CodeGen/ms-inline-asm.c
487 ↗(On Diff #43021)

Interesting, MSVC rejects this, but we accept. Anyway, it's not relevant to this patch.

This revision is now accepted and ready to land.Dec 16 2015, 10:20 AM
myatsina marked an inline comment as done.Dec 17 2015, 1:30 AM
myatsina added inline comments.
test/CodeGen/ms-inline-asm.c
487 ↗(On Diff #43021)

I found this comment in X86AsmParser.cpp which might be related:

Parse struct field access. Intel requires a dot, but MSVC doesn't. MSVC
will in fact do global lookup the field name inside all global typedefs,
// but we don't emulate that.

This revision was automatically updated to reflect the committed changes.