diff options
| author | bors <bors@rust-lang.org> | 2014-10-05 04:57:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-05 04:57:11 +0000 |
| commit | 3b8c528d083b2e1f6b34eceb518d60c5efdb4ef4 (patch) | |
| tree | 0ffee9636a89d46fae239565cb8f17b648350faa /src/rustllvm/PassWrapper.cpp | |
| parent | 026206695af8355d0b52000ca0f491a1ab5b051d (diff) | |
| parent | 4b22178d325704d81522c15570498b7467b3152d (diff) | |
| download | rust-3b8c528d083b2e1f6b34eceb518d60c5efdb4ef4.tar.gz rust-3b8c528d083b2e1f6b34eceb518d60c5efdb4ef4.zip | |
auto merge of #17776 : luqmana/rust/ul, r=alexcrichton
Update our LLVM snapshot to master (as of ~ Wed Oct 1 18:49:58 2014 +0000). Since my patches have landed upstream this fixes #13429 and #7298.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 195b044ccdc..eb074001d58 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -118,7 +118,9 @@ LLVMRustAddAnalysisPasses(LLVMTargetMachineRef TM, LLVMPassManagerRef PMR, LLVMModuleRef M) { PassManagerBase *PM = unwrap(PMR); -#if LLVM_VERSION_MINOR >= 5 +#if LLVM_VERSION_MINOR >= 6 + PM->add(new DataLayoutPass()); +#elif LLVM_VERSION_MINOR == 5 PM->add(new DataLayoutPass(unwrap(M))); #else PM->add(new DataLayout(unwrap(M))); @@ -187,7 +189,12 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, PassManager *PM = unwrap<PassManager>(PMR); std::string ErrorInfo; -#if LLVM_VERSION_MINOR >= 4 +#if LLVM_VERSION_MINOR >= 6 + std::error_code EC; + raw_fd_ostream OS(path, EC, sys::fs::F_None); + if (EC) + ErrorInfo = EC.message(); +#elif LLVM_VERSION_MINOR >= 4 raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #else raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary); @@ -210,7 +217,12 @@ LLVMRustPrintModule(LLVMPassManagerRef PMR, PassManager *PM = unwrap<PassManager>(PMR); std::string ErrorInfo; -#if LLVM_VERSION_MINOR >= 4 +#if LLVM_VERSION_MINOR >= 6 + std::error_code EC; + raw_fd_ostream OS(path, EC, sys::fs::F_None); + if (EC) + ErrorInfo = EC.message(); +#elif LLVM_VERSION_MINOR >= 4 raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_None); #else raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary); |
