diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-02-05 12:45:13 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-05 12:45:13 -0500 |
| commit | 3e7ee3535ef6da53ebb2e49c9c0bc07d4b0c6eef (patch) | |
| tree | 3e45a8a1fc26dc79299044062029a9ea2e37ea2e /src/rustllvm/RustWrapper.cpp | |
| parent | 4e67bf92e3fb1321325d375933c4c0d2b233fef9 (diff) | |
| parent | 768c6c081e4a8cac6b6f8eee5cde72ed13a7e87a (diff) | |
| download | rust-3e7ee3535ef6da53ebb2e49c9c0bc07d4b0c6eef.tar.gz rust-3e7ee3535ef6da53ebb2e49c9c0bc07d4b0c6eef.zip | |
Rollup merge of #39528 - dylanmckay:llvm-4.0-diglobalvar, r=alexcrichton
[LLVM 4.0] 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`.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 34ee7d552f3..c7bcd255818 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -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) |
