Runtime support for compiler kernel fusion.

The runtime will start a seperate process to call the new bcc to fuse kernels.

Change-Id: Ia73ea917a126a5055ec97f13d90a5feaafd6a2f5
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index f975094..01fbcaf 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -161,15 +161,13 @@
 #endif  // RS_SERVER
 }
 
-const static char *BCC_EXE_PATH = "/system/bin/bcc";
-
 static void setCompileArguments(std::vector<const char*>* args,
                                 const std::string& bcFileName,
                                 const char* cacheDir, const char* resName,
                                 const char* core_lib, bool useRSDebugContext,
                                 const char* bccPluginName) {
     rsAssert(cacheDir && resName && core_lib);
-    args->push_back(BCC_EXE_PATH);
+    args->push_back(android::renderscript::RsdCpuScriptImpl::BCC_EXE_PATH);
     args->push_back("-unroll-runtime");
     args->push_back("-scalarize-load-store");
     args->push_back("-o");
@@ -234,7 +232,8 @@
     }
     case 0: {  // Child process
         ALOGV("Invoking BCC with: %s", compileCommandLine.c_str());
-        execv(BCC_EXE_PATH, (char* const*)compileArguments);
+        execv(android::renderscript::RsdCpuScriptImpl::BCC_EXE_PATH,
+              (char* const*)compileArguments);
 
         ALOGE("execv() failed: %s", strerror(errno));
         abort();
@@ -428,6 +427,8 @@
     return loaded;
 }
 
+const char* RsdCpuScriptImpl::BCC_EXE_PATH = "/system/bin/bcc";
+
 #define MAXLINE 500
 #define MAKE_STR_HELPER(S) #S
 #define MAKE_STR(S) MAKE_STR_HELPER(S)
@@ -764,12 +765,8 @@
 
 #ifndef RS_COMPATIBILITY_LIB
     for (size_t idx = 0; idx < pragmaCount; ++idx) {
-        if (pragmaKeys[idx] != nullptr) {
-            delete [] pragmaKeys[idx];
-        }
-        if (pragmaValues[idx] != nullptr) {
-            delete [] pragmaValues[idx];
-        }
+        delete [] pragmaKeys[idx];
+        delete [] pragmaValues[idx];
     }
 
     delete[] pragmaValues;
@@ -867,6 +864,8 @@
         }
     }
 
+    mBitcodeFilePath = bcFileName;
+
     // Read RS symbol information from the .so.
     if ( !mScriptSO) {
         goto error;