diff options
author | Steve Naroff <snaroff@apple.com> | 2009-03-31 16:53:37 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2009-03-31 16:53:37 +0000 |
commit | 66afeb59683520802a337e2d12a2dc840c8062ee (patch) | |
tree | dcf69cd3a11e847050826400195ea9e47e7c2cdd /clang/lib/CodeGen/CGObjC.cpp | |
parent | d51f196ff5d18ef794c3064b1aa2bd7f16d771ed (diff) | |
download | bcm5719-llvm-66afeb59683520802a337e2d12a2dc840c8062ee.tar.gz bcm5719-llvm-66afeb59683520802a337e2d12a2dc840c8062ee.zip |
Some "prep" work for handling ObjC @-string constants that contain UTF-8. No functionality change.
Changed GenerateConstantString() to take an ObjCStringLiteral (instead of a std::string). While this isn't strictly necessary, it seems cleaner and allows us to cache to "containsNonAscii" if necessary (to avoid checking in both Sema and CodeGen).
llvm-svn: 68114
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 2467a8290aa..4db29ce05d0 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -26,9 +26,7 @@ using namespace CodeGen; /// Emits an instance of NSConstantString representing the object. llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E) { - std::string String(E->getString()->getStrData(), - E->getString()->getByteLength()); - llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(String); + llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(E); // FIXME: This bitcast should just be made an invariant on the Runtime. return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType())); } |