Continuing Quick compiler refactoring
With this CL, we no longer include any .cc files - all source
files compile stand-alone. We still build a separate .so for
each target, but all code in the target-independent "codegen"
directory is now truly independent and doesn't rely on any
target-specific macros to compile.
Header file inclusion is still a bit of a mess, but that will be
addressed in a subsequent CL.
Next up: create a codegen class to hold code generator routines
overrideable by target.
Change-Id: I3a93118d11afeab11f310950a6a73381a99e26e1
diff --git a/src/compiler/codegen/mips/backend_mips.cc b/src/compiler/codegen/mips/backend_mips.cc
deleted file mode 100644
index 596a5f7..0000000
--- a/src/compiler/codegen/mips/backend_mips.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define _CODEGEN_C
-
-#include "mips_lir.h"
-#include "../ralloc_util.h"
-
-/* Common codegen building blocks */
-#include "../codegen_util.cc"
-
-#include "utility_mips.cc"
-#include "../gen_loadstore.cc"
-#include "../gen_common.cc"
-#include "../gen_invoke.cc"
-#include "call_mips.cc"
-#include "fp_mips.cc"
-#include "int_mips.cc"
-
-/* Bitcode conversion */
-#include "../method_bitcode.cc"
-
-/* MIR2LIR dispatcher and architectural independent codegen routines */
-#include "../method_codegen_driver.cc"
-
-/* Target-independent local optimizations */
-#include "../local_optimizations.cc"
diff --git a/src/compiler/codegen/mips/call_mips.cc b/src/compiler/codegen/mips/call_mips.cc
index 1db4eee..5049eec 100644
--- a/src/compiler/codegen/mips/call_mips.cc
+++ b/src/compiler/codegen/mips/call_mips.cc
@@ -17,6 +17,9 @@
/* This file contains codegen for the Mips ISA */
#include "oat/runtime/oat_support_entrypoints.h"
+#include "mips_lir.h"
+#include "../codegen_util.h"
+#include "../ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/mips/fp_mips.cc b/src/compiler/codegen/mips/fp_mips.cc
index 1954824..268a88d 100644
--- a/src/compiler/codegen/mips/fp_mips.cc
+++ b/src/compiler/codegen/mips/fp_mips.cc
@@ -15,6 +15,9 @@
*/
#include "oat/runtime/oat_support_entrypoints.h"
+#include "mips_lir.h"
+#include "../codegen_util.h"
+#include "../ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/mips/int_mips.cc b/src/compiler/codegen/mips/int_mips.cc
index 82ac547..297a5d92 100644
--- a/src/compiler/codegen/mips/int_mips.cc
+++ b/src/compiler/codegen/mips/int_mips.cc
@@ -17,6 +17,9 @@
/* This file contains codegen for the Mips ISA */
#include "oat/runtime/oat_support_entrypoints.h"
+#include "mips_lir.h"
+#include "../codegen_util.h"
+#include "../ralloc_util.h"
namespace art {
diff --git a/src/compiler/codegen/mips/mips_lir.h b/src/compiler/codegen/mips/mips_lir.h
index b6f686d..de39b7f 100644
--- a/src/compiler/codegen/mips/mips_lir.h
+++ b/src/compiler/codegen/mips/mips_lir.h
@@ -303,8 +303,6 @@
#define kST kSYNC0
#define kSY kSYNC0
-#define isPseudoOpcode(opCode) (static_cast<int>(opCode) < 0)
-
/*
* The following enum defines the list of supported Thumb instructions by the
* assembler. Their corresponding EncodingMap positions will be defined in
diff --git a/src/compiler/codegen/mips/target_mips.cc b/src/compiler/codegen/mips/target_mips.cc
index e157760..a3621f5 100644
--- a/src/compiler/codegen/mips/target_mips.cc
+++ b/src/compiler/codegen/mips/target_mips.cc
@@ -481,10 +481,10 @@
return true;
}
-void oatGenMemBarrier(CompilationUnit *cUnit, int barrierKind)
+void oatGenMemBarrier(CompilationUnit *cUnit, MemBarrierKind barrierKind)
{
#if ANDROID_SMP != 0
- newLIR1(cUnit, kMipsSync, barrierKind);
+ newLIR1(cUnit, kMipsSync, 0 /* Only stype currently supported */);
#endif
}
@@ -655,4 +655,19 @@
return oatArchVariantInit();
}
+uint64_t getTargetInstFlags(int opcode)
+{
+ return EncodingMap[opcode].flags;
+}
+
+const char* getTargetInstName(int opcode)
+{
+ return EncodingMap[opcode].name;
+}
+
+const char* getTargetInstFmt(int opcode)
+{
+ return EncodingMap[opcode].fmt;
+}
+
} // namespace art
diff --git a/src/compiler/codegen/mips/utility_mips.cc b/src/compiler/codegen/mips/utility_mips.cc
index a7faa1d..7a018c5 100644
--- a/src/compiler/codegen/mips/utility_mips.cc
+++ b/src/compiler/codegen/mips/utility_mips.cc
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+#include "mips_lir.h"
+#include "../codegen_util.h"
+#include "../ralloc_util.h"
+
namespace art {
/* This file contains codegen for the MIPS32 ISA. */