Fix build with LLVM 3.0
This commit is contained in:
5
ctx.cpp
5
ctx.cpp
@@ -330,7 +330,10 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
|
|||||||
mangledName, diFile,
|
mangledName, diFile,
|
||||||
firstLine, diSubprogramType,
|
firstLine, diSubprogramType,
|
||||||
isStatic, true, /* is defn */
|
isStatic, true, /* is defn */
|
||||||
firstLine, flags,
|
#ifndef LLVM_3_0
|
||||||
|
firstLine,
|
||||||
|
#endif // !LLVM_3_0
|
||||||
|
flags,
|
||||||
isOptimized, llvmFunction);
|
isOptimized, llvmFunction);
|
||||||
Assert(diSubprogram.Verify());
|
Assert(diSubprogram.Verify());
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ lStripUnusedDebugInfo(llvm::Module *module) {
|
|||||||
if (g->generateDebuggingSymbols == false)
|
if (g->generateDebuggingSymbols == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef LLVM_3_0
|
||||||
// loop over the compile units that contributed to the final module
|
// loop over the compile units that contributed to the final module
|
||||||
if (llvm::NamedMDNode *cuNodes = module->getNamedMetadata("llvm.dbg.cu")) {
|
if (llvm::NamedMDNode *cuNodes = module->getNamedMetadata("llvm.dbg.cu")) {
|
||||||
for (unsigned i = 0, ie = cuNodes->getNumOperands(); i != ie; ++i) {
|
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)
|
for (int i = 0; i < (int)toErase.size(); ++i)
|
||||||
module->eraseNamedMetadata(toErase[i]);
|
module->eraseNamedMetadata(toErase[i]);
|
||||||
|
#endif // !LLVM_3_0
|
||||||
|
|
||||||
// Wrap up by running the LLVM pass to remove anything left that's
|
// Wrap up by running the LLVM pass to remove anything left that's
|
||||||
// unused.
|
// unused.
|
||||||
|
|||||||
Reference in New Issue
Block a user