Extra NUL does not impact functionality of the generated code, but it confuses
various NVIDIA tools used to examine embedded GPU binaries.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/CodeGen/CGCUDANV.cpp | ||
---|---|---|
95 | 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.) |
clang/lib/CodeGen/CGCUDANV.cpp | ||
---|---|---|
95 | 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. |
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.)