Skip to content

LLVM upgrades #7115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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
  • Loading branch information
alexcrichton committed Aug 4, 2013
commit 8d2936765052f7267a16da5717d403dfe300d180
1 change: 0 additions & 1 deletion src/librustc/back/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ pub fn create_standard_passes(level: OptLevel) -> ~[~str] {
passes.push(~"sroa");
passes.push(~"domtree");
passes.push(~"early-cse");
passes.push(~"simplify-libcalls");
passes.push(~"lazy-value-info");
passes.push(~"jump-threading");
passes.push(~"correlated-propagation");
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/lib/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,8 @@ pub mod llvm {
Op: AtomicBinOp,
LHS: ValueRef,
RHS: ValueRef,
Order: AtomicOrdering)
Order: AtomicOrdering,
SingleThreaded: Bool)
-> ValueRef;

pub fn LLVMBuildAtomicFence(B: BuilderRef, Order: AtomicOrdering);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ impl Builder {
dst: ValueRef, src: ValueRef,
order: AtomicOrdering) -> ValueRef {
unsafe {
llvm::LLVMBuildAtomicRMW(self.llbuilder, op, dst, src, order)
llvm::LLVMBuildAtomicRMW(self.llbuilder, op, dst, src, order, False)
}
}

Expand Down
11 changes: 1 addition & 10 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class RustMCJITMemoryManager : public JITMemoryManager {

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

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

Expand Down Expand Up @@ -340,7 +341,6 @@ LLVMRustBuildJIT(void* mem,

std::string Err;
TargetOptions Options;
Options.JITExceptionHandling = true;
Options.JITEmitDebugInfo = true;
Options.NoFramePointerElim = true;
Options.EnableSegmentedStacks = EnableSegmentedStacks;
Expand Down Expand Up @@ -516,15 +516,6 @@ extern "C" LLVMValueRef LLVMBuildAtomicCmpXchg(LLVMBuilderRef B,
extern "C" LLVMValueRef LLVMBuildAtomicFence(LLVMBuilderRef B, AtomicOrdering order) {
return wrap(unwrap(B)->CreateFence(order));
}
extern "C" LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,
AtomicRMWInst::BinOp op,
LLVMValueRef target,
LLVMValueRef source,
AtomicOrdering order) {
return wrap(unwrap(B)->CreateAtomicRMW(op,
unwrap(target), unwrap(source),
order));
}

extern "C" void LLVMSetDebug(int Enabled) {
#ifndef NDEBUG
Expand Down
2 changes: 2 additions & 0 deletions src/rustllvm/rustllvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Linker.h"
#include "llvm/PassManager.h"
#include "llvm/IR/InlineAsm.h"
Expand Down