This revision was automatically updated to reflect the committed changes.
Closed by commit rC332279: CodeGen: Emit string literal in constant address
space (authored by yaxunl, committed by ).
Repository:
rC Clang
https://reviews.llvm.org/D46643
Files:
lib/CodeGen/CGDecl.cpp
lib/CodeGen/C
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Thanks, LGTM.
https://reviews.llvm.org/D46643
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/l
yaxunl updated this revision to Diff 146647.
yaxunl marked 2 inline comments as done.
yaxunl added a comment.
Revised by John's comments.
https://reviews.llvm.org/D46643
Files:
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/amdgcn-string
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1373
+ llvm::Type *BP = llvm::Type::getInt8Ty(CGM.getLLVMContext())
+ ->getPointerTo(Loc.getAddressSpace());
if (Loc.getType() != BP)
`CGM.Int8Ty` exists.
=
yaxunl updated this revision to Diff 146468.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments. Also refactored to extract common code.
https://reviews.llvm.org/D46643
Files:
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGen
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1375
+Loc = Address(EmitCastToVoidPtrInAllocaAddrSpace(Loc.getPointer()),
+ Loc.getAlignment());
yaxunl wrote:
> rjmccall wrote:
> > I don't understand why a patch about str
yaxunl marked an inline comment as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1375
+Loc = Address(EmitCastToVoidPtrInAllocaAddrSpace(Loc.getPointer()),
+ Loc.getAlignment());
rjmccall wrote:
> I don't understand
rjmccall added a comment.
The part about string literals looks fine, but:
Comment at: lib/CodeGen/CGDecl.cpp:1375
+Loc = Address(EmitCastToVoidPtrInAllocaAddrSpace(Loc.getPointer()),
+ Loc.getAlignment());
I don't understand why a patch a
yaxunl created this revision.
yaxunl added a reviewer: rjmccall.
Some targets have constant address space (e.g. amdgcn). For them string literal
should be
emitted in constant address space then casted to default address space.
https://reviews.llvm.org/D46643
Files:
lib/CodeGen/CGDecl.cpp
l