diff options
| author | 2012-05-11 11:05:45 +0800 | |
|---|---|---|
| committer | 2012-05-15 02:29:51 -0700 | |
| commit | b1bab1c9e40ff9049f57f09a876ac77b44517144 (patch) | |
| tree | 530ac235980d51562ffdc02be53556b836d182aa /src/compiler_llvm/compilation_unit.cc | |
| parent | 7834cbd5d8a0e61db14339910d2223a3e59d7efc (diff) | |
Code cleanup: Remove unnecessary parameter.
Change-Id: I978ba7857be99af643cf5377029662b056431e3c
Diffstat (limited to 'src/compiler_llvm/compilation_unit.cc')
| -rw-r--r-- | src/compiler_llvm/compilation_unit.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc index fbd2f05498..30c6aa1e14 100644 --- a/src/compiler_llvm/compilation_unit.cc +++ b/src/compiler_llvm/compilation_unit.cc @@ -207,7 +207,7 @@ bool CompilationUnit::Materialize(size_t thread_count) { if (thread_count == 1) { llvm::raw_string_ostream str_os(elf_image_); - bool success = MaterializeToFile(str_os, insn_set_); + bool success = MaterializeToFile(str_os); LOG(INFO) << "Compilation Unit: " << elf_idx_ << (success ? " (done)" : " (failed)"); // Free the resources @@ -244,7 +244,7 @@ bool CompilationUnit::Materialize(size_t thread_count) { // TODO: Should use exec* family instead of invoking a function. // Forward our compilation request to bcc. - exit(static_cast<int>(!MaterializeToFile(fd_os, insn_set_))); + exit(static_cast<int>(!MaterializeToFile(fd_os))); } else { // Parent process // Close the unused pipe write end @@ -325,19 +325,12 @@ void CompilationUnit::UpdateFrameSizeInBytes(const llvm::Function* func, } } -bool CompilationUnit::MaterializeToFile(llvm::raw_ostream& out_stream, - InstructionSet insn_set) { - // Initialize the LLVM first - llvm::InitializeAllTargets(); - llvm::InitializeAllTargetMCs(); - llvm::InitializeAllAsmPrinters(); - llvm::InitializeAllAsmParsers(); - +bool CompilationUnit::MaterializeToFile(llvm::raw_ostream& out_stream) { // Lookup the LLVM target char const* target_triple = NULL; char const* target_attr = NULL; - switch (insn_set) { + switch (insn_set_) { case kThumb2: target_triple = "thumb-none-linux-gnueabi"; target_attr = "+thumb2,+neon,+neonfp,+vfp3"; @@ -360,7 +353,7 @@ bool CompilationUnit::MaterializeToFile(llvm::raw_ostream& out_stream, break; default: - LOG(FATAL) << "Unknown instruction set: " << insn_set; + LOG(FATAL) << "Unknown instruction set: " << insn_set_; } std::string errmsg; |