Skip to content

Commit 8d29367

Browse files
committed
Fix build issues once LLVM has been upgraded
* LLVM now has a C interface to LLVMBuildAtomicRMW * The exception handling support for the JIT seems to have been dropped * Various interfaces have been added or headers have changed
1 parent 1d06aaa commit 8d29367

File tree

5 files changed

+6
-13
lines changed

5 files changed

+6
-13
lines changed

src/librustc/back/passes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub fn create_standard_passes(level: OptLevel) -> ~[~str] {
9797
passes.push(~"sroa");
9898
passes.push(~"domtree");
9999
passes.push(~"early-cse");
100-
passes.push(~"simplify-libcalls");
101100
passes.push(~"lazy-value-info");
102101
passes.push(~"jump-threading");
103102
passes.push(~"correlated-propagation");

src/librustc/lib/llvm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,8 @@ pub mod llvm {
15411541
Op: AtomicBinOp,
15421542
LHS: ValueRef,
15431543
RHS: ValueRef,
1544-
Order: AtomicOrdering)
1544+
Order: AtomicOrdering,
1545+
SingleThreaded: Bool)
15451546
-> ValueRef;
15461547

15471548
pub fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);

src/librustc/middle/trans/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ impl Builder {
940940
dst: ValueRef, src: ValueRef,
941941
order: AtomicOrdering) -> ValueRef {
942942
unsafe {
943-
llvm::LLVMBuildAtomicRMW(self.llbuilder, op, dst, src, order)
943+
llvm::LLVMBuildAtomicRMW(self.llbuilder, op, dst, src, order, False)
944944
}
945945
}
946946

src/rustllvm/RustWrapper.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class RustMCJITMemoryManager : public JITMemoryManager {
113113

114114
virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
115115
unsigned SectionID, bool isReadOnly);
116+
bool finalizeMemory(std::string *ErrMsg) { return false; }
116117

117118
virtual bool applyPermissions(std::string *Str);
118119

@@ -340,7 +341,6 @@ LLVMRustBuildJIT(void* mem,
340341

341342
std::string Err;
342343
TargetOptions Options;
343-
Options.JITExceptionHandling = true;
344344
Options.JITEmitDebugInfo = true;
345345
Options.NoFramePointerElim = true;
346346
Options.EnableSegmentedStacks = EnableSegmentedStacks;
@@ -516,15 +516,6 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
516516
extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B, AtomicOrdering order) {
517517
return wrap(unwrap(B)->CreateFence(order));
518518
}
519-
extern "C" LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,
520-
AtomicRMWInst::BinOp op,
521-
LLVMValueRef target,
522-
LLVMValueRef source,
523-
AtomicOrdering order) {
524-
return wrap(unwrap(B)->CreateAtomicRMW(op,
525-
unwrap(target), unwrap(source),
526-
order));
527-
}
528519

529520
extern "C" void LLVMSetDebug(int Enabled) {
530521
#ifndef NDEBUG

src/rustllvm/rustllvm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#include "llvm/IR/IRBuilder.h"
1112
#include "llvm/IR/InlineAsm.h"
1213
#include "llvm/IR/LLVMContext.h"
14+
#include "llvm/IR/Module.h"
1315
#include "llvm/Linker.h"
1416
#include "llvm/PassManager.h"
1517
#include "llvm/IR/InlineAsm.h"

0 commit comments

Comments
 (0)