Add property debug.bcc.nocache in Compiler.cpp. Set to 1 if
you want to turn off caching.

Change-Id: I2e997b387e5c7fd76592fbf2d651ca425f06a506
diff --git a/lib/bcc/Compiler.cpp b/lib/bcc/Compiler.cpp
index 7efd05e..65cb0bf 100644
--- a/lib/bcc/Compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -104,6 +104,8 @@
 #include <sys/types.h>
 #include <unistd.h>
 
+#include <cutils/properties.h>
+
 #include <string>
 #include <vector>
 
@@ -325,6 +327,13 @@
 }
 
 
+static bool getProp(const char *str) {
+    char buf[PROPERTY_VALUE_MAX];
+    property_get(str, buf, "0");
+    return 0 != strcmp(buf, "0");
+}
+
+
 int Compiler::readBC(const char *bitcode,
                      size_t bitcodeSize,
                      const BCCchar *resName,
@@ -360,6 +369,11 @@
     mResId = i;
   }
 
+  this->props.mNoCache = getProp("debug.bcc.nocache");
+  if (this->props.mNoCache) {
+    resName = NULL;
+  }
+
   if (resName) {
     // Turn on mUseCache mode iff
     // 1. Has resName
diff --git a/lib/bcc/Compiler.h b/lib/bcc/Compiler.h
index 1fd8915..21f0bd4 100644
--- a/lib/bcc/Compiler.h
+++ b/lib/bcc/Compiler.h
@@ -228,6 +228,12 @@
                                     uint32_t libRSWhen,
                                     uint32_t libbccWhen);
 
+
+    struct {
+      bool mNoCache;
+    } props;
+
+
   private:
 
     bool hasError() const {
@@ -242,9 +248,7 @@
       mError = Error;
     }
 
-  };
-
-
+  };  // End of class Compiler
 
 } // namespace bcc