[PATCH] D36450: [X86][Ms-InlineAsm] Extend MS Dot operator to accept "this" + struct/class pointers aliases
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 8 15:15:42 PDT 2017
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: lib/Sema/SemaStmtAsm.cpp:702-705
+ // MS InlineAsm often uses struct pointer aliases as a base
+ const QualType QT = TD->getUnderlyingType();
+ RT = isa<PointerType>(QT) ? QT->getPointeeType()->getAs<RecordType>() :
+ QT->getAs<RecordType>();
----------------
This would probably be simpler as:
QualType Ty = TD->getUnderlyingType();
if (const auto *PT = Ty->getAs<PointerType>())
Ty = PT->getPointeeType();
RT = Ty->getAsRecordType();
... to avoid repeating getAs<RecordType>().
Repository:
rL LLVM
https://reviews.llvm.org/D36450
More information about the cfe-commits
mailing list