From da690acce5bd3ea9c6c3ef70ce7dc87f72d69c4f Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Wed, 25 Apr 2012 14:27:33 -1000 Subject: [PATCH] Fix build with LLVM 3.0 --- ctx.cpp | 5 ++++- module.cpp | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ctx.cpp b/ctx.cpp index 1b61fdac..9d9f04e1 100644 --- a/ctx.cpp +++ b/ctx.cpp @@ -330,7 +330,10 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym, mangledName, diFile, firstLine, diSubprogramType, isStatic, true, /* is defn */ - firstLine, flags, +#ifndef LLVM_3_0 + firstLine, +#endif // !LLVM_3_0 + flags, isOptimized, llvmFunction); Assert(diSubprogram.Verify()); diff --git a/module.cpp b/module.cpp index 740068c8..815a24cd 100644 --- a/module.cpp +++ b/module.cpp @@ -117,6 +117,7 @@ lStripUnusedDebugInfo(llvm::Module *module) { if (g->generateDebuggingSymbols == false) return; +#ifndef LLVM_3_0 // loop over the compile units that contributed to the final module if (llvm::NamedMDNode *cuNodes = module->getNamedMetadata("llvm.dbg.cu")) { for (unsigned i = 0, ie = cuNodes->getNumOperands(); i != ie; ++i) { @@ -193,6 +194,7 @@ lStripUnusedDebugInfo(llvm::Module *module) { } for (int i = 0; i < (int)toErase.size(); ++i) module->eraseNamedMetadata(toErase[i]); +#endif // !LLVM_3_0 // Wrap up by running the LLVM pass to remove anything left that's // unused.