[PATCH] D36450: [X86][Ms-InlineAsm] Extend MS Dot operator to accept "this" + struct/class pointers aliases

coby via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 04:50:04 PDT 2017


coby added inline comments.


================
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>();
----------------
rnk wrote:
> 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>().
Indeed. thx for pointing it out!


Repository:
  rL LLVM

https://reviews.llvm.org/D36450





More information about the cfe-commits mailing list