[PATCH] D16739: [CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 15:50:35 PST 2016


tra added a comment.

Looks OK to me, but I'd run it by someone familiar with back-end.


================
Comment at: lib/Target/NVPTX/NVPTXAsmPrinter.cpp:808
@@ +807,3 @@
+  const ConstantArray *InitList = dyn_cast<ConstantArray>(GV->getInitializer());
+  if (!InitList) return true;  // Not an array; we don't know how to parse.
+  return InitList->getNumOperands() == 0;
----------------
I'd make it an assert so we know if/when llvm.global_ctors mutates into something we can't deal with.


http://reviews.llvm.org/D16739





More information about the llvm-commits mailing list