Skip to content

Commit

Permalink
Don't link mcjit/interpreter LLVM components
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jul 20, 2019
1 parent f69b071 commit b9784b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
13 changes: 3 additions & 10 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ fn main() {

let mut optional_components =
vec!["x86", "arm", "aarch64", "amdgpu", "mips", "powerpc",
"systemz", "jsbackend", "webassembly", "msp430", "sparc", "nvptx"];
"systemz", "jsbackend", "webassembly", "msp430", "sparc", "nvptx",
"hexagon"];

let mut version_cmd = Command::new(&llvm_config);
version_cmd.arg("--version");
Expand All @@ -82,27 +83,19 @@ fn main() {
if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
(major, minor)
} else {
(3, 9)
(6, 0)
};

if major > 3 {
optional_components.push("hexagon");
}

if major > 6 {
optional_components.push("riscv");
}

// FIXME: surely we don't need all these components, right? Stuff like mcjit
// or interpreter the compiler itself never uses.
let required_components = &["ipo",
"bitreader",
"bitwriter",
"linker",
"asmparser",
"mcjit",
"lto",
"interpreter",
"instrumentation"];

let components = output(Command::new(&llvm_config).arg("--components"));
Expand Down
2 changes: 0 additions & 2 deletions src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
using namespace llvm;
using namespace llvm::legacy;

extern cl::opt<bool> EnableARMEHABI;

typedef struct LLVMOpaquePass *LLVMPassRef;
typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;

Expand Down
4 changes: 0 additions & 4 deletions src/rustllvm/rustllvm.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
#include "llvm-c/BitReader.h"
#include "llvm-c/Core.h"
#include "llvm-c/ExecutionEngine.h"
#include "llvm-c/Object.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/Lint.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/LLVMContext.h"
Expand Down

0 comments on commit b9784b1

Please sign in to comment.