Clean up #if directives.
Change-Id: Ib0a4699331c00c7ef8d82dd4894f7f641062878a
diff --git a/Config.h b/Config.h
index f010ce7..1cf62ec 100644
--- a/Config.h
+++ b/Config.h
@@ -18,6 +18,8 @@
#define USE_CACHE 1
#define USE_DISASSEMBLER 1
+#define DEBUG_OLD_JIT_DISASSEMBLE 0
+#define DEBUG_MCJIT_DISASSEMBLE 0
#define USE_DISASSEMBLER_FILE 0
@@ -25,6 +27,8 @@
#define USE_FUNC_LOGGER 0
+#define DEBUG_BCC_REFLECT 0
+
//---------------------------------------------------------------------------
// Configuration for ContextManager
//---------------------------------------------------------------------------
diff --git a/lib/CodeGen/CodeEmitter.cpp b/lib/CodeGen/CodeEmitter.cpp
index 7609315..1ef83e3 100644
--- a/lib/CodeGen/CodeEmitter.cpp
+++ b/lib/CodeGen/CodeEmitter.cpp
@@ -1169,12 +1169,12 @@
void CodeEmitter::Disassemble(const llvm::StringRef &Name,
uint8_t *Start, size_t Length, bool IsStub) {
-#if USE_DISASSEMBLER
+#if USE_DISASSEMBLER && DEBUG_OLD_JIT_DISASSEMBLE
llvm::raw_ostream *OS;
#if USE_DISASSEMBLER_FILE
std::string ErrorInfo;
- OS = new llvm::raw_fd_ostream("/data/local/tmp/out.S",
+ OS = new llvm::raw_fd_ostream("/data/local/tmp/old-jit.s",
ErrorInfo,
llvm::raw_fd_ostream::F_Append);
diff --git a/lib/ExecutionEngine/Compiler.cpp b/lib/ExecutionEngine/Compiler.cpp
index b8ecc0f..7a6f8f2 100644
--- a/lib/ExecutionEngine/Compiler.cpp
+++ b/lib/ExecutionEngine/Compiler.cpp
@@ -109,9 +109,6 @@
}; // namespace anonymous
-#define DEBUG_MCJIT REFLECT 0
-#define DEBUG_MCJIT_DISASSEMBLE 0
-
namespace bcc {
//////////////////////////////////////////////////////////////////////////////
@@ -457,9 +454,10 @@
PragmaName.size()),
std::string(PragmaValue.data(),
PragmaValue.size())));
-#if DEBUG_MCJIT_REFLECT
- LOGD("compile(): Pragma: %s -> %s\n", pragmaList.back().first.c_str(),
- pragmaList.back().second.c_str());
+#if DEBUG_BCC_REFLECT
+ LOGD("compile(): Pragma: %s -> %s\n",
+ pragmaList.back().first.c_str(),
+ pragmaList.back().second.c_str());
#endif
}
}
@@ -483,7 +481,7 @@
goto on_bcc_compile_error;
}
objectSlotList.push_back(USlot);
-#if DEBUG_MCJIT_REFLECT
+#if DEBUG_BCC_REFLECT
LOGD("compile(): RefCount Slot: %s @ %u\n", Slot.str().c_str(), USlot);
#endif
}
@@ -583,7 +581,7 @@
continue;
if (ExportVarName == I->first->getName()) {
varList.push_back(I->second);
-#if DEBUG_MCJIT_REFLECT
+#if DEBUG_BCC_REFLECT
LOGD("runCodeGen(): Exported VAR: %s @ %p\n", ExportVarName.str().c_str(), I->second);
#endif
break;
@@ -592,7 +590,7 @@
if (I != mCodeEmitter->global_address_end())
continue; // found
-#if DEBUG_MCJIT_REFLECT
+#if DEBUG_BCC_REFLECT
LOGD("runCodeGen(): Exported VAR: %s @ %p\n",
ExportVarName.str().c_str(), (void *)0);
#endif
@@ -618,7 +616,7 @@
llvm::StringRef ExportFuncName =
static_cast<llvm::MDString*>(ExportFuncNameMDS)->getString();
funcList.push_back(mpResult->lookup(ExportFuncName.str().c_str()));
-#if DEBUG_MCJIT_REFLECT
+#if DEBUG_BCC_REFLECT
LOGD("runCodeGen(): Exported Func: %s @ %p\n", ExportFuncName.str().c_str(),
funcList.back());
#endif
diff --git a/lib/ExecutionEngine/bcc.cpp b/lib/ExecutionEngine/bcc.cpp
index f0501cf..fd79e94 100644
--- a/lib/ExecutionEngine/bcc.cpp
+++ b/lib/ExecutionEngine/bcc.cpp
@@ -122,7 +122,7 @@
void *addr = unwrap(script)->lookup(funcname);
-#if USE_DISASSEMBLER_FILE
+#if DEBUG_BCC_REFLECT
LOGD("Function Address: %s --> %p\n", funcname, addr);
#endif
@@ -144,7 +144,7 @@
if (varList) {
unwrap(script)->getExportVarList(varListSize, varList);
-#if USE_DISASSEMBLER_FILE
+#if DEBUG_BCC_REFLECT
size_t count = unwrap(script)->getExportVarCount();
LOGD("ExportVarCount = %lu\n", (unsigned long)count);
@@ -174,7 +174,7 @@
if (funcList) {
unwrap(script)->getExportFuncList(funcListSize, funcList);
-#if USE_DISASSEMBLER_FILE
+#if DEBUG_BCC_REFLECT
size_t count = unwrap(script)->getExportFuncCount();
LOGD("ExportFuncCount = %lu\n", (unsigned long)count);
@@ -203,7 +203,7 @@
BCC_FUNC_LOGGER();
unwrap(script)->getPragmaList(pragmaListSize, keyList, valueList);
-#if USE_DISASSEMBLER_FILE
+#if DEBUG_BCC_REFLECT
if (keyList && valueList) {
size_t count = unwrap(script)->getPragmaCount();
LOGD("PragmaCount = %lu\n", (unsigned long)count);
@@ -251,7 +251,7 @@
if (objectSlotList) {
unwrap(script)->getObjectSlotList(objectSlotListSize, objectSlotList);
-#if USE_DISASSEMBLER_FILE
+#if DEBUG_BCC_REFLECT
size_t count = unwrap(script)->getObjectSlotCount();
LOGD("ObjectSlotCount = %lu\n", (unsigned long)count);