[PATCH] D16749: [OpenMP] Map clause codegeneration.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 15:45:01 PDT 2016


sfantao added a comment.

Hi Alexey,

Thanks for the review!


================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:4692-4694
@@ +4691,5 @@
+      llvm::Value *ElemSize;
+      if (auto *PTy = BaseTy->getAs<PointerType>()) {
+        ElemSize = CGF.getTypeSize(PTy->getPointeeType().getCanonicalType());
+      } else {
+        auto *ATy = cast<ArrayType>(BaseTy.getTypePtr());
----------------
Done!

================
Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:5086
@@ +5085,3 @@
+            ? nullptr
+            : cast<ValueDecl>(Cap->getCapturedVar()->getCanonicalDecl());
+
----------------
ABataev wrote:
> cast is not required, remove it
It does not work without the cast because the base class Decl returns a Decl*. Even if the overrides in the child classes use the child type, the base class is what is used for implicit cast checking.



http://reviews.llvm.org/D16749





More information about the cfe-commits mailing list