efriedma added inline comments.

================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:95
                                llvm::ConstantInt::get(SizeTy, 0)};
-    auto ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str());
+    auto ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str(), AddNull);
     llvm::GlobalVariable *GV =
----------------
Please don't abuse GetAddrOfConstantCString like this.  Like the name says, 
it's meant for strings, in the normal sections strings would go in.  If you 
just want an array global, please just use "new llvm::GlobalVariable" directly.

(AddNull itself is not a big deal, but messing with the 
section/alignment/unnamed_addr of globals in CodeGenModule's ConstantStringMap 
is a bad idea.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135832

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to