aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGObjCGNU.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-06-26 04:05:20 +0000
committerChris Lattner <sabre@nondot.org>2008-06-26 04:05:20 +0000
commit550b8db03c0bb1b006d2ff63d4febda3db16002f (patch)
tree93e009e6606fe47f4f757dcfa0af02f6313d61aa /lib/CodeGen/CGObjCGNU.cpp
parent4cb20601eb46f3e1f04f07de19df89f35c48c8a6 (diff)
a temporary minimal hack to get clang building after the getStringValue changes in llvm mainline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCGNU.cpp')
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 53eaf57560..73a692d99b 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -22,6 +22,15 @@
#include "llvm/ADT/StringMap.h"
#include <map>
+// FIXME: Remove THIS!
+#include "llvm/Analysis/ValueTracking.h"
+std::string getStringValue(llvm::Constant *C) {
+ std::string R;
+ bool V = GetConstantStringInfo(C, R);
+ assert(V && "Couldn't convert string");
+ return R;
+}
+
using llvm::dyn_cast;
// The version of the runtime that this class targets. Must match the version
@@ -221,23 +230,23 @@ llvm::Value *CGObjCGNU::GetSelector(llvm::IRBuilder &Builder,
// Untyped selector
if (SelTypes == 0) {
// If it's already cached, return it.
- if (UntypedSelectors[CName->getStringValue()]) {
+ if (UntypedSelectors[getStringValue(CName)]) {
// FIXME: Volatility
- return Builder.CreateLoad(UntypedSelectors[CName->getStringValue()]);
+ return Builder.CreateLoad(UntypedSelectors[getStringValue(CName)]);
}
// If it isn't, cache it.
llvm::GlobalAlias *Sel = new llvm::GlobalAlias(
llvm::PointerType::getUnqual(SelectorTy),
llvm::GlobalValue::InternalLinkage, ".objc_untyped_selector_alias",
NULL, &TheModule);
- UntypedSelectors[CName->getStringValue()] = Sel;
+ UntypedSelectors[getStringValue(CName)] = Sel;
// FIXME: Volatility
return Builder.CreateLoad(Sel);
}
// Typed selectors
if (llvm::Constant *CTypes = dyn_cast<llvm::Constant>(SelTypes)) {
- TypedSelector Selector = TypedSelector(CName->getStringValue(),
- CTypes->getStringValue());
+ TypedSelector Selector = TypedSelector(getStringValue(CName),
+ getStringValue(CTypes));
// If it's already cached, return it.
if (TypedSelectors[Selector]) {
// FIXME: Volatility
@@ -439,7 +448,8 @@ llvm::Constant *CGObjCGNU::GenerateMethodList(const std::string &ClassName,
llvm::ConstantExpr::getGetElementPtr(MethodTypes[i], Zeros, 2));
llvm::Constant *Method =
TheModule.getFunction(SymbolNameForMethod(ClassName, CategoryName,
- MethodNames[i]->getStringValue(), isClassMethodList));
+ getStringValue(MethodNames[i]),
+ isClassMethodList));
Method = llvm::ConstantExpr::getBitCast(Method,
llvm::PointerType::getUnqual(IMPTy));
Elements.push_back(Method);
@@ -567,7 +577,7 @@ llvm::Constant *CGObjCGNU::GenerateClassStructure(
Elements.push_back(NullP);
// Create an instance of the structure
return MakeGlobal(ClassTy, Elements,
- SymbolNameForClass(Name->getStringValue()));
+ SymbolNameForClass(getStringValue(Name)));
}
llvm::Constant *CGObjCGNU::GenerateProtocolMethodList(