Remove dead uses of RSCompilerDriver and of compiler callbacks.

Change-Id: Ibe8725074724b75e35c25a404daaba07ffbca2ab
diff --git a/Android.mk b/Android.mk
index ef885de..5da6d18 100644
--- a/Android.mk
+++ b/Android.mk
@@ -51,7 +51,7 @@
 LOCAL_SHARED_LIBRARIES += liblog libcutils libutils libEGL libGLESv1_CM libGLESv2
 LOCAL_SHARED_LIBRARIES += libui libgui libsync
 
-LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM
+LOCAL_SHARED_LIBRARIES += libbcinfo libLLVM
 
 LOCAL_C_INCLUDES += frameworks/compile/libbcc/include
 
@@ -176,7 +176,7 @@
 LOCAL_SHARED_LIBRARIES += libgui libsync libdl libui
 LOCAL_SHARED_LIBRARIES += libft2 libpng libz
 
-LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libLLVM
+LOCAL_SHARED_LIBRARIES += libbcinfo libLLVM
 
 LOCAL_C_INCLUDES += external/freetype/include
 LOCAL_C_INCLUDES += frameworks/compile/libbcc/include
diff --git a/cpu_ref/Android.mk b/cpu_ref/Android.mk
index 2048fff..832db6d 100644
--- a/cpu_ref/Android.mk
+++ b/cpu_ref/Android.mk
@@ -84,7 +84,7 @@
 
 LOCAL_SHARED_LIBRARIES += libRS libcutils libutils liblog libsync libc++ libdl libz
 
-LOCAL_SHARED_LIBRARIES += libbcc libbcinfo libblas
+LOCAL_SHARED_LIBRARIES += libbcinfo libblas
 
 
 LOCAL_C_INCLUDES += frameworks/compile/libbcc/include
diff --git a/cpu_ref/rsCpuCore.cpp b/cpu_ref/rsCpuCore.cpp
index 3ce9d9d..5fe7801 100644
--- a/cpu_ref/rsCpuCore.cpp
+++ b/cpu_ref/rsCpuCore.cpp
@@ -64,8 +64,7 @@
 
 RsdCpuReference * RsdCpuReference::create(Context *rsc, uint32_t version_major,
         uint32_t version_minor, sym_lookup_t lfn, script_lookup_t slfn
-        , bcc::RSLinkRuntimeCallback pLinkRuntimeCallback,
-        RSSelectRTCallback pSelectRTCallback,
+        , RSSelectRTCallback pSelectRTCallback,
         const char *pBccPluginName
         ) {
 
@@ -78,7 +77,6 @@
         return nullptr;
     }
 
-    cpu->setLinkRuntimeCallback(pLinkRuntimeCallback);
     cpu->setSelectRTCallback(pSelectRTCallback);
     if (pBccPluginName) {
         cpu->setBccPluginName(pBccPluginName);
@@ -112,9 +110,7 @@
     memset(&mWorkers, 0, sizeof(mWorkers));
     memset(&mTlsStruct, 0, sizeof(mTlsStruct));
     mExit = false;
-    mLinkRuntimeCallback = nullptr;
     mSelectRTCallback = nullptr;
-    mSetupCompilerCallback = nullptr;
     mEmbedGlobalInfo = true;
     mEmbedGlobalInfoSkipConstant = true;
 }
diff --git a/cpu_ref/rsCpuCore.h b/cpu_ref/rsCpuCore.h
index c350f50..e29812a 100644
--- a/cpu_ref/rsCpuCore.h
+++ b/cpu_ref/rsCpuCore.h
@@ -25,12 +25,6 @@
 #include "rsScriptC.h"
 #include "rsCpuCoreRuntime.h"
 
-namespace bcc {
-    class BCCContext;
-    class RSCompilerDriver;
-    class RSExecutable;
-}
-
 namespace android {
 namespace renderscript {
 
@@ -101,14 +95,6 @@
         return mScriptLookupFn(mRSC, s);
     }
 
-    void setLinkRuntimeCallback(
-            bcc::RSLinkRuntimeCallback pLinkRuntimeCallback) {
-        mLinkRuntimeCallback = pLinkRuntimeCallback;
-    }
-    bcc::RSLinkRuntimeCallback getLinkRuntimeCallback() {
-        return mLinkRuntimeCallback;
-    }
-
     void setSelectRTCallback(RSSelectRTCallback pSelectRTCallback) {
         mSelectRTCallback = pSelectRTCallback;
     }
@@ -116,15 +102,6 @@
         return mSelectRTCallback;
     }
 
-#ifndef RS_COMPATIBILITY_LIB
-    void setSetupCompilerCallback(RSSetupCompilerCallback pSetupCompilerCallback) override {
-        mSetupCompilerCallback = pSetupCompilerCallback;
-    }
-    RSSetupCompilerCallback getSetupCompilerCallback() const override {
-        return mSetupCompilerCallback;
-    }
-#endif
-
     virtual void setBccPluginName(const char *name) {
         mBccPluginName.setTo(name);
     }
@@ -180,9 +157,7 @@
 
     ScriptTLSStruct mTlsStruct;
 
-    bcc::RSLinkRuntimeCallback mLinkRuntimeCallback;
     RSSelectRTCallback mSelectRTCallback;
-    RSSetupCompilerCallback mSetupCompilerCallback;
     String8 mBccPluginName;
 
     // Specifies whether we should embed global variable information in the
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index decafc6..8d4f81e 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -25,9 +25,7 @@
 #else
     #include "rsCppUtils.h"
 
-    #include <bcc/BCCContext.h>
     #include <bcc/Config/Config.h>
-    #include <bcc/Renderscript/RSCompilerDriver.h>
     #include <bcinfo/MetadataExtractor.h>
     #include <cutils/properties.h>
 
@@ -230,11 +228,6 @@
 
     mScriptSO = nullptr;
 
-#ifndef RS_COMPATIBILITY_LIB
-    mCompilerDriver = nullptr;
-#endif
-
-
     mRoot = nullptr;
     mRootExpand = nullptr;
     mInit = nullptr;
@@ -304,22 +297,6 @@
 #ifndef RS_COMPATIBILITY_LIB
     bool useRSDebugContext = false;
 
-    mCompilerDriver = nullptr;
-
-    mCompilerDriver = new bcc::RSCompilerDriver();
-    if (mCompilerDriver == nullptr) {
-        ALOGE("bcc: FAILS to create compiler driver (out of memory)");
-        mCtx->unlockMutex();
-        return false;
-    }
-
-    // Run any compiler setup functions we have been provided with.
-    RSSetupCompilerCallback setupCompilerCallback =
-            mCtx->getSetupCompilerCallback();
-    if (setupCompilerCallback != nullptr) {
-        setupCompilerCallback(mCompilerDriver);
-    }
-
     bcinfo::MetadataExtractor bitcodeMetadata((const char *) bitcode, bitcodeSize);
     if (!bitcodeMetadata.extract()) {
         ALOGE("Could not extract metadata from bitcode");
@@ -330,7 +307,6 @@
     const char* core_lib = findCoreLib(bitcodeMetadata, (const char*)bitcode, bitcodeSize);
 
     if (mCtx->getContext()->getContextType() == RS_CONTEXT_TYPE_DEBUG) {
-        mCompilerDriver->setDebugContext(true);
         useRSDebugContext = true;
     }
 
@@ -875,12 +851,6 @@
 }
 
 RsdCpuScriptImpl::~RsdCpuScriptImpl() {
-#ifndef RS_COMPATIBILITY_LIB
-    if (mCompilerDriver) {
-        delete mCompilerDriver;
-    }
-#endif
-
     if (mScriptExec != nullptr) {
         delete mScriptExec;
     }
diff --git a/cpu_ref/rsCpuScript.h b/cpu_ref/rsCpuScript.h
index efbb39f..2f1991f 100644
--- a/cpu_ref/rsCpuScript.h
+++ b/cpu_ref/rsCpuScript.h
@@ -26,11 +26,6 @@
 
 #include "rsCpuCore.h"
 
-namespace bcc {
-    class BCCContext;
-    class RSCompilerDriver;
-}
-
 namespace bcinfo {
     class MetadataExtractor;
 }
@@ -123,8 +118,6 @@
     // Returns the path to the core library we'll use.
     const char* findCoreLib(const bcinfo::MetadataExtractor& bitCodeMetaData, const char* bitcode,
                             size_t bitcodeSize);
-
-    bcc::RSCompilerDriver *mCompilerDriver;
 #endif
 
     RootFunc_t mRoot;
diff --git a/cpu_ref/rsd_cpu.h b/cpu_ref/rsd_cpu.h
index 0eed22c..8e205d8 100644
--- a/cpu_ref/rsd_cpu.h
+++ b/cpu_ref/rsd_cpu.h
@@ -19,25 +19,8 @@
 
 #include "rsAllocation.h"
 
-namespace llvm {
-
-class Module;
-
-}  // end namespace llvm
-
-namespace bcc {
-
-class RSCompilerDriver;
-class RSScript;
-typedef llvm::Module* (*RSLinkRuntimeCallback)
-        (bcc::RSScript *, llvm::Module *, llvm::Module *);
-
-}  // end namespace bcc;
-
 typedef const char* (*RSSelectRTCallback) (const char*, size_t);
 
-typedef void (*RSSetupCompilerCallback) (bcc::RSCompilerDriver *);
-
 namespace android {
 namespace renderscript {
 
@@ -46,7 +29,6 @@
 class ScriptGroupBase;
 class ScriptKernelID;
 
-
 class RsdCpuReference {
 public:
     struct CpuSymbol {
@@ -128,8 +110,7 @@
 
     static RsdCpuReference * create(Context *c, uint32_t version_major,
                                     uint32_t version_minor, sym_lookup_t lfn, script_lookup_t slfn
-                                    , bcc::RSLinkRuntimeCallback pLinkRuntimeCallback = nullptr,
-                                    RSSelectRTCallback pSelectRTCallback = nullptr,
+                                    , RSSelectRTCallback pSelectRTCallback = nullptr,
                                     const char *pBccPluginName = nullptr
                                     );
     virtual ~RsdCpuReference();
@@ -142,12 +123,6 @@
     virtual void* createScriptGroup(const ScriptGroupBase *sg) = 0;
     virtual bool getInForEach() = 0;
 
-#ifndef RS_COMPATIBILITY_LIB
-    virtual void setSetupCompilerCallback(
-            RSSetupCompilerCallback pSetupCompilerCallback) = 0;
-    virtual RSSetupCompilerCallback getSetupCompilerCallback() const = 0;
-#endif
-
     // Set to true if we should embed global variable information in the code.
     virtual void setEmbedGlobalInfo(bool v) = 0;
 
diff --git a/driver/rsdCore.cpp b/driver/rsdCore.cpp
index d65460c..3933d98 100644
--- a/driver/rsdCore.cpp
+++ b/driver/rsdCore.cpp
@@ -331,13 +331,6 @@
         return false;
     }
 
-#ifndef RS_COMPATIBILITY_LIB
-    // Set a callback for compiler setup here.
-    if (false) {
-        dc->mCpuRef->setSetupCompilerCallback(nullptr);
-    }
-#endif
-
     return true;
 }