diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-12 00:12:39 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-12 00:12:39 +0000 |
commit | 8b8683f9f6051c6854f6e9a044d3d882649f72fd (patch) | |
tree | cd0b5fce4755b89c27c8dc7d13a93cb974ed3e08 /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | dafdbf77b315961fedc959e9ea732fa3f5cbee67 (diff) | |
download | bcm5719-llvm-8b8683f9f6051c6854f6e9a044d3d882649f72fd.tar.gz bcm5719-llvm-8b8683f9f6051c6854f6e9a044d3d882649f72fd.zip |
Add ObjC constant string support for NeXT.
Changed CGObjCRuntime::GenerateConstantString interface to take
std::string instead of char* and size.
Change ObjC functions which call on GenerateConstantString to bitcast
result to appropriate type.
llvm-svn: 54659
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 5865f215223..3d530e8210f 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -61,8 +61,10 @@ public: return llvm::ConstantInt::get(ConvertType(E->getType()), E->getValue()); } llvm::Constant *VisitObjCStringLiteral(const ObjCStringLiteral *E) { - return CGM.getObjCRuntime().GenerateConstantString( - E->getString()->getStrData(), E->getString()->getByteLength()); + std::string S(E->getString()->getStrData(), + E->getString()->getByteLength()); + llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(S); + return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType())); } llvm::Constant *VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { |