Skip to content
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

Update for llvm api change. #715

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
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