diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-21 15:23:10 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-21 15:23:10 -0700 |
| commit | d14fb2f0d6d6e6ccba713ed9605eb6c83a7d9c4f (patch) | |
| tree | 97865976d3a66f2e972637f2d60c4c653cf1b95f /src/rustllvm/RustWrapper.cpp | |
| parent | 6b1ce4957401d561da02973260b58a4fe58a1ebc (diff) | |
| parent | ba276adab596bafe48a27dc02dcc5867446a52b5 (diff) | |
| download | rust-d14fb2f0d6d6e6ccba713ed9605eb6c83a7d9c4f.tar.gz rust-d14fb2f0d6d6e6ccba713ed9605eb6c83a7d9c4f.zip | |
rollup merge of #24635: tamird/llvm-3.5
r? @alexcrichton
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 492993ec9a9..fe0a7b454c1 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -412,7 +412,7 @@ extern "C" LLVMMetadataRef LLVMDIBuilderCreateStaticVariable( bool isLocalToUnit, LLVMValueRef Val, LLVMMetadataRef Decl = NULL) { -#if LLVM_VERSION_MINOR == 6 +#if LLVM_VERSION_MINOR >= 6 return wrap(Builder->createGlobalVariable(unwrapDI<DIDescriptor>(Context), #else return wrap(Builder->createStaticVariable(unwrapDI<DIDescriptor>(Context), @@ -440,7 +440,7 @@ extern "C" LLVMMetadataRef LLVMDIBuilderCreateVariable( int64_t* AddrOps, unsigned AddrOpsCount, unsigned ArgNo) { -#if LLVM_VERSION_MINOR < 6 +#if LLVM_VERSION_MINOR == 5 if (AddrOpsCount > 0) { SmallVector<llvm::Value *, 16> addr_ops; llvm::Type *Int64Ty = Type::getInt64Ty(unwrap<MDNode>(Scope)->getContext()); @@ -707,12 +707,12 @@ extern "C" void LLVMWriteValueToString(LLVMValueRef Value, RustStringRef str) { extern "C" bool LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) { Module *Dst = unwrap(dst); -#if LLVM_VERSION_MINOR == 5 - MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len)); - ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext()); -#else +#if LLVM_VERSION_MINOR >= 6 std::unique_ptr<MemoryBuffer> buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len)); ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(std::move(buf), Dst->getContext()); +#else + MemoryBuffer* buf = MemoryBuffer::getMemBufferCopy(StringRef(bc, len)); + ErrorOr<Module *> Src = llvm::getLazyBitcodeModule(buf, Dst->getContext()); #endif if (!Src) { LLVMRustSetLastError(Src.getError().message().c_str()); @@ -840,16 +840,6 @@ LLVMRustSetDLLExportStorageClass(LLVMValueRef Value) { V->setDLLStorageClass(GlobalValue::DLLExportStorageClass); } -extern "C" int -LLVMVersionMinor() { - return LLVM_VERSION_MINOR; -} - -extern "C" int -LLVMVersionMajor() { - return LLVM_VERSION_MAJOR; -} - // Note that the two following functions look quite similar to the // LLVMGetSectionName function. Sadly, it appears that this function only // returns a char* pointer, which isn't guaranteed to be null-terminated. The |
