diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-03-07 20:17:55 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-03-07 20:17:55 +0000 |
commit | 4663a3368d5f562e788573bef6e3a78c46e8d1de (patch) | |
tree | 3ae37fe55114bf1855f1fbc7e19658cdfb6a6bff /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 03676f557cc6d79c2d6b1a9e196b20f542352362 (diff) | |
download | bcm5719-llvm-4663a3368d5f562e788573bef6e3a78c46e8d1de.tar.gz bcm5719-llvm-4663a3368d5f562e788573bef6e3a78c46e8d1de.zip |
Make constant emission for @encode use the common string emission code.
This is a bit cleaner, and also "fixes" bad code that compares the
addresses of the string constants.
llvm-svn: 66346
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 95d881bc49a..16ba94791fa 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1132,12 +1132,8 @@ llvm::Constant * CodeGenModule::GetAddrOfConstantStringFromObjCEncode(const ObjCEncodeExpr *E) { std::string Str; getContext().getObjCEncodingForType(E->getEncodedType(), Str); - - llvm::Constant *C = llvm::ConstantArray::get(Str); - C = new llvm::GlobalVariable(C->getType(), true, - llvm::GlobalValue::InternalLinkage, - C, ".str", &getModule()); - return C; + + return GetAddrOfConstantCString(Str); } |