tra 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 =
----------------
efriedma wrote:
> 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.)
Agreed. That was not the best choice. I've separated generation of regular 
strings from generation of constant arrays we need to place just so.


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