aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjC.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-12 00:12:39 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-12 00:12:39 +0000
commitbbce49b9e5c6d7f05926b89f8e6fd235ae01c250 (patch)
tree2dd0d36452f0099a0c8688016e88044f102755e9 /lib/CodeGen/CGObjC.cpp
parent0d8a13d823b644d94ae5f8db275be3592b9bbbfc (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r--lib/CodeGen/CGObjC.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index e152488bfa..6a8fe3c4f9 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -20,9 +20,10 @@ using namespace clang;
using namespace CodeGen;
/// Emits an instance of NSConstantString representing the object.
-llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E){
- return CGM.getObjCRuntime().GenerateConstantString(
- E->getString()->getStrData(), E->getString()->getByteLength());
+llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E) {
+ std::string String(E->getString()->getStrData(), E->getString()->getByteLength());
+ llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(String);
+ return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType()));
}
/// Emit a selector.