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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 15:56:10 PST 2016

jlebar added inline comments.

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;
tra wrote:
> I'd make it an assert so we know if/when llvm.global_ctors mutates into something we can't deal with.
That was my inclination as well, but in AsmPrinter, this is not an error, so I'm not sure it should be one here.



More information about the llvm-commits mailing list