Skip to content

Commit

Permalink
Update for llvm api change.
Browse files Browse the repository at this point in the history
  • Loading branch information
cixtor authored and graydon committed Aug 11, 2011
1 parent c96f62a commit 4cee063
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
7 changes: 0 additions & 7 deletions src/comp/lib/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ native "cdecl" mod llvm = "rustllvm" {
fn LLVMBuildInvoke(B: BuilderRef, Fn: ValueRef, Args: *ValueRef,
NumArgs: uint, Then: BasicBlockRef,
Catch: BasicBlockRef, Name: sbuf) -> ValueRef;
fn LLVMBuildUnwind(B: BuilderRef) -> ValueRef;
fn LLVMBuildUnreachable(B: BuilderRef) -> ValueRef;

/* Add a case to the switch instruction */
Expand Down Expand Up @@ -949,12 +948,6 @@ obj builder(B: BuilderRef, terminated: @mutable bool,
Then, Catch, str::buf(""));
}

fn Unwind() -> ValueRef {
assert (!*terminated);
*terminated = true;
ret llvm::LLVMBuildUnwind(B);
}

fn Unreachable() -> ValueRef {
assert (!*terminated);
*terminated = true;
Expand Down
3 changes: 2 additions & 1 deletion src/rustllvm/Passes.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "llvm/Analysis/Passes.h"
#include "llvm/Support/PassManagerBuilder.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/PassManager.h"
#include "llvm-c/Core.h"
#include <cstdlib>
Expand Down
5 changes: 3 additions & 2 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ extern "C" void LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
llvm::NoFramePointerElim = true;

InitializeAllTargets();
InitializeAllTargetMCs();
InitializeAllAsmPrinters();
InitializeAllAsmParsers();
TargetMachine::setRelocationModel(Reloc::PIC_);
std::string Err;
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
std::string FeaturesStr;
std::string Trip(triple);
std::string CPUStr = llvm::sys::getHostCPUName();
TargetMachine *Target = TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr);
TargetMachine *Target =
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr, Reloc::PIC_);
bool NoVerify = false;
PassManager *PM = unwrap<PassManager>(PMR);
std::string ErrorInfo;
Expand Down
2 changes: 0 additions & 2 deletions src/rustllvm/rustllvm.def.in
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ LLVMBuildUDiv
LLVMBuildUIToFP
LLVMBuildURem
LLVMBuildUnreachable
LLVMBuildUnwind
LLVMBuildVAArg
LLVMBuildXor
LLVMBuildZExt
Expand Down Expand Up @@ -429,7 +428,6 @@ LLVMInt8TypeInContext
LLVMIntPtrType
LLVMIntType
LLVMIntTypeInContext
LLVMInvalidateStructLayout
LLVMIsAAllocaInst
LLVMIsAArgument
LLVMIsABasicBlock
Expand Down

0 comments on commit 4cee063

Please sign in to comment.