diff options
| author | bors <bors@rust-lang.org> | 2017-02-11 22:10:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-11 22:10:53 +0000 |
| commit | ba7cf7cc5daefb9f28371b8be87dc262fb55937c (patch) | |
| tree | f926f6bb79e28a612a579ae62a234139536a5f08 /src/rustllvm/RustWrapper.cpp | |
| parent | bae454edc5e18e81b831baf4a7647bf2dda620a8 (diff) | |
| parent | aebce5bd2aa9f75b09fc30638736e14761989fce (diff) | |
| download | rust-ba7cf7cc5daefb9f28371b8be87dc262fb55937c.tar.gz rust-ba7cf7cc5daefb9f28371b8be87dc262fb55937c.zip | |
Auto merge of #39747 - mattico:fix-llvm4-createcompileunit, r=alexcrichton
[LLVM 4.0] Fix CreateCompileUnit This is largely identical to @dylanmckay's [patch](https://github.com/dylanmckay), except that it doesn't try to use `file_metadata()`. I don't think that is necessary because we don't want the compile unit to be added to `debug_context.created_files`, though I'd like confirmation from someone who knows for sure. If that is needed, I can modify `file_metadata_()` so that it can be used from `compile_unit_metadata()`.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 27233a8b075..40432735911 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -474,11 +474,19 @@ extern "C" void LLVMRustDIBuilderFinalize(LLVMRustDIBuilderRef Builder) { } extern "C" LLVMRustMetadataRef LLVMRustDIBuilderCreateCompileUnit( - LLVMRustDIBuilderRef Builder, unsigned Lang, const char *File, - const char *Dir, const char *Producer, bool isOptimized, const char *Flags, + LLVMRustDIBuilderRef Builder, unsigned Lang, LLVMRustMetadataRef FileRef, + const char *Producer, bool isOptimized, const char *Flags, unsigned RuntimeVer, const char *SplitName) { - return wrap(Builder->createCompileUnit(Lang, File, Dir, Producer, isOptimized, + auto *File = unwrapDI<DIFile>(FileRef); + +#if LLVM_VERSION_GE(4, 0) + return wrap(Builder->createCompileUnit(Lang, File, Producer, isOptimized, Flags, RuntimeVer, SplitName)); +#else + return wrap(Builder->createCompileUnit(Lang, File->getFilename(), + File->getDirectory(), Producer, isOptimized, + Flags, RuntimeVer, SplitName)); +#endif } extern "C" LLVMRustMetadataRef |
