Remove bccLoadBinary and remove the outdated comments (Now, invoking
Compiler::readBC is before knowing cache hit or not.)
Change-Id: I32fb075310abebdb3a7401a75fa76443d0a20c58
diff --git a/include/bcc/bcc.h b/include/bcc/bcc.h
index ff89e12..e374837 100644
--- a/include/bcc/bcc.h
+++ b/include/bcc/bcc.h
@@ -77,8 +77,6 @@
const BCCchar *resName,
const BCCchar *cacheDir);
-int bccLoadBinary(BCCscript *script);
-
// Interface for llvm::Module input. @module should be a valid llvm::Module
// instance.
int bccReadModule(BCCscript *script,
diff --git a/lib/bcc/Compiler.cpp b/lib/bcc/Compiler.cpp
index d3f67b6..3791f08 100644
--- a/lib/bcc/Compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -283,15 +283,11 @@
// Compiler::readBC
// Parameters:
-// resName: NULL means don't use cache.
-// Note: If "cache-hit but bccLoadBinary fails for some reason", still
-// pass in the resName.
-// Rationale: So we may have future cache-hit.
//
int Compiler::readBC(const char *bitcode,
size_t bitcodeSize,
- const BCCchar *resName,
- const BCCchar *cacheDir) {
+ const BCCchar *resName /* Deprecated */,
+ const BCCchar *cacheDir /* Deprecated */) {
llvm::OwningPtr<llvm::MemoryBuffer> MEM;
if (bitcode == NULL || bitcodeSize <= 0)
@@ -347,7 +343,6 @@
}
-// Deprecated: interface for bccCompileBC()
int Compiler::compile() {
llvm::TargetData *TD = NULL;
diff --git a/lib/bcc/Compiler.h b/lib/bcc/Compiler.h
index ac20a30..57040a7 100644
--- a/lib/bcc/Compiler.h
+++ b/lib/bcc/Compiler.h
@@ -128,7 +128,6 @@
int linkBC(const char *bitcode, size_t bitcodeSize);
- // Deprecated: interface for bccCompileBC()
int compile();
// interface for bccGetScriptInfoLog()
diff --git a/lib/bcc/bcc.cpp b/lib/bcc/bcc.cpp
index e5941ad..6d0ff50 100644
--- a/lib/bcc/bcc.cpp
+++ b/lib/bcc/bcc.cpp
@@ -96,11 +96,6 @@
script->linkBC(bitcode, size);
}
-extern "C" int bccLoadBinary(BCCscript *script) {
- LOGE("bccLoadBinary is deprecated **************************\n");
- return 1;
-}
-
extern "C" int bccPrepareExecutable(BCCscript *script) {
BCC_FUNC_LOGGER();
#if defined(__arm__)
diff --git a/tests/main.cpp b/tests/main.cpp
index c8a56fd..df6248e 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -195,9 +195,16 @@
bitcode[codeSize] = '\0'; /* must be null-terminated */
if (bccReadBC(script, bitcode, codeSize,
- statInFile.st_mtime, 0, "file", "/tmp") < 0) {
- bccLoadBinary(script);
+ statInFile.st_mtime, 0, "file", "/tmp") != 0) {
+ fprintf(stderr, "bcc: FAILS to read bitcode");
+ return NULL;
}
+
+ if (bccPrepareExecutable(script) != 0) {
+ fprintf(stderr, "bcc: FAILS to prepare executable");
+ return NULL;
+ }
+
//delete [] bitcode;
return script;