[PATCH] D44435: Add the module name to __cuda_module_ctor and __cuda_module_dtor for unique function names

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 13 09:56:00 PDT 2018

rjmccall added inline comments.

Comment at: lib/CodeGen/CGCUDANV.cpp:281
+  // get name from the module to generate unique ctor name for every module
+  SmallString<128> ModuleName
Please explain in the comment *why* you're doing this.  It's just for debugging, right?  So that it's known which object file the constructor function comes from.

Comment at: lib/CodeGen/CGCUDANV.cpp:358
+  if (ModuleName.empty())
+    ModuleName = "<null>";
This doesn't actually seem more useful than the empty string.

Comment at: unittests/CodeGen/IncrementalProcessingTest.cpp:178
+// If the cuda mode in the compiler instance is enable, a cuda ctor or dtor will
+// be generated for every statement, if a fatbinary file is exists.
+const char CUDATestProgram1[] =
"In CUDA incremental processing, a CUDA ctor or dtor will be generated for every statement if a fatbinary file exists."

  rC Clang


More information about the cfe-commits mailing list