aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-03-07 20:17:55 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-03-07 20:17:55 +0000
commita210f350fa78c263caa26e0f999cce85bb235309 (patch)
tree93aebb6d46d4af4e76d992d7671df691353aa189 /lib/CodeGen/CodeGenModule.cpp
parent11894a4ad600a4919008b2693143cde395b9e9de (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 95d881bc49..16ba94791f 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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);
}