[PATCH] D68521: [PATCH 36/38] [noalias] Clang CodeGen for restrict-qualified pointers

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 14:43:18 PDT 2019


jeroen.dobbelaere marked an inline comment as done.
jeroen.dobbelaere added inline comments.


================
Comment at: clang/lib/AST/Type.cpp:115
+    }
+  } else if (const auto *ArrayTy = dyn_cast<ArrayType>(CannonTy)) {
+    return ArrayTy->getElementType().isRestrictOrContainsRestrictMembers();
----------------
erichkeane wrote:
> Rather than this recursion, could you just unpack it from the CannonTy?  So replace 107 with:
> 
> Type *CannonTy = getCanonicalType()->getBaseElementTypeUnsafe();
> 
> That way this is all unpacked and saves you a recursion.
> 
Yes, that seems to work.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68521/new/

https://reviews.llvm.org/D68521





More information about the llvm-commits mailing list