[cfe-commits] r52753 - in /cfe/trunk: Driver/Makefile lib/CodeGen/CGObjCGNU.cpp
Chris Lattner
sabre at nondot.org
Wed Jun 25 21:05:20 PDT 2008
Author: lattner
Date: Wed Jun 25 23:05:20 2008
New Revision: 52753
URL: http://llvm.org/viewvc/llvm-project?rev=52753&view=rev
Log:
a temporary minimal hack to get clang building after the getStringValue changes in llvm mainline.
Modified:
cfe/trunk/Driver/Makefile
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/Driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/Makefile?rev=52753&r1=52752&r2=52753&view=diff
==============================================================================
--- cfe/trunk/Driver/Makefile (original)
+++ cfe/trunk/Driver/Makefile Wed Jun 25 23:05:20 2008
@@ -5,6 +5,7 @@
TOOLNAME = clang
USEDLIBS = clangCodeGen.a clangAnalysis.a clangRewrite.a clangSEMA.a \
clangAST.a clangParse.a clangLex.a clangBasic.a \
+ LLVMAnalysis.a \
LLVMCore.a LLVMSupport.a LLVMSystem.a \
LLVMBitWriter.a LLVMBitReader.a LLVMCodeGen.a LLVMTarget.a
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=52753&r1=52752&r2=52753&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Jun 25 23:05:20 2008
@@ -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 @@
// 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::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 @@
Elements.push_back(NullP);
// Create an instance of the structure
return MakeGlobal(ClassTy, Elements,
- SymbolNameForClass(Name->getStringValue()));
+ SymbolNameForClass(getStringValue(Name)));
}
llvm::Constant *CGObjCGNU::GenerateProtocolMethodList(
More information about the cfe-commits
mailing list