Rename compiler_llvm CompilationUnit to LlvmCompilationUnit
Also fixed stray ART_TEST_CFLAGS to LOCAL_CFLAGS
Also fixed relative includes
Tried to change CompilationUnit to reference LlvmCompilationUnit, but
that causes issues because of the split libart-compiler
libart-compiler-llvm.
Change-Id: I7a490f339add6355a20c1cedae858ccf6967a6aa
diff --git a/src/compiler/codegen/arm/arm_lir.h b/src/compiler/codegen/arm/arm_lir.h
index 09b45b8..3fc8792 100644
--- a/src/compiler/codegen/arm/arm_lir.h
+++ b/src/compiler/codegen/arm/arm_lir.h
@@ -17,7 +17,7 @@
#ifndef ART_SRC_COMPILER_CODEGEN_ARM_ARMLIR_H_
#define ART_SRC_COMPILER_CODEGEN_ARM_ARMLIR_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
namespace art {
diff --git a/src/compiler/codegen/arm/assemble_arm.cc b/src/compiler/codegen/arm/assemble_arm.cc
index 27544d8..91f25d6 100644
--- a/src/compiler/codegen/arm/assemble_arm.cc
+++ b/src/compiler/codegen/arm/assemble_arm.cc
@@ -16,7 +16,7 @@
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../codegen_util.h"
+#include "compiler/codegen/codegen_util.h"
namespace art {
diff --git a/src/compiler/codegen/arm/call_arm.cc b/src/compiler/codegen/arm/call_arm.cc
index 47306f4..225c334 100644
--- a/src/compiler/codegen/arm/call_arm.cc
+++ b/src/compiler/codegen/arm/call_arm.cc
@@ -16,12 +16,12 @@
/* This file contains codegen for the Thumb2 ISA. */
-#include "oat_compilation_unit.h"
-#include "oat/runtime/oat_support_entrypoints.h"
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "oat/runtime/oat_support_entrypoints.h"
+#include "oat_compilation_unit.h"
namespace art {
diff --git a/src/compiler/codegen/arm/codegen_arm.h b/src/compiler/codegen/arm/codegen_arm.h
index 8d99049..ea34ff2 100644
--- a/src/compiler/codegen/arm/codegen_arm.h
+++ b/src/compiler/codegen/arm/codegen_arm.h
@@ -17,7 +17,7 @@
#ifndef ART_SRC_COMPILER_CODEGEN_ARM_CODEGENARM_H_
#define ART_SRC_COMPILER_CODEGEN_ARM_CODEGENARM_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
namespace art {
diff --git a/src/compiler/codegen/arm/fp_arm.cc b/src/compiler/codegen/arm/fp_arm.cc
index 57c55cc..577e0ab 100644
--- a/src/compiler/codegen/arm/fp_arm.cc
+++ b/src/compiler/codegen/arm/fp_arm.cc
@@ -16,8 +16,8 @@
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/arm/int_arm.cc b/src/compiler/codegen/arm/int_arm.cc
index 6a1178e..fcf74f1 100644
--- a/src/compiler/codegen/arm/int_arm.cc
+++ b/src/compiler/codegen/arm/int_arm.cc
@@ -16,12 +16,12 @@
/* This file contains codegen for the Thumb2 ISA. */
-#include "oat_compilation_unit.h"
-#include "oat/runtime/oat_support_entrypoints.h"
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "oat/runtime/oat_support_entrypoints.h"
+#include "oat_compilation_unit.h"
namespace art {
diff --git a/src/compiler/codegen/arm/target_arm.cc b/src/compiler/codegen/arm/target_arm.cc
index 493b4a9..f871f3d 100644
--- a/src/compiler/codegen/arm/target_arm.cc
+++ b/src/compiler/codegen/arm/target_arm.cc
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-#include "../../compiler_internals.h"
+#include <string>
+
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../ralloc_util.h"
-#include "../codegen_util.h"
-
-#include <string>
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/compiler_internals.h"
+#include "compiler/codegen/ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/arm/utility_arm.cc b/src/compiler/codegen/arm/utility_arm.cc
index 5c25eee..433111c 100644
--- a/src/compiler/codegen/arm/utility_arm.cc
+++ b/src/compiler/codegen/arm/utility_arm.cc
@@ -16,8 +16,8 @@
#include "arm_lir.h"
#include "codegen_arm.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/codegen.h b/src/compiler/codegen/codegen.h
index 595a1db..03ecb43 100644
--- a/src/compiler/codegen/codegen.h
+++ b/src/compiler/codegen/codegen.h
@@ -17,7 +17,7 @@
#ifndef ART_SRC_COMPILER_CODEGEN_CODEGEN_H_
#define ART_SRC_COMPILER_CODEGEN_CODEGEN_H_
-#include "../compiler_ir.h"
+#include "compiler/compiler_ir.h"
namespace art {
diff --git a/src/compiler/codegen/codegen_util.cc b/src/compiler/codegen/codegen_util.cc
index 389a413..ad05b93 100644
--- a/src/compiler/codegen/codegen_util.cc
+++ b/src/compiler/codegen/codegen_util.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "../compiler_internals.h"
+#include "compiler/compiler_internals.h"
#include "gc_map.h"
#include "verifier/dex_gc_map.h"
#include "verifier/method_verifier.h"
diff --git a/src/compiler/codegen/codegen_util.h b/src/compiler/codegen/codegen_util.h
index 3bb4291..4f14656 100644
--- a/src/compiler/codegen/codegen_util.h
+++ b/src/compiler/codegen/codegen_util.h
@@ -17,8 +17,15 @@
#ifndef ART_SRC_COMPILER_CODEGEN_CODEGENUTIL_H_
#define ART_SRC_COMPILER_CODEGEN_CODEGENUTIL_H_
+#include <stdint.h>
+
+#include "compiler/compiler_enums.h"
+
namespace art {
+class CompilationUnit;
+struct LIR;
+
void MarkSafepointPC(CompilationUnit* cu, LIR* inst);
bool FastInstance(CompilationUnit* cu, uint32_t field_idx,
int& field_offset, bool& is_volatile, bool is_put);
diff --git a/src/compiler/codegen/gen_common.cc b/src/compiler/codegen/gen_common.cc
index acaad5b..1d64a71 100644
--- a/src/compiler/codegen/gen_common.cc
+++ b/src/compiler/codegen/gen_common.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "oat/runtime/oat_support_entrypoints.h"
-#include "../compiler_ir.h"
-#include "ralloc_util.h"
#include "codegen_util.h"
+#include "compiler/compiler_ir.h"
+#include "oat/runtime/oat_support_entrypoints.h"
+#include "ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/gen_invoke.cc b/src/compiler/codegen/gen_invoke.cc
index 78425c4..816927f 100644
--- a/src/compiler/codegen/gen_invoke.cc
+++ b/src/compiler/codegen/gen_invoke.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "oat/runtime/oat_support_entrypoints.h"
-#include "../compiler_ir.h"
-#include "ralloc_util.h"
#include "codegen_util.h"
+#include "compiler/compiler_ir.h"
+#include "oat/runtime/oat_support_entrypoints.h"
+#include "ralloc_util.h"
#include "x86/codegen_x86.h"
namespace art {
diff --git a/src/compiler/codegen/gen_loadstore.cc b/src/compiler/codegen/gen_loadstore.cc
index 6c16d40..b183f9e 100644
--- a/src/compiler/codegen/gen_loadstore.cc
+++ b/src/compiler/codegen/gen_loadstore.cc
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-#include "../compiler_ir.h"
-#include "ralloc_util.h"
#include "codegen_util.h"
+#include "compiler/compiler_ir.h"
+#include "ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/local_optimizations.cc b/src/compiler/codegen/local_optimizations.cc
index 69b5d8e..b6981ca 100644
--- a/src/compiler/codegen/local_optimizations.cc
+++ b/src/compiler/codegen/local_optimizations.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "../compiler_internals.h"
+#include "compiler/compiler_internals.h"
namespace art {
diff --git a/src/compiler/codegen/mips/assemble_mips.cc b/src/compiler/codegen/mips/assemble_mips.cc
index c0ed3b6..34a91b0 100644
--- a/src/compiler/codegen/mips/assemble_mips.cc
+++ b/src/compiler/codegen/mips/assemble_mips.cc
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../codegen_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "mips_lir.h"
namespace art {
diff --git a/src/compiler/codegen/mips/call_mips.cc b/src/compiler/codegen/mips/call_mips.cc
index 76c9fbd..39fdc03 100644
--- a/src/compiler/codegen/mips/call_mips.cc
+++ b/src/compiler/codegen/mips/call_mips.cc
@@ -16,11 +16,11 @@
/* This file contains codegen for the Mips ISA */
-#include "oat/runtime/oat_support_entrypoints.h"
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "mips_lir.h"
+#include "oat/runtime/oat_support_entrypoints.h"
namespace art {
diff --git a/src/compiler/codegen/mips/codegen_mips.h b/src/compiler/codegen/mips/codegen_mips.h
index fcd5669..705ecfa 100644
--- a/src/compiler/codegen/mips/codegen_mips.h
+++ b/src/compiler/codegen/mips/codegen_mips.h
@@ -17,7 +17,8 @@
#ifndef ART_SRC_COMPILER_CODEGEN_MIPS_CODEGENMIPS_H_
#define ART_SRC_COMPILER_CODEGEN_MIPS_CODEGENMIPS_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
+#include "mips_lir.h"
namespace art {
diff --git a/src/compiler/codegen/mips/fp_mips.cc b/src/compiler/codegen/mips/fp_mips.cc
index 6ffc5e0..e7b106e 100644
--- a/src/compiler/codegen/mips/fp_mips.cc
+++ b/src/compiler/codegen/mips/fp_mips.cc
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include "oat/runtime/oat_support_entrypoints.h"
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "mips_lir.h"
+#include "oat/runtime/oat_support_entrypoints.h"
namespace art {
diff --git a/src/compiler/codegen/mips/int_mips.cc b/src/compiler/codegen/mips/int_mips.cc
index 86f0527..7da4cf6 100644
--- a/src/compiler/codegen/mips/int_mips.cc
+++ b/src/compiler/codegen/mips/int_mips.cc
@@ -16,11 +16,11 @@
/* This file contains codegen for the Mips ISA */
-#include "oat/runtime/oat_support_entrypoints.h"
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "mips_lir.h"
+#include "oat/runtime/oat_support_entrypoints.h"
namespace art {
diff --git a/src/compiler/codegen/mips/mips_lir.h b/src/compiler/codegen/mips/mips_lir.h
index cecd4ab..41e598f 100644
--- a/src/compiler/codegen/mips/mips_lir.h
+++ b/src/compiler/codegen/mips/mips_lir.h
@@ -17,7 +17,7 @@
#ifndef ART_COMPILER_COMPILER_CODEGEN_MIPS_MIPSLIR_H_
#define ART_COMPILER_COMPILER_CODEGEN_MIPS_MIPSLIR_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
namespace art {
diff --git a/src/compiler/codegen/mips/target_mips.cc b/src/compiler/codegen/mips/target_mips.cc
index 3bb4689..de19ac0 100644
--- a/src/compiler/codegen/mips/target_mips.cc
+++ b/src/compiler/codegen/mips/target_mips.cc
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include "../../compiler_internals.h"
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../ralloc_util.h"
-#include "../codegen_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/compiler_internals.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "mips_lir.h"
#include <string>
diff --git a/src/compiler/codegen/mips/utility_mips.cc b/src/compiler/codegen/mips/utility_mips.cc
index 4d4be76..1e217fb 100644
--- a/src/compiler/codegen/mips/utility_mips.cc
+++ b/src/compiler/codegen/mips/utility_mips.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "mips_lir.h"
#include "codegen_mips.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "mips_lir.h"
namespace art {
diff --git a/src/compiler/codegen/mir_to_gbc.cc b/src/compiler/codegen/mir_to_gbc.cc
index 2657b79..f67f760 100644
--- a/src/compiler/codegen/mir_to_gbc.cc
+++ b/src/compiler/codegen/mir_to_gbc.cc
@@ -27,9 +27,9 @@
#include <llvm/Support/Casting.h>
#include <llvm/Support/InstIterator.h>
-#include "../compiler_internals.h"
-#include "local_optimizations.h"
#include "codegen_util.h"
+#include "compiler/compiler_internals.h"
+#include "local_optimizations.h"
#include "ralloc_util.h"
static const char* kLabelFormat = "%c0x%x_%d";
diff --git a/src/compiler/codegen/mir_to_lir.cc b/src/compiler/codegen/mir_to_lir.cc
index 77d581f..bd26f2d 100644
--- a/src/compiler/codegen/mir_to_lir.cc
+++ b/src/compiler/codegen/mir_to_lir.cc
@@ -16,7 +16,7 @@
#include "object_utils.h"
-#include "../compiler_internals.h"
+#include "compiler/compiler_internals.h"
#include "local_optimizations.h"
#include "codegen_util.h"
#include "ralloc_util.h"
diff --git a/src/compiler/codegen/ralloc_util.cc b/src/compiler/codegen/ralloc_util.cc
index accf676..afd4976 100644
--- a/src/compiler/codegen/ralloc_util.cc
+++ b/src/compiler/codegen/ralloc_util.cc
@@ -16,11 +16,11 @@
/* This file contains register alloction support. */
-#include "../compiler_utility.h"
-#include "../compiler_ir.h"
-#include "../dataflow.h"
-#include "ralloc_util.h"
#include "codegen_util.h"
+#include "compiler/compiler_ir.h"
+#include "compiler/compiler_utility.h"
+#include "compiler/dataflow.h"
+#include "ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/ralloc_util.h b/src/compiler/codegen/ralloc_util.h
index 3526f4c..a5ed999 100644
--- a/src/compiler/codegen/ralloc_util.h
+++ b/src/compiler/codegen/ralloc_util.h
@@ -21,9 +21,9 @@
* This file contains target independent register alloction support.
*/
-#include "../compiler_ir.h"
-#include "../dataflow.h"
-#include "../compiler_utility.h"
+#include "compiler/compiler_ir.h"
+#include "compiler/compiler_utility.h"
+#include "compiler/dataflow.h"
namespace art {
diff --git a/src/compiler/codegen/x86/assemble_x86.cc b/src/compiler/codegen/x86/assemble_x86.cc
index 2b33090..1fa2352 100644
--- a/src/compiler/codegen/x86/assemble_x86.cc
+++ b/src/compiler/codegen/x86/assemble_x86.cc
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../codegen_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/call_x86.cc b/src/compiler/codegen/x86/call_x86.cc
index f9b25c8..4209375 100644
--- a/src/compiler/codegen/x86/call_x86.cc
+++ b/src/compiler/codegen/x86/call_x86.cc
@@ -16,10 +16,10 @@
/* This file contains codegen for the X86 ISA */
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/codegen_x86.h b/src/compiler/codegen/x86/codegen_x86.h
index 25f4461..141638c 100644
--- a/src/compiler/codegen/x86/codegen_x86.h
+++ b/src/compiler/codegen/x86/codegen_x86.h
@@ -17,7 +17,7 @@
#ifndef ART_SRC_COMPILER_CODEGEN_X86_CODEGENX86_H_
#define ART_SRC_COMPILER_CODEGEN_X86_CODEGENX86_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/fp_x86.cc b/src/compiler/codegen/x86/fp_x86.cc
index 6bfe9a2..00c2f53 100644
--- a/src/compiler/codegen/x86/fp_x86.cc
+++ b/src/compiler/codegen/x86/fp_x86.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/int_x86.cc b/src/compiler/codegen/x86/int_x86.cc
index f2d023c..0ae51e0 100644
--- a/src/compiler/codegen/x86/int_x86.cc
+++ b/src/compiler/codegen/x86/int_x86.cc
@@ -16,10 +16,10 @@
/* This file contains codegen for the X86 ISA */
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/target_x86.cc b/src/compiler/codegen/x86/target_x86.cc
index e396e54..6cb420c 100644
--- a/src/compiler/codegen/x86/target_x86.cc
+++ b/src/compiler/codegen/x86/target_x86.cc
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include "../../compiler_internals.h"
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../ralloc_util.h"
-#include "../codegen_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/compiler_internals.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "x86_lir.h"
#include <string>
diff --git a/src/compiler/codegen/x86/utility_x86.cc b/src/compiler/codegen/x86/utility_x86.cc
index ce55b4b..4f9e28b 100644
--- a/src/compiler/codegen/x86/utility_x86.cc
+++ b/src/compiler/codegen/x86/utility_x86.cc
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#include "x86_lir.h"
#include "codegen_x86.h"
-#include "../codegen_util.h"
-#include "../ralloc_util.h"
+#include "compiler/codegen/codegen_util.h"
+#include "compiler/codegen/ralloc_util.h"
+#include "x86_lir.h"
namespace art {
diff --git a/src/compiler/codegen/x86/x86_lir.h b/src/compiler/codegen/x86/x86_lir.h
index edfcd4d..c272286 100644
--- a/src/compiler/codegen/x86/x86_lir.h
+++ b/src/compiler/codegen/x86/x86_lir.h
@@ -17,7 +17,7 @@
#ifndef ART_COMPILER_COMPILER_CODEGEN_X86_X86LIR_H_
#define ART_COMPILER_COMPILER_CODEGEN_X86_X86LIR_H_
-#include "../../compiler_internals.h"
+#include "compiler/compiler_internals.h"
namespace art {
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index 97d005c..7237911 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -19,11 +19,11 @@
#include "base/stl_util.h"
#include "backend_options.h"
#include "class_linker.h"
-#include "compilation_unit.h"
#include "compiled_method.h"
#include "compiler.h"
#include "ir_builder.h"
#include "jni_compiler.h"
+#include "llvm_compilation_unit.h"
#include "method_compiler.h"
#include "oat_compilation_unit.h"
#include "oat_file.h"
@@ -125,11 +125,11 @@
}
-CompilationUnit* CompilerLLVM::AllocateCompilationUnit() {
+LlvmCompilationUnit* CompilerLLVM::AllocateCompilationUnit() {
MutexLock GUARD(Thread::Current(), num_cunits_lock_);
- CompilationUnit* cunit = new CompilationUnit(this, num_cunits_++);
+ LlvmCompilationUnit* cunit = new LlvmCompilationUnit(this, num_cunits_++);
if (!bitcode_filename_.empty()) {
- cunit->SetBitcodeFileName(StringPrintf("%s-%zu", bitcode_filename_.c_str(), num_cunits_-1));
+ cunit->SetBitcodeFileName(StringPrintf("%s-%zu", bitcode_filename_.c_str(), cunit->GetIndex()));
}
return cunit;
}
@@ -137,7 +137,7 @@
CompiledMethod* CompilerLLVM::
CompileDexMethod(OatCompilationUnit* oat_compilation_unit, InvokeType invoke_type) {
- UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit());
+ UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
#if defined(ART_USE_PORTABLE_COMPILER)
std::string methodName(PrettyMethod(oat_compilation_unit->GetDexMethodIndex(),
@@ -185,7 +185,7 @@
CompiledMethod* CompilerLLVM::
CompileNativeMethod(OatCompilationUnit* oat_compilation_unit) {
- UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit());
+ UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
UniquePtr<JniCompiler> jni_compiler(
new JniCompiler(cunit.get(), *compiler_, oat_compilation_unit));
@@ -196,7 +196,7 @@
CompiledInvokeStub* CompilerLLVM::CreateInvokeStub(bool is_static,
char const *shorty) {
- UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit());
+ UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
UniquePtr<StubCompiler> stub_compiler(
new StubCompiler(cunit.get(), *compiler_));
@@ -206,7 +206,7 @@
CompiledInvokeStub* CompilerLLVM::CreateProxyStub(char const *shorty) {
- UniquePtr<CompilationUnit> cunit(AllocateCompilationUnit());
+ UniquePtr<LlvmCompilationUnit> cunit(AllocateCompilationUnit());
UniquePtr<StubCompiler> stub_compiler(
new StubCompiler(cunit.get(), *compiler_));
diff --git a/src/compiler_llvm/compiler_llvm.h b/src/compiler_llvm/compiler_llvm.h
index bb14c49..b11ce12 100644
--- a/src/compiler_llvm/compiler_llvm.h
+++ b/src/compiler_llvm/compiler_llvm.h
@@ -55,7 +55,7 @@
namespace art {
namespace compiler_llvm {
-class CompilationUnit;
+class LlvmCompilationUnit;
class IRBuilder;
class CompilerLLVM {
@@ -94,7 +94,7 @@
}
private:
- CompilationUnit* AllocateCompilationUnit();
+ LlvmCompilationUnit* AllocateCompilationUnit();
Compiler* compiler_;
diff --git a/src/compiler_llvm/jni_compiler.cc b/src/compiler_llvm/jni_compiler.cc
index fdd2b43..8d49aba 100644
--- a/src/compiler_llvm/jni_compiler.cc
+++ b/src/compiler_llvm/jni_compiler.cc
@@ -18,11 +18,11 @@
#include "base/logging.h"
#include "class_linker.h"
-#include "compilation_unit.h"
#include "compiled_method.h"
#include "compiler.h"
#include "compiler_llvm.h"
#include "ir_builder.h"
+#include "llvm_compilation_unit.h"
#include "mirror/abstract_method.h"
#include "oat_compilation_unit.h"
#include "runtime.h"
@@ -42,7 +42,7 @@
using namespace runtime_support;
-JniCompiler::JniCompiler(CompilationUnit* cunit,
+JniCompiler::JniCompiler(LlvmCompilationUnit* cunit,
Compiler const& compiler,
OatCompilationUnit* oat_compilation_unit)
: cunit_(cunit), compiler_(&compiler), module_(cunit_->GetModule()),
diff --git a/src/compiler_llvm/jni_compiler.h b/src/compiler_llvm/jni_compiler.h
index 0731e92..4648180 100644
--- a/src/compiler_llvm/jni_compiler.h
+++ b/src/compiler_llvm/jni_compiler.h
@@ -46,12 +46,12 @@
namespace art {
namespace compiler_llvm {
-class CompilationUnit;
+class LlvmCompilationUnit;
class IRBuilder;
class JniCompiler {
public:
- JniCompiler(CompilationUnit* cunit,
+ JniCompiler(LlvmCompilationUnit* cunit,
Compiler const& compiler,
OatCompilationUnit* oat_compilation_unit);
@@ -64,7 +64,7 @@
bool is_static, bool is_target_function);
private:
- CompilationUnit* cunit_;
+ LlvmCompilationUnit* cunit_;
const Compiler* compiler_;
llvm::Module* module_;
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/llvm_compilation_unit.cc
similarity index 95%
rename from src/compiler_llvm/compilation_unit.cc
rename to src/compiler_llvm/llvm_compilation_unit.cc
index bd2d8fc..97aa6b9 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/llvm_compilation_unit.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "compilation_unit.h"
+#include "llvm_compilation_unit.h"
#include "base/logging.h"
#include "compiled_method.h"
@@ -89,7 +89,7 @@
llvm::Module* makeLLVMModuleContents(llvm::Module* module);
-CompilationUnit::CompilationUnit(const CompilerLLVM* compiler_llvm,
+LlvmCompilationUnit::LlvmCompilationUnit(const CompilerLLVM* compiler_llvm,
size_t cunit_idx)
: compiler_llvm_(compiler_llvm), cunit_idx_(cunit_idx) {
#if !defined(ART_USE_PORTABLE_COMPILER)
@@ -129,7 +129,7 @@
}
-CompilationUnit::~CompilationUnit() {
+LlvmCompilationUnit::~LlvmCompilationUnit() {
#if defined(ART_USE_PORTABLE_COMPILER)
llvm::LLVMContext* llvm_context = context_.release(); // Managed by llvm_info_
CHECK(llvm_context != NULL);
@@ -137,12 +137,12 @@
}
-InstructionSet CompilationUnit::GetInstructionSet() const {
+InstructionSet LlvmCompilationUnit::GetInstructionSet() const {
return compiler_llvm_->GetInstructionSet();
}
-bool CompilationUnit::Materialize() {
+bool LlvmCompilationUnit::Materialize() {
std::string elf_image;
// Compile and prelink llvm::Module
@@ -170,13 +170,13 @@
}
-bool CompilationUnit::MaterializeToString(std::string& str_buffer) {
+bool LlvmCompilationUnit::MaterializeToString(std::string& str_buffer) {
llvm::raw_string_ostream str_os(str_buffer);
return MaterializeToRawOStream(str_os);
}
-bool CompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) {
+bool LlvmCompilationUnit::MaterializeToRawOStream(llvm::raw_ostream& out_stream) {
// Lookup the LLVM target
std::string target_triple;
std::string target_cpu;
@@ -295,7 +295,7 @@
return true;
}
-bool CompilationUnit::ExtractCodeAndPrelink(const std::string& elf_image) {
+bool LlvmCompilationUnit::ExtractCodeAndPrelink(const std::string& elf_image) {
if (GetInstructionSet() == kX86) {
compiled_code_.push_back(0xccU);
compiled_code_.push_back(0xccU);
@@ -405,7 +405,7 @@
// that architecture. Since the Oat writer only guarantee that the compiled
// method being aligned to kArchAlignment, we have no way to align the ELf
// section if the section alignment is greater than kArchAlignment.
-void CompilationUnit::CheckCodeAlign(uint32_t align) const {
+void LlvmCompilationUnit::CheckCodeAlign(uint32_t align) const {
InstructionSet insn_set = GetInstructionSet();
switch (insn_set) {
case kThumb2:
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/llvm_compilation_unit.h
similarity index 88%
rename from src/compiler_llvm/compilation_unit.h
rename to src/compiler_llvm/llvm_compilation_unit.h
index b0d072b..af3ba7a 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/llvm_compilation_unit.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_
-#define ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_
+#ifndef ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_
+#define ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_
#include "base/logging.h"
#include "base/mutex.h"
@@ -52,12 +52,9 @@
class CompilerLLVM;
class IRBuilder;
-class CompilationUnit {
+class LlvmCompilationUnit {
public:
- CompilationUnit(const CompilerLLVM* compiler_llvm,
- size_t cunit_idx);
-
- ~CompilationUnit();
+ ~LlvmCompilationUnit();
size_t GetIndex() const {
return cunit_idx_;
@@ -105,6 +102,9 @@
}
private:
+ LlvmCompilationUnit(const CompilerLLVM* compiler_llvm,
+ size_t cunit_idx);
+
const CompilerLLVM* compiler_llvm_;
const size_t cunit_idx_;
@@ -130,9 +130,11 @@
bool MaterializeToRawOStream(llvm::raw_ostream& out_stream);
bool ExtractCodeAndPrelink(const std::string& elf_image);
+
+ friend class CompilerLLVM; // For LlvmCompilationUnit constructor
};
} // namespace compiler_llvm
} // namespace art
-#endif // ART_SRC_COMPILER_LLVM_COMPILATION_UNIT_H_
+#endif // ART_SRC_COMPILER_LLVM_LLVM_COMPILATION_UNIT_H_
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 76b1299..47d9b01 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -20,11 +20,11 @@
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/stringprintf.h"
-#include "compilation_unit.h"
#include "compiler.h"
#include "dalvik_reg.h"
#include "greenland/inferred_reg_category_map.h"
#include "ir_builder.h"
+#include "llvm_compilation_unit.h"
#include "mirror/object.h"
#include "oat_compilation_unit.h"
#include "object_utils.h"
@@ -46,7 +46,7 @@
using namespace runtime_support;
-MethodCompiler::MethodCompiler(CompilationUnit* cunit,
+MethodCompiler::MethodCompiler(LlvmCompilationUnit* cunit,
Compiler* compiler,
OatCompilationUnit* oat_compilation_unit)
: cunit_(cunit), compiler_(compiler),
diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h
index dd9d182..4d759e5 100644
--- a/src/compiler_llvm/method_compiler.h
+++ b/src/compiler_llvm/method_compiler.h
@@ -64,14 +64,14 @@
namespace art {
namespace compiler_llvm {
-class CompilationUnit;
+class LlvmCompilationUnit;
class CompilerLLVM;
class DalvikReg;
class IRBuilder;
class MethodCompiler {
public:
- MethodCompiler(CompilationUnit* cunit,
+ MethodCompiler(LlvmCompilationUnit* cunit,
Compiler* compiler,
OatCompilationUnit* oat_compilation_unit);
@@ -447,7 +447,7 @@
void ComputeMethodInfo();
private:
- CompilationUnit* cunit_;
+ LlvmCompilationUnit* cunit_;
Compiler* compiler_;
const DexFile* dex_file_;
diff --git a/src/compiler_llvm/stub_compiler.cc b/src/compiler_llvm/stub_compiler.cc
index 6b2a479..e6bee7b 100644
--- a/src/compiler_llvm/stub_compiler.cc
+++ b/src/compiler_llvm/stub_compiler.cc
@@ -17,11 +17,11 @@
#include "stub_compiler.h"
#include "base/logging.h"
-#include "compilation_unit.h"
#include "compiled_method.h"
#include "compiler.h"
#include "compiler_llvm.h"
#include "ir_builder.h"
+#include "llvm_compilation_unit.h"
#include "mirror/abstract_method.h"
#include "runtime_support_func.h"
#include "utils_llvm.h"
@@ -40,7 +40,7 @@
using namespace runtime_support;
-StubCompiler::StubCompiler(CompilationUnit* cunit, Compiler& compiler)
+StubCompiler::StubCompiler(LlvmCompilationUnit* cunit, Compiler& compiler)
: cunit_(cunit), compiler_(&compiler), module_(cunit_->GetModule()),
context_(cunit_->GetLLVMContext()), irb_(*cunit_->GetIRBuilder()) {
}
diff --git a/src/compiler_llvm/stub_compiler.h b/src/compiler_llvm/stub_compiler.h
index 9139acc..312b3af 100644
--- a/src/compiler_llvm/stub_compiler.h
+++ b/src/compiler_llvm/stub_compiler.h
@@ -33,19 +33,19 @@
namespace art {
namespace compiler_llvm {
-class CompilationUnit;
+class LlvmCompilationUnit;
class CompilerLLVM;
class IRBuilder;
class StubCompiler {
public:
- StubCompiler(CompilationUnit* cunit, Compiler& compiler);
+ StubCompiler(LlvmCompilationUnit* cunit, Compiler& compiler);
CompiledInvokeStub* CreateInvokeStub(bool is_static, const char* shorty);
CompiledInvokeStub* CreateProxyStub(const char* shorty);
private:
- CompilationUnit* cunit_;
+ LlvmCompilationUnit* cunit_;
const Compiler* compiler_;
llvm::Module* module_;
llvm::LLVMContext* context_;