Add GetAddrOfConstantCString method
- Returns addr of constant for argument + '\0'.
- I couldn't think of a better name.
- Move appropriate users of GetAddrOfConstantString to this.
Rename getStringForStringLiteral to GetStringForStringLiteral.
Add GetAddrOfConstantStringFromLiteral
- This combines GetAddrOfConstantString and
GetStringForStringLiteral. This method can be, but is not yet, more
efficient.
Change GetAddrOfConstantString to not add terminating '\0'
- <rdar://problem/6140956>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54768 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 7270884..2e400f4 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -52,7 +52,7 @@
if (!strcmp(classname, "super")) {
classname = E->getMethodDecl()->getClassInterface()->getName();
}
- llvm::Value *ClassName = CGM.GetAddrOfConstantString(classname);
+ llvm::Value *ClassName = CGM.GetAddrOfConstantCString(classname);
ClassName = Builder.CreateStructGEP(ClassName, 0);
Receiver = Runtime.LookupClass(Builder, ClassName);
} else if (const PredefinedExpr *PDE =