Rename the file name (looks more similar to LLVM).
diff --git a/Android.mk b/Android.mk
index bb463f6..3b451bb 100644
--- a/Android.mk
+++ b/Android.mk
@@ -32,11 +32,11 @@
LOCAL_MODULE := libbcc
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
- bcc.cpp \
- bcc_runtime.c \
- bcc_compiler.cpp \
- bcc_code_emitter.cpp \
- bcc_code_mem_manager.cpp \
+ lib/bcc/bcc.cpp \
+ lib/bcc/Compiler.cpp \
+ lib/bcc/CodeEmitter.cpp \
+ lib/bcc/CodeMemoryManager.cpp \
+ lib/bcc/Runtime.c \
runtime/lib/arm/adddf3vfp.S \
runtime/lib/arm/addsf3vfp.S \
runtime/lib/arm/divdf3vfp.S \
@@ -96,7 +96,8 @@
LOCAL_SHARED_LIBRARIES := libdl libcutils libutils libstlport
LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/include
+ $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)
ifeq ($(USE_DISASSEMBLER),true)
LOCAL_CFLAGS += -DUSE_DISASSEMBLER
@@ -121,12 +122,12 @@
LOCAL_MODULE := libbcc
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
- bcc.cpp \
- bcc_compiler.cpp \
- bcc_code_emitter.cpp \
- bcc_code_mem_manager.cpp \
- logd_write.c \
- bcc_runtime.c
+ lib/bcc/bcc.cpp \
+ lib/bcc/Compiler.cpp \
+ lib/bcc/CodeEmitter.cpp \
+ lib/bcc/CodeMemoryManager.cpp \
+ lib/bcc/Runtime.c \
+ helper/logd_write.c
LOCAL_STATIC_LIBRARIES := \
libcutils \
@@ -156,7 +157,8 @@
LOCAL_LDLIBS := -ldl -lpthread
LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/include
+ $(LOCAL_PATH)/include \
+ $(LOCAL_PATH)
# definitions for LLVM
LOCAL_CFLAGS += -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DUSE_DISASSEMBLER=1 -DFORCE_ARM_CODEGEN=1 -DDEBUG_CODEGEN=1
diff --git a/logd_write.c b/helper/logd_write.c
similarity index 100%
rename from logd_write.c
rename to helper/logd_write.c
diff --git a/bcc_code_emitter.cpp b/lib/bcc/CodeEmitter.cpp
similarity index 99%
rename from bcc_code_emitter.cpp
rename to lib/bcc/CodeEmitter.cpp
index 85cfafd..38fc281 100644
--- a/bcc_code_emitter.cpp
+++ b/lib/bcc/CodeEmitter.cpp
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include "bcc_code_emitter.h"
+#include "CodeEmitter.h"
-#include "bcc_code_mem_manager.h"
-#include "bcc_emitted_func_entry.h"
-#include "bcc_runtime.h"
+#include "CodeMemoryManager.h"
+#include "EmittedFuncEntry.h"
+#include "Runtime.h"
#include <bcc/bcc.h>
#include <bcc/bcc_cache.h>
diff --git a/bcc_code_emitter.h b/lib/bcc/CodeEmitter.h
similarity index 98%
rename from bcc_code_emitter.h
rename to lib/bcc/CodeEmitter.h
index ce90126..90e95ca 100644
--- a/bcc_code_emitter.h
+++ b/lib/bcc/CodeEmitter.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef BCC_CODE_EMITTER_H
-#define BCC_CODE_EMITTER_H
+#ifndef BCC_CODEEMITTER_H
+#define BCC_CODEEMITTER_H
#include <bcc/bcc.h>
#include <bcc/bcc_cache.h>
@@ -351,4 +351,4 @@
} // namespace bcc
-#endif // BCC_CODE_EMITTER_H
+#endif // BCC_CODEEMITTER_H
diff --git a/bcc_code_mem_manager.cpp b/lib/bcc/CodeMemoryManager.cpp
similarity index 98%
rename from bcc_code_mem_manager.cpp
rename to lib/bcc/CodeMemoryManager.cpp
index df78b59..62478be 100644
--- a/bcc_code_mem_manager.cpp
+++ b/lib/bcc/CodeMemoryManager.cpp
@@ -17,7 +17,7 @@
#define LOG_TAG "bcc"
#include <cutils/log.h>
-#include "bcc_code_mem_manager.h"
+#include "CodeMemoryManager.h"
#include "llvm/Support/ErrorHandling.h"
diff --git a/bcc_code_mem_manager.h b/lib/bcc/CodeMemoryManager.h
similarity index 97%
rename from bcc_code_mem_manager.h
rename to lib/bcc/CodeMemoryManager.h
index c463689..4a25ee6 100644
--- a/bcc_code_mem_manager.h
+++ b/lib/bcc/CodeMemoryManager.h
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-#ifndef BCC_CODE_MEM_MANAGER_H
-#define BCC_CODE_MEM_MANAGER_H
+#ifndef BCC_CODEMEMORYMANAGER_H
+#define BCC_CODEMEMORYMANAGER_H
-#include "bcc_compiler.h"
+#include "Compiler.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h"
@@ -237,4 +237,4 @@
} // namespace bcc
-#endif // BCC_CODE_MEM_MANAGER_H
+#endif // BCC_CODEMEMORYMANAGER_H
diff --git a/bcc_compiler.cpp b/lib/bcc/Compiler.cpp
similarity index 99%
rename from bcc_compiler.cpp
rename to lib/bcc/Compiler.cpp
index f43a305..50aeaa2 100644
--- a/bcc_compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -63,7 +63,7 @@
# define ARM_USE_VFP
#endif
-#include "bcc_compiler.h"
+#include "Compiler.h"
#include "llvm/ADT/StringRef.h"
diff --git a/bcc_compiler.h b/lib/bcc/Compiler.h
similarity index 98%
rename from bcc_compiler.h
rename to lib/bcc/Compiler.h
index 38f4758..08c92c5 100644
--- a/bcc_compiler.h
+++ b/lib/bcc/Compiler.h
@@ -19,8 +19,8 @@
#include <bcc/bcc.h>
-#include "bcc_code_emitter.h"
-#include "bcc_code_mem_manager.h"
+#include "CodeEmitter.h"
+#include "CodeMemoryManager.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/StringRef.h"
diff --git a/bcc_emitted_func_entry.h b/lib/bcc/EmittedFuncEntry.h
similarity index 89%
rename from bcc_emitted_func_entry.h
rename to lib/bcc/EmittedFuncEntry.h
index 87e2cad..798c354 100644
--- a/bcc_emitted_func_entry.h
+++ b/lib/bcc/EmittedFuncEntry.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef BCC_EMITTED_FUNC_ENTRY_H
-#define BCC_EMITTED_FUNC_ENTRY_H
+#ifndef BCC_EMITTEDFUNCENTRY_H
+#define BCC_EMITTEDFUNCENTRY_H
#include <stddef.h>
@@ -39,4 +39,4 @@
} // namespace bcc
-#endif // BCC_EMITTED_FUNC_ENTRY_H
+#endif // BCC_EMITTEDFUNCENTRY_H
diff --git a/bcc_runtime.c b/lib/bcc/Runtime.c
similarity index 97%
rename from bcc_runtime.c
rename to lib/bcc/Runtime.c
index 372f697..3f690aa 100644
--- a/bcc_runtime.c
+++ b/lib/bcc/Runtime.c
@@ -92,7 +92,7 @@
extern void *func ## vfp;
#define DEF_LLVM_RUNTIME(func)
#define DEF_BCC_RUNTIME(func)
-#include "bcc_runtime.def"
+#include "Runtime.def"
#endif
static const RuntimeFunction gRuntimes[] = {
@@ -111,7 +111,7 @@
{ #func, (void*) &func },
#define DEF_BCC_RUNTIME(func) \
{ #func, &func ## _bcc },
-#include "bcc_runtime.def"
+#include "Runtime.def"
};
static int CompareRuntimeFunction(const void *a, const void *b) {
@@ -140,6 +140,6 @@
if (Ptr != (int*) gRuntimes[i].mPtr)
assert(false && "Table is corrupted (runtime name should be sorted in "
- "bcc_runtime.def).");
+ "Runtime.def).");
}
}
diff --git a/bcc_runtime.def b/lib/bcc/Runtime.def
similarity index 100%
rename from bcc_runtime.def
rename to lib/bcc/Runtime.def
diff --git a/bcc_runtime.h b/lib/bcc/Runtime.h
similarity index 89%
rename from bcc_runtime.h
rename to lib/bcc/Runtime.h
index a28be9e..c0b7ad8 100644
--- a/bcc_runtime.h
+++ b/lib/bcc/Runtime.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef _BCC_RUNTIME_H_
-# define _BCC_RUNTIME_H_
+#ifndef BCC_RUNTIME_H
+#define BCC_RUNTIME_H
#ifdef __cplusplus
extern "C" {
@@ -28,4 +28,4 @@
};
#endif
-#endif /* _BCC_RUNTIME_H_ */
+#endif /* BCC_RUNTIME_H */
diff --git a/bcc_script.h b/lib/bcc/Script.h
similarity index 97%
rename from bcc_script.h
rename to lib/bcc/Script.h
index 5798b82..5307f07 100644
--- a/bcc_script.h
+++ b/lib/bcc/Script.h
@@ -17,8 +17,9 @@
#ifndef BCC_SCRIPT_H
#define BCC_SCRIPT_H
+#include "Compiler.h"
+
#include <bcc/bcc.h>
-#include "bcc_compiler.h"
namespace bcc {
diff --git a/bcc.cpp b/lib/bcc/bcc.cpp
similarity index 98%
rename from bcc.cpp
rename to lib/bcc/bcc.cpp
index 276fb24..6b64d36 100644
--- a/bcc.cpp
+++ b/lib/bcc/bcc.cpp
@@ -20,10 +20,10 @@
#define LOG_TAG "bcc"
#include <cutils/log.h>
-#include <bcc/bcc.h>
+#include "Compiler.h"
+#include "Script.h"
-#include "bcc_script.h"
-#include "bcc_compiler.h"
+#include <bcc/bcc.h>
#include <utils/StopWatch.h>