Fix clang to compile and run host tests.
Don't use the computed goto interpreter with clang 3.4 as it causes compilation
to hang.
Avoid inclusion of LLVM_(HOST|DEVICE)_BUILD_MK except for with portable as it
sets clang incompatible cflags.
Most fixes are self-evident, for the quick dex file method inliner the enums
were being used with ostreams, so fix the enums and operator out python script
to allow this.
Note this change effects portable but this is untestable as portable was broken
by ELF file and mc linker changes.
Change-Id: Ia54348f6b1bd3f76d3b71c6e8c5f97626386b903
diff --git a/compiler/dex/frontend.h b/compiler/dex/frontend.h
index 8ce1206..22a7b8c 100644
--- a/compiler/dex/frontend.h
+++ b/compiler/dex/frontend.h
@@ -105,7 +105,7 @@
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 255892e..9457d5b 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 3187fbb..70438ec 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 2b681f6..e97634c 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 3dcb964..b4d8dd6 100644
--- a/compiler/dex/quick/dex_file_method_inliner.h
+++ b/compiler/dex/quick/dex_file_method_inliner.h
@@ -31,7 +31,7 @@
class MethodVerifier;
} // namespace verifier
-class CallInfo;
+struct CallInfo;
class Mir2Lir;
enum InlineMethodOpcode : uint16_t {
@@ -61,6 +61,7 @@
kInlineOpIGet,
kInlineOpIPut,
};
+std::ostream& operator<<(std::ostream& os, const InlineMethodOpcode& rhs);
enum InlineMethodFlags : uint16_t {
kNoInlineMethodFlags = 0x0000,
@@ -78,13 +79,13 @@
// 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 @@
*/
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 @@
kProtoCacheLast
};
+ private:
/**
* The maximum number of method parameters we support in the ProtoDef.
*/