diff options
author | Ian Rogers <irogers@google.com> | 2014-03-01 04:49:17 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-01 04:49:17 +0000 |
commit | e4a74a6ac8d1486b1227504044a60002e69a9fec (patch) | |
tree | 117d99c16f201b2f14adfe0922e56b9ff433c133 /compiler | |
parent | 3c506f9877b4a106d93169b6bb5610b24a84d61c (diff) | |
parent | b48b9eb6d181a1f52e2e605cf26a21505f1d46ed (diff) | |
download | android_art-e4a74a6ac8d1486b1227504044a60002e69a9fec.tar.gz android_art-e4a74a6ac8d1486b1227504044a60002e69a9fec.tar.bz2 android_art-e4a74a6ac8d1486b1227504044a60002e69a9fec.zip |
Merge "Fix clang to compile and run host tests."
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/Android.mk | 14 | ||||
-rw-r--r-- | compiler/common_compiler_test.h | 2 | ||||
-rw-r--r-- | compiler/compiler_backend.h | 2 | ||||
-rw-r--r-- | compiler/dex/frontend.h | 2 | ||||
-rw-r--r-- | compiler/dex/pass.h | 4 | ||||
-rw-r--r-- | compiler/dex/portable/mir_to_gbc.cc | 1 | ||||
-rw-r--r-- | compiler/dex/portable/mir_to_gbc.h | 7 | ||||
-rw-r--r-- | compiler/dex/quick/dex_file_method_inliner.h | 11 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
-rw-r--r-- | compiler/utils/arena_bit_vector.cc | 4 | ||||
-rw-r--r-- | compiler/utils/arm/managed_register_arm.cc | 10 | ||||
-rw-r--r-- | compiler/utils/assembler.h | 2 | ||||
-rw-r--r-- | compiler/utils/mips/managed_register_mips.cc | 11 | ||||
-rw-r--r-- | compiler/utils/x86/managed_register_x86.cc | 13 |
14 files changed, 32 insertions, 53 deletions
diff --git a/compiler/Android.mk b/compiler/Android.mk index 8f840cc3f5..b1b6fc5c66 100644 --- a/compiler/Android.mk +++ b/compiler/Android.mk @@ -106,7 +106,7 @@ endif LIBART_COMPILER_CFLAGS := ifeq ($(ART_USE_PORTABLE_COMPILER),true) -LIBART_COMPILER_SRC_FILES += +LIBART_COMPILER_SRC_FILES += \ dex/portable/mir_to_gbc.cc \ elf_writer_mclinker.cc \ jni/portable/jni_compiler.cc \ @@ -120,11 +120,12 @@ LIBART_COMPILER_SRC_FILES += 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 +LIBART_COMPILER_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 endif LIBART_COMPILER_ENUM_OPERATOR_OUT_HEADER_FILES := \ - dex/compiler_enums.h + dex/compiler_enums.h \ + dex/quick/dex_file_method_inliner.h # $(1): target or host # $(2): ndebug or debug @@ -211,12 +212,15 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PAT ifeq ($(TARGET_ARCH),arm64) $$(info TODOAArch64: $$(LOCAL_PATH)/Android.mk Add Arm64 specific MCLinker libraries) endif # TARGET_ARCH != arm64 + include $(LLVM_DEVICE_BUILD_MK) else # host LOCAL_STATIC_LIBRARIES += libmcldARMInfo libmcldARMTarget LOCAL_STATIC_LIBRARIES += libmcldX86Info libmcldX86Target LOCAL_STATIC_LIBRARIES += libmcldMipsInfo libmcldMipsTarget + include $(LLVM_HOST_BUILD_MK) endif LOCAL_STATIC_LIBRARIES += libmcldCore libmcldObject libmcldADT libmcldFragment libmcldTarget libmcldCodeGen libmcldLDVariant libmcldMC libmcldSupport libmcldLD + include $(LLVM_GEN_INTRINSICS_MK) endif LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime @@ -228,13 +232,9 @@ $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PAT LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk ifeq ($$(art_target_or_host),target) LOCAL_SHARED_LIBRARIES += libcutils - include $(LLVM_GEN_INTRINSICS_MK) - include $(LLVM_DEVICE_BUILD_MK) include $(BUILD_SHARED_LIBRARY) else # host LOCAL_STATIC_LIBRARIES += libcutils - include $(LLVM_GEN_INTRINSICS_MK) - include $(LLVM_HOST_BUILD_MK) include $(BUILD_HOST_SHARED_LIBRARY) endif diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 0999d09e71..9bcc040dfc 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -240,7 +240,7 @@ class CommonCompilerTest : public CommonRuntimeTest { #if GCC_VERSION >= 40303 __builtin___clear_cache(reinterpret_cast<void*>(base), reinterpret_cast<void*>(base + len)); #else - LOG(FATAL) << "UNIMPLEMENTED: cache flush"; + LOG(WARNING) << "UNIMPLEMENTED: cache flush"; #endif } diff --git a/compiler/compiler_backend.h b/compiler/compiler_backend.h index 01a69afc89..2d68b21be5 100644 --- a/compiler/compiler_backend.h +++ b/compiler/compiler_backend.h @@ -23,7 +23,7 @@ namespace art { class Backend; -class CompilationUnit; +struct CompilationUnit; class CompilerDriver; class CompiledMethod; class MIRGraph; diff --git a/compiler/dex/frontend.h b/compiler/dex/frontend.h index 8ce12067ee..22a7b8cfb0 100644 --- a/compiler/dex/frontend.h +++ b/compiler/dex/frontend.h @@ -105,7 +105,7 @@ class LLVMInfo { UniquePtr<art::llvm::IRBuilder> ir_builder_; }; -struct CompiledMethod; +class CompiledMethod; class CompilerDriver; } // namespace art diff --git a/compiler/dex/pass.h b/compiler/dex/pass.h index 255892e324..9457d5be76 100644 --- a/compiler/dex/pass.h +++ b/compiler/dex/pass.h @@ -22,8 +22,8 @@ namespace art { // Forward declarations. -class BasicBlock; -class CompilationUnit; +struct BasicBlock; +struct CompilationUnit; class Pass; /** diff --git a/compiler/dex/portable/mir_to_gbc.cc b/compiler/dex/portable/mir_to_gbc.cc index 3187fbb28c..70438ecd50 100644 --- a/compiler/dex/portable/mir_to_gbc.cc +++ b/compiler/dex/portable/mir_to_gbc.cc @@ -30,6 +30,7 @@ #include "dex/compiler_internals.h" #include "dex/dataflow_iterator-inl.h" #include "dex/frontend.h" +#include "llvm/ir_builder.h" #include "llvm/llvm_compilation_unit.h" #include "llvm/utils_llvm.h" #include "mir_to_gbc.h" diff --git a/compiler/dex/portable/mir_to_gbc.h b/compiler/dex/portable/mir_to_gbc.h index 2b681f6097..e97634c519 100644 --- a/compiler/dex/portable/mir_to_gbc.h +++ b/compiler/dex/portable/mir_to_gbc.h @@ -17,11 +17,18 @@ #ifndef ART_COMPILER_DEX_PORTABLE_MIR_TO_GBC_H_ #define ART_COMPILER_DEX_PORTABLE_MIR_TO_GBC_H_ +#include <llvm/ADT/ArrayRef.h> +#include <llvm/IR/BasicBlock.h> +#include <llvm/IR/IRBuilder.h> +#include <llvm/IR/LLVMContext.h> +#include <llvm/IR/Module.h> + #include "invoke_type.h" #include "compiled_method.h" #include "dex/compiler_enums.h" #include "dex/compiler_ir.h" #include "dex/backend.h" +#include "llvm/intrinsic_helper.h" #include "llvm/llvm_compilation_unit.h" #include "safe_map.h" diff --git a/compiler/dex/quick/dex_file_method_inliner.h b/compiler/dex/quick/dex_file_method_inliner.h index 3dcb964fab..b4d8dd6009 100644 --- a/compiler/dex/quick/dex_file_method_inliner.h +++ b/compiler/dex/quick/dex_file_method_inliner.h @@ -31,7 +31,7 @@ namespace verifier { class MethodVerifier; } // namespace verifier -class CallInfo; +struct CallInfo; class Mir2Lir; enum InlineMethodOpcode : uint16_t { @@ -61,6 +61,7 @@ enum InlineMethodOpcode : uint16_t { kInlineOpIGet, kInlineOpIPut, }; +std::ostream& operator<<(std::ostream& os, const InlineMethodOpcode& rhs); enum InlineMethodFlags : uint16_t { kNoInlineMethodFlags = 0x0000, @@ -78,13 +79,13 @@ enum IntrinsicFlags { // kIntrinsicIsEmptyOrLength kIntrinsicFlagLength = kIntrinsicFlagNone, - kIntrinsicFlagIsEmpty = 1, + kIntrinsicFlagIsEmpty = kIntrinsicFlagMin, // kIntrinsicIndexOf - kIntrinsicFlagBase0 = 1, + kIntrinsicFlagBase0 = kIntrinsicFlagMin, // kIntrinsicUnsafeGet, kIntrinsicUnsafePut, kIntrinsicUnsafeCas - kIntrinsicFlagIsLong = 1, + kIntrinsicFlagIsLong = kIntrinsicFlagMin, // kIntrinsicUnsafeGet, kIntrinsicUnsafePut kIntrinsicFlagIsVolatile = 2, // kIntrinsicUnsafePut, kIntrinsicUnsafeCas @@ -187,7 +188,6 @@ class DexFileMethodInliner { */ bool GenSpecial(Mir2Lir* backend, uint32_t method_idx); - private: /** * To avoid multiple lookups of a class by its descriptor, we cache its * type index in the IndexCache. These are the indexes into the IndexCache @@ -311,6 +311,7 @@ class DexFileMethodInliner { kProtoCacheLast }; + private: /** * The maximum number of method parameters we support in the ProtoDef. */ diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 377eb6fa34..1bd2c1b20b 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -48,7 +48,7 @@ class AOTCompilationStats; class CompilerOptions; class DexCompilationUnit; class DexFileToMethodInlinerMap; -class InlineIGetIPutData; +struct InlineIGetIPutData; class OatWriter; class ParallelCompilationManager; class TimingLogger; diff --git a/compiler/utils/arena_bit_vector.cc b/compiler/utils/arena_bit_vector.cc index 6f03524651..220ff14baa 100644 --- a/compiler/utils/arena_bit_vector.cc +++ b/compiler/utils/arena_bit_vector.cc @@ -42,6 +42,8 @@ class ArenaBitVectorAllocator : public Allocator { ArenaBitVector::ArenaBitVector(ArenaAllocator* arena, unsigned int start_bits, bool expandable, OatBitMapKind kind) - : BitVector(start_bits, expandable, new (arena) ArenaBitVectorAllocator(arena)), kind_(kind) {} + : BitVector(start_bits, expandable, new (arena) ArenaBitVectorAllocator(arena)), kind_(kind) { + UNUSED(kind_); +} } // namespace art diff --git a/compiler/utils/arm/managed_register_arm.cc b/compiler/utils/arm/managed_register_arm.cc index 57c23059de..1fdc110dcf 100644 --- a/compiler/utils/arm/managed_register_arm.cc +++ b/compiler/utils/arm/managed_register_arm.cc @@ -21,16 +21,6 @@ namespace art { namespace arm { -// We need all registers for caching of locals. -// Register R9 .. R15 are reserved. -static const int kNumberOfAvailableCoreRegisters = (R8 - R0) + 1; -static const int kNumberOfAvailableSRegisters = kNumberOfSRegisters; -static const int kNumberOfAvailableDRegisters = kNumberOfDRegisters; -static const int kNumberOfAvailableOverlappingDRegisters = - kNumberOfOverlappingDRegisters; -static const int kNumberOfAvailableRegisterPairs = kNumberOfRegisterPairs; - - // Returns true if this managed-register overlaps the other managed-register. bool ArmManagedRegister::Overlaps(const ArmManagedRegister& other) const { if (IsNoRegister() || other.IsNoRegister()) return false; diff --git a/compiler/utils/assembler.h b/compiler/utils/assembler.h index c9be4edbf8..296254d140 100644 --- a/compiler/utils/assembler.h +++ b/compiler/utils/assembler.h @@ -282,7 +282,9 @@ class AssemblerBuffer { byte* cursor_; byte* limit_; AssemblerFixup* fixup_; +#ifndef NDEBUG bool fixups_processed_; +#endif // Head of linked list of slow paths SlowPath* slow_path_; diff --git a/compiler/utils/mips/managed_register_mips.cc b/compiler/utils/mips/managed_register_mips.cc index 195dafb0a1..5a8c0481a5 100644 --- a/compiler/utils/mips/managed_register_mips.cc +++ b/compiler/utils/mips/managed_register_mips.cc @@ -21,17 +21,6 @@ namespace art { namespace mips { -// These core registers are never available for allocation. -static const Register kReservedCoreRegistersArray[] = { S0, S1 }; - -// We need all registers for caching. -static const int kNumberOfAvailableCoreRegisters = (S7 - T0) + 1; -static const int kNumberOfAvailableFRegisters = kNumberOfFRegisters; -static const int kNumberOfAvailableDRegisters = kNumberOfDRegisters; -static const int kNumberOfAvailableOverlappingDRegisters = - kNumberOfOverlappingDRegisters; -static const int kNumberOfAvailableRegisterPairs = kNumberOfRegisterPairs; - bool MipsManagedRegister::Overlaps(const MipsManagedRegister& other) const { if (IsNoRegister() || other.IsNoRegister()) return false; CHECK(IsValidManagedRegister()); diff --git a/compiler/utils/x86/managed_register_x86.cc b/compiler/utils/x86/managed_register_x86.cc index 4697d06136..7fae7a8b6f 100644 --- a/compiler/utils/x86/managed_register_x86.cc +++ b/compiler/utils/x86/managed_register_x86.cc @@ -21,19 +21,6 @@ namespace art { namespace x86 { -// These cpu registers are never available for allocation. -static const Register kReservedCpuRegistersArray[] = { ESP }; - - -// We reduce the number of available registers for allocation in debug-code -// mode in order to increase register pressure. - -// We need all registers for caching. -static const int kNumberOfAvailableCpuRegisters = kNumberOfCpuRegisters; -static const int kNumberOfAvailableXmmRegisters = kNumberOfXmmRegisters; -static const int kNumberOfAvailableRegisterPairs = kNumberOfRegisterPairs; - - // Define register pairs. // This list must be kept in sync with the RegisterPair enum. #define REGISTER_PAIR_LIST(P) \ |