diff options
author | 2014-02-20 10:16:24 +0000 | |
---|---|---|
committer | 2014-02-20 10:16:24 +0000 | |
commit | 3188d117d6f1ba5f3a30d0ff231d816ebb59a7f7 (patch) | |
tree | fff9c689f7dde39d43cd607ef87c4bf8dc19bc21 | |
parent | 3c95c591e054ecd2eac40a4d25668f239782aabd (diff) | |
parent | f3e2cc4a38389aa75eb8ee3973a535254bf1c8d2 (diff) |
Merge "Code cleanup to avoid LLVM dependency when building with quick only."
-rw-r--r-- | build/Android.common.mk | 2 | ||||
-rw-r--r-- | compiler/Android.mk | 30 | ||||
-rw-r--r-- | compiler/compiler_backend.cc | 15 | ||||
-rw-r--r-- | compiler/compiler_backend.h | 3 | ||||
-rw-r--r-- | compiler/dex/compiler_ir.h | 9 | ||||
-rw-r--r-- | compiler/dex/mir_graph.cc | 8 | ||||
-rw-r--r-- | compiler/dex/quick/x86/target_x86.cc | 5 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.cc | 13 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
-rw-r--r-- | compiler/elf_writer.cc | 1 | ||||
-rw-r--r-- | dex2oat/dex2oat.cc | 4 |
11 files changed, 46 insertions, 46 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk index 1299bebb04..704da68df2 100644 --- a/build/Android.common.mk +++ b/build/Android.common.mk @@ -127,6 +127,8 @@ art_cflags := \ -Wall \ -Werror \ -Wextra \ + -Wno-sign-promo \ + -Wno-unused-parameter \ -Wstrict-aliasing \ -fstrict-aliasing diff --git a/compiler/Android.mk b/compiler/Android.mk index 49fb05e8da..77dc367c7d 100644 --- a/compiler/Android.mk +++ b/compiler/Android.mk @@ -49,7 +49,6 @@ LIBART_COMPILER_SRC_FILES := \ dex/quick/x86/int_x86.cc \ dex/quick/x86/target_x86.cc \ dex/quick/x86/utility_x86.cc \ - dex/portable/mir_to_gbc.cc \ dex/dex_to_dex_compiler.cc \ dex/mir_dataflow.cc \ dex/mir_optimization.cc \ @@ -64,22 +63,11 @@ LIBART_COMPILER_SRC_FILES := \ dex/ssa_transformation.cc \ driver/compiler_driver.cc \ driver/dex_compilation_unit.cc \ - jni/portable/jni_compiler.cc \ jni/quick/arm/calling_convention_arm.cc \ jni/quick/mips/calling_convention_mips.cc \ jni/quick/x86/calling_convention_x86.cc \ jni/quick/calling_convention.cc \ jni/quick/jni_compiler.cc \ - llvm/compiler_llvm.cc \ - llvm/gbc_expander.cc \ - llvm/generated/art_module.cc \ - llvm/intrinsic_helper.cc \ - llvm/ir_builder.cc \ - llvm/llvm_compilation_unit.cc \ - llvm/md_builder.cc \ - llvm/runtime_support_builder.cc \ - llvm/runtime_support_builder_arm.cc \ - llvm/runtime_support_builder_x86.cc \ optimizing/builder.cc \ optimizing/nodes.cc \ trampolines/trampoline_compiler.cc \ @@ -115,8 +103,22 @@ LIBART_COMPILER_SRC_FILES += \ endif LIBART_COMPILER_CFLAGS := + ifeq ($(ART_USE_PORTABLE_COMPILER),true) - LIBART_COMPILER_SRC_FILES += elf_writer_mclinker.cc +LIBART_COMPILER_SRC_FILES += + dex/portable/mir_to_gbc.cc \ + elf_writer_mclinker.cc \ + jni/portable/jni_compiler.cc \ + llvm/compiler_llvm.cc \ + llvm/gbc_expander.cc \ + llvm/generated/art_module.cc \ + llvm/intrinsic_helper.cc \ + llvm/ir_builder.cc \ + llvm/llvm_compilation_unit.cc \ + llvm/md_builder.cc \ + llvm/runtime_support_builder.cc \ + llvm/runtime_support_builder_arm.cc \ + llvm/runtime_support_builder_x86.cc LIBART_COMPILER_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 endif @@ -197,8 +199,8 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PAT endif LOCAL_SHARED_LIBRARIES += libart endif - LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM ifeq ($(ART_USE_PORTABLE_COMPILER),true) + LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM LOCAL_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 ifeq ($$(art_target_or_host),target) LOCAL_STATIC_LIBRARIES_arm += libmcldARMInfo libmcldARMTarget diff --git a/compiler/compiler_backend.cc b/compiler/compiler_backend.cc index b8f21a9bf5..eaa39f83c1 100644 --- a/compiler/compiler_backend.cc +++ b/compiler/compiler_backend.cc @@ -177,7 +177,9 @@ class QuickBackend : public CompilerBackend { #ifdef ART_USE_PORTABLE_COMPILER extern "C" void ArtInitCompilerContext(art::CompilerDriver& driver); + extern "C" void ArtUnInitCompilerContext(art::CompilerDriver& driver); + extern "C" art::CompiledMethod* ArtCompileMethod(art::CompilerDriver& driver, const art::DexFile::CodeItem* code_item, uint32_t access_flags, @@ -186,10 +188,14 @@ extern "C" art::CompiledMethod* ArtCompileMethod(art::CompilerDriver& driver, uint32_t method_idx, jobject class_loader, const art::DexFile& dex_file); + extern "C" art::CompiledMethod* ArtLLVMJniCompileMethod(art::CompilerDriver& driver, uint32_t access_flags, uint32_t method_idx, const art::DexFile& dex_file); +extern "C" void compilerLLVMSetBitcodeFileName(art::CompilerDriver& driver, + std::string const& filename); + class LLVMBackend : public CompilerBackend { public: @@ -267,6 +273,15 @@ class LLVMBackend : public CompilerBackend { bool isPortable() const { return true; } + void SetBitcodeFileName(std::string const& filename) { + typedef void (*SetBitcodeFileNameFn)(CompilerDriver&, std::string const&); + + SetBitcodeFileNameFn set_bitcode_file_name = + reinterpret_cast<SetBitcodeFileNameFn>(compilerLLVMSetBitcodeFileName); + + set_bitcode_file_name(*this, filename); + } + private: DISALLOW_COPY_AND_ASSIGN(LLVMBackend); }; diff --git a/compiler/compiler_backend.h b/compiler/compiler_backend.h index b20c125f0a..01a69afc89 100644 --- a/compiler/compiler_backend.h +++ b/compiler/compiler_backend.h @@ -80,6 +80,9 @@ class CompilerBackend { } virtual bool IsPortable() const { return false; } + void SetBitcodeFileName(std::string const& filename) { + UNUSED(filename); + } virtual void InitCompilationUnit(CompilationUnit& cu) const = 0; diff --git a/compiler/dex/compiler_ir.h b/compiler/dex/compiler_ir.h index ded8005405..8447d23ddc 100644 --- a/compiler/dex/compiler_ir.h +++ b/compiler/dex/compiler_ir.h @@ -18,25 +18,18 @@ #define ART_COMPILER_DEX_COMPILER_IR_H_ #include <vector> -#include <llvm/IR/Module.h> + #include "compiler_enums.h" #include "dex/quick/mir_to_lir.h" #include "dex_instruction.h" #include "driver/compiler_driver.h" #include "driver/dex_compilation_unit.h" -#include "llvm/intrinsic_helper.h" -#include "llvm/ir_builder.h" #include "safe_map.h" #include "base/timing_logger.h" #include "utils/arena_allocator.h" namespace art { -class LLVMInfo; -namespace llvm { -class LlvmCompilationUnit; -} // namespace llvm - struct ArenaMemBlock; class Backend; struct Memstats; diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index dfd8e6338d..e4550d1e60 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -14,14 +14,16 @@ * limitations under the License. */ +#include "mir_graph.h" + +#include <inttypes.h> + #include "base/stl_util.h" #include "compiler_internals.h" #include "dex_file-inl.h" -#include "leb128.h" -#include "mir_graph.h" - #include "dex/quick/dex_file_to_method_inliner_map.h" #include "dex/quick/dex_file_method_inliner.h" +#include "leb128.h" namespace art { diff --git a/compiler/dex/quick/x86/target_x86.cc b/compiler/dex/quick/x86/target_x86.cc index 8e04e64a42..fa9a9447de 100644 --- a/compiler/dex/quick/x86/target_x86.cc +++ b/compiler/dex/quick/x86/target_x86.cc @@ -14,13 +14,14 @@ * limitations under the License. */ +#include <string> +#include <inttypes.h> + #include "codegen_x86.h" #include "dex/compiler_internals.h" #include "dex/quick/mir_to_lir-inl.h" #include "x86_lir.h" -#include <string> - namespace art { // FIXME: restore "static" when usage uncovered diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index b46ae2b85d..5adb792497 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -293,9 +293,6 @@ extern "C" art::CompiledMethod* ArtCompileDEX(art::CompilerDriver& compiler, jobject class_loader, const art::DexFile& dex_file); -extern "C" void compilerLLVMSetBitcodeFileName(art::CompilerDriver& driver, - std::string const& filename); - CompilerDriver::CompilerDriver(VerificationResults* verification_results, DexFileToMethodInlinerMap* method_inliner_map, CompilerBackend::Kind compiler_backend_kind, @@ -2017,16 +2014,6 @@ CompiledMethod* CompilerDriver::GetCompiledMethod(MethodReference ref) const { return it->second; } -void CompilerDriver::SetBitcodeFileName(std::string const& filename) { - typedef void (*SetBitcodeFileNameFn)(CompilerDriver&, std::string const&); - - SetBitcodeFileNameFn set_bitcode_file_name = - reinterpret_cast<SetBitcodeFileNameFn>(compilerLLVMSetBitcodeFileName); - - set_bitcode_file_name(*this, filename); -} - - void CompilerDriver::AddRequiresConstructorBarrier(Thread* self, const DexFile* dex_file, uint16_t class_def_index) { WriterMutexLock mu(self, freezing_constructor_lock_); diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index da4b69d63c..092fe52b24 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -260,8 +260,6 @@ class CompilerDriver { size_t literal_offset) LOCKS_EXCLUDED(compiled_methods_lock_); - void SetBitcodeFileName(std::string const& filename); - bool GetSupportBootImageFixup() const { return support_boot_image_fixup_; } diff --git a/compiler/elf_writer.cc b/compiler/elf_writer.cc index ba5f1cb925..6db3fa1a11 100644 --- a/compiler/elf_writer.cc +++ b/compiler/elf_writer.cc @@ -23,7 +23,6 @@ #include "driver/compiler_driver.h" #include "elf_file.h" #include "invoke_type.h" -#include "llvm/utils_llvm.h" #include "mirror/art_method-inl.h" #include "mirror/object-inl.h" #include "oat.h" diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 7f8847154a..dab419f721 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -287,9 +287,7 @@ class Dex2Oat { dump_passes, &compiler_phases_timings)); - if (compiler_backend_ == CompilerBackend::kPortable) { - driver->SetBitcodeFileName(bitcode_filename); - } + driver->GetCompilerBackend()->SetBitcodeFileName(bitcode_filename); driver->CompileAll(class_loader, dex_files, timings); |