Make Rustc build with LLVM trunk.
This commit is contained in:
parent
ae5b350d77
commit
a43a7a0778
1 changed files with 7 additions and 0 deletions
|
@ -705,10 +705,17 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateStaticVariable(
|
||||||
FPVal->getValueAPF().bitcastToAPInt().getZExtValue());
|
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(
|
llvm::DIGlobalVariableExpression *VarExpr = Builder->createGlobalVariableExpression(
|
||||||
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
|
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
|
||||||
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
|
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
|
||||||
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
|
InitExpr, unwrapDIPtr<MDNode>(Decl), AlignInBits);
|
||||||
|
#endif
|
||||||
|
|
||||||
InitVal->setMetadata("dbg", VarExpr);
|
InitVal->setMetadata("dbg", VarExpr);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue