[PATCH] D15578: Add support for composite structs in MS inline asm
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 16 10:20:16 PST 2015
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm Nice, this is simple. :)
================
Comment at: lib/Sema/SemaStmtAsm.cpp:631-634
@@ -628,15 +630,6 @@
- const RecordType *RT = nullptr;
- NamedDecl *FoundDecl = BaseResult.getFoundDecl();
- if (VarDecl *VD = dyn_cast<VarDecl>(FoundDecl))
- RT = VD->getType()->getAs<RecordType>();
- else if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(FoundDecl)) {
- MarkAnyDeclReferenced(TD->getLocation(), TD, /*OdrUse=*/false);
- RT = TD->getUnderlyingType()->getAs<RecordType>();
- } else if (TypeDecl *TD = dyn_cast<TypeDecl>(FoundDecl))
- RT = TD->getTypeForDecl()->getAs<RecordType>();
- if (!RT)
- return true;
+ for (unsigned int member_index = 0; member_index < Members.size();
+ member_index++) {
- if (RequireCompleteType(AsmLoc, QualType(RT, 0), 0))
- return true;
+ StringRef NextMember = Members[member_index];
+ if (!CurrBaseResult.isSingleResult())
----------------
Just `for (StringRef NextMember : Members)`?
================
Comment at: test/CodeGen/ms-inline-asm.c:487
@@ -474,3 +486,3 @@
// CHECK-LABEL: define void @t39
__asm mov eax, [eax].A.b
// CHECK: mov eax, [eax].4
----------------
Interesting, MSVC rejects this, but we accept. Anyway, it's not relevant to this patch.
Repository:
rL LLVM
http://reviews.llvm.org/D15578
More information about the llvm-commits
mailing list