Make Rustc build with LLVM trunk.

This commit is contained in:
Edd Barrett 2018-11-07 12:05:54 +00:00 committed by Alex Crichton
parent ae5b350d77
commit a43a7a0778
1 changed files with 7 additions and 0 deletions

View File

@ -705,10 +705,17 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
}
#if LLVM_VERSION_GE(8, 0)
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
InitExpr, unwrapDIPtr<MDNode>(Decl), nullptr, AlignInBits);
#else
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
#endif
InitVal->setMetadata("dbg", VarExpr);