Support a debug info API change for LLVM 4.0
Instead of directly creating a 'DIGlobalVariable', we now have to create a 'DIGlobalVariableExpression' which itself contains a reference to a 'DIGlobalVariable'. This is a straightforward change. In the future, we should rename 'DIGlobalVariable' in the FFI bindings, assuming we will only refer to 'DIGlobalVariableExpression' and not 'DIGlobalVariable'.
This commit is contained in:
parent
0648517faf
commit
768c6c081e
2 changed files with 10 additions and 0 deletions
|
@ -588,7 +588,11 @@ extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateStaticVariable(
|
|||
}
|
||||
#endif
|
||||
|
||||
#if LLVM_VERSION_GE(4, 0)
|
||||
return wrap(Builder->createGlobalVariableExpression(
|
||||
#else
|
||||
return wrap(Builder->createGlobalVariable(
|
||||
#endif
|
||||
unwrapDI<DIDescriptor>(Context), Name, LinkageName,
|
||||
unwrapDI<DIFile>(File), LineNo, unwrapDI<DIType>(Ty), IsLocalToUnit,
|
||||
#if LLVM_VERSION_GE(4, 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue