Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)  DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic34de235eb1cd094af555d7299da643a626ca092
diff --git a/lib/ExecutionEngine/Compiler.cpp b/lib/ExecutionEngine/Compiler.cpp
index b0ba132..6e1a06a 100644
--- a/lib/ExecutionEngine/Compiler.cpp
+++ b/lib/ExecutionEngine/Compiler.cpp
@@ -225,7 +225,7 @@
 void Compiler::LLVMErrorHandler(void *UserData, const std::string &Message) {
   std::string *Error = static_cast<std::string*>(UserData);
   Error->assign(Message);
-  LOGE("%s", Message.c_str());
+  ALOGE("%s", Message.c_str());
   exit(1);
 }
 
@@ -267,7 +267,7 @@
   llvm::Module *result = llvm::ParseBitcodeFile(MEM, *mContext, &mError);
 
   if (!result) {
-    LOGE("Unable to ParseBitcodeFile: %s\n", mError.c_str());
+    ALOGE("Unable to ParseBitcodeFile: %s\n", mError.c_str());
     return NULL;
   }
 
@@ -531,7 +531,7 @@
   }
 
 on_bcc_compile_error:
-  // LOGE("on_bcc_compiler_error");
+  // ALOGE("on_bcc_compiler_error");
   if (TD) {
     delete TD;
   }
@@ -544,7 +544,7 @@
     return 0;
   }
 
-  // LOGE(getErrorMessage());
+  // ALOGE(getErrorMessage());
   return 1;
 }
 
@@ -864,7 +864,7 @@
     }
   }
 
-  LOGE("Unable to resolve symbol: %s\n", name);
+  ALOGE("Unable to resolve symbol: %s\n", name);
   return NULL;
 }
 #endif
diff --git a/lib/ExecutionEngine/FileHandle.cpp b/lib/ExecutionEngine/FileHandle.cpp
index c912c66..c0a344c 100644
--- a/lib/ExecutionEngine/FileHandle.cpp
+++ b/lib/ExecutionEngine/FileHandle.cpp
@@ -66,7 +66,7 @@
       ALOGW("Unable to acquire the lock immediately, block and wait now ...\n");
 
       if (flock(mFD, lock_flags[mode]) < 0) {
-        LOGE("Unable to acquire the lock. Retry ...\n");
+        ALOGE("Unable to acquire the lock. Retry ...\n");
 
         ::close(mFD);
         mFD = -1;
@@ -172,7 +172,7 @@
 void FileHandle::truncate() {
   if (mFD >= 0) {
     if (ftruncate(mFD, 0) != 0) {
-      LOGE("Unable to truncate the file.\n");
+      ALOGE("Unable to truncate the file.\n");
     }
   }
 }
diff --git a/lib/ExecutionEngine/MCCacheReader.cpp b/lib/ExecutionEngine/MCCacheReader.cpp
index cddd47b..4e84a73 100644
--- a/lib/ExecutionEngine/MCCacheReader.cpp
+++ b/lib/ExecutionEngine/MCCacheReader.cpp
@@ -81,7 +81,7 @@
   mpResult.reset(new (nothrow) ScriptCached(S));
 
   if (!mpResult) {
-    LOGE("Unable to allocate ScriptCached object.\n");
+    ALOGE("Unable to allocate ScriptCached object.\n");
     return false;
   }
 
@@ -103,14 +103,14 @@
 bool MCCacheReader::checkFileSize() {
   struct stat stfile;
   if (fstat(mInfoFile->getFD(), &stfile) < 0) {
-    LOGE("Unable to stat cache file.\n");
+    ALOGE("Unable to stat cache file.\n");
     return false;
   }
 
   mInfoFileSize = stfile.st_size;
 
   if (mInfoFileSize < (off_t)sizeof(MCO_Header)) {
-    LOGE("Cache file is too small to be correct.\n");
+    ALOGE("Cache file is too small to be correct.\n");
     return false;
   }
 
@@ -120,19 +120,19 @@
 
 bool MCCacheReader::readHeader() {
   if (mInfoFile->seek(0, SEEK_SET) != 0) {
-    LOGE("Unable to seek to 0. (reason: %s)\n", strerror(errno));
+    ALOGE("Unable to seek to 0. (reason: %s)\n", strerror(errno));
     return false;
   }
 
   mpHeader = (MCO_Header *)malloc(sizeof(MCO_Header));
   if (!mpHeader) {
-    LOGE("Unable to allocate for cache header.\n");
+    ALOGE("Unable to allocate for cache header.\n");
     return false;
   }
 
   if (mInfoFile->read(reinterpret_cast<char *>(mpHeader), sizeof(MCO_Header)) !=
       (ssize_t)sizeof(MCO_Header)) {
-    LOGE("Unable to read cache header.\n");
+    ALOGE("Unable to read cache header.\n");
     return false;
   }
 
@@ -148,7 +148,7 @@
 
 bool MCCacheReader::checkHeader() {
   if (memcmp(mpHeader->magic, OBCC_MAGIC, 4) != 0) {
-    LOGE("Bad magic word\n");
+    ALOGE("Bad magic word\n");
     return false;
   }
 
@@ -168,14 +168,14 @@
   bool isLittleEndian = (*reinterpret_cast<char *>(&number) == 1);
   if ((isLittleEndian && mpHeader->endianness != 'e') ||
       (!isLittleEndian && mpHeader->endianness != 'E')) {
-    LOGE("Machine endianness mismatch.\n");
+    ALOGE("Machine endianness mismatch.\n");
     return false;
   }
 
   if ((unsigned int)mpHeader->sizeof_off_t != sizeof(off_t) ||
       (unsigned int)mpHeader->sizeof_size_t != sizeof(size_t) ||
       (unsigned int)mpHeader->sizeof_ptr_t != sizeof(void *)) {
-    LOGE("Machine integer size mismatch.\n");
+    ALOGE("Machine integer size mismatch.\n");
     return false;
   }
 
@@ -190,17 +190,17 @@
     off_t size = (off_t)mpHeader-> NAME##_size;                             \
                                                                             \
     if (mInfoFileSize < offset || mInfoFileSize < offset + size) {          \
-      LOGE(#NAME " section overflow.\n");                                   \
+      ALOGE(#NAME " section overflow.\n");                                   \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (offset % sizeof(int) != 0) {                                        \
-      LOGE(#NAME " offset must aligned to %d.\n", (int)sizeof(int));        \
+      ALOGE(#NAME " offset must aligned to %d.\n", (int)sizeof(int));        \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (size < static_cast<off_t>(sizeof(size_t))) {                        \
-      LOGE(#NAME " size is too small to be correct.\n");                    \
+      ALOGE(#NAME " size is too small to be correct.\n");                    \
       return false;                                                         \
     }                                                                       \
   } while (0)
@@ -220,7 +220,7 @@
   TYPE *NAME##_raw = (TYPE *)malloc(mpHeader->NAME##_size);                 \
                                                                             \
   if (!NAME##_raw) {                                                        \
-    LOGE("Unable to allocate for " #NAME "\n");                             \
+    ALOGE("Unable to allocate for " #NAME "\n");                             \
     return false;                                                           \
   }                                                                         \
                                                                             \
@@ -228,14 +228,14 @@
   AUTO_MANAGED_HOLDER = NAME##_raw;                                         \
                                                                             \
   if (mInfoFile->seek(mpHeader->NAME##_offset, SEEK_SET) == -1) {           \
-    LOGE("Unable to seek to " #NAME " section\n");                          \
+    ALOGE("Unable to seek to " #NAME " section\n");                          \
     return false;                                                           \
   }                                                                         \
                                                                             \
   if (mInfoFile->read(reinterpret_cast<char *>(NAME##_raw),                 \
                   mpHeader->NAME##_size) != (ssize_t)mpHeader->NAME##_size) \
   {                                                                         \
-    LOGE("Unable to read " #NAME ".\n");                                    \
+    ALOGE("Unable to read " #NAME ".\n");                                    \
     return false;                                                           \
   }
 
@@ -263,7 +263,7 @@
   // Ensure that every c-style string is ended with '\0'
   for (size_t i = 0; i < poolR->count; ++i) {
     if (pool[i][poolR->list[i].length] != '\0') {
-      LOGE("The %lu-th string does not end with '\\0'.\n", (unsigned long)i);
+      ALOGE("The %lu-th string does not end with '\\0'.\n", (unsigned long)i);
       return false;
     }
   }
@@ -281,7 +281,7 @@
 
 bool MCCacheReader::checkDependency() {
   if (mDependencies.size() != mpCachedDependTable->count) {
-    LOGE("Dependencies count mismatch. (%lu vs %lu)\n",
+    ALOGE("Dependencies count mismatch. (%lu vs %lu)\n",
          (unsigned long)mDependencies.size(),
          (unsigned long)mpCachedDependTable->count);
     return false;
@@ -302,18 +302,18 @@
     unsigned char const *depCachedSHA1 = depCached->sha1;
 
     if (depName != depCachedName) {
-      LOGE("Cache dependency name mismatch:\n");
-      LOGE("  given:  %s\n", depName.c_str());
-      LOGE("  cached: %s\n", depCachedName);
+      ALOGE("Cache dependency name mismatch:\n");
+      ALOGE("  given:  %s\n", depName.c_str());
+      ALOGE("  cached: %s\n", depCachedName);
 
       return false;
     }
 
     if (memcmp(depSHA1, depCachedSHA1, 20) != 0) {
-      LOGE("Cache dependency %s sha1 mismatch:\n", depCachedName);
+      ALOGE("Cache dependency %s sha1 mismatch:\n", depCachedName);
 
 #define PRINT_SHA1(PREFIX, X, POSTFIX) \
-      LOGE(PREFIX "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" \
+      ALOGE(PREFIX "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" \
                   "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" POSTFIX, \
            X[0], X[1], X[2], X[3], X[4], X[5], X[6], X[7], X[8], X[9], \
            X[10],X[11],X[12],X[13],X[14],X[15],X[16],X[17],X[18],X[19]);
@@ -327,7 +327,7 @@
     }
 
     if (depType != depCachedType) {
-      LOGE("Cache dependency %s resource type mismatch.\n", depCachedName);
+      ALOGE("Cache dependency %s resource type mismatch.\n", depCachedName);
       return false;
     }
   }
@@ -343,7 +343,7 @@
                             malloc(sizeof(size_t) +
                                    sizeof(void*) * export_var_name_list_raw->count);
   if (!mpResult->mpExportVars) {
-    LOGE("Unable to allocate for mpExportVars\n");
+    ALOGE("Unable to allocate for mpExportVars\n");
     return false;
   }
   mpResult->mpExportVars->count = export_var_name_list_raw->count;
@@ -367,7 +367,7 @@
                             malloc(sizeof(size_t) +
                                    sizeof(void*) * export_func_name_list_raw->count);
   if (!mpResult->mpExportFuncs) {
-    LOGE("Unable to allocate for mpExportFuncs\n");
+    ALOGE("Unable to allocate for mpExportFuncs\n");
     return false;
   }
   mpResult->mpExportFuncs->count = export_func_name_list_raw->count;
@@ -419,7 +419,7 @@
     }
   }
 
-  LOGE("Unable to resolve symbol: %s\n", name);
+  ALOGE("Unable to resolve symbol: %s\n", name);
   return NULL;
 }
 
@@ -431,7 +431,7 @@
     mEmittedELFExecutable.append(readBuffer, readBuffer + readSize);
   }
   if (readSize != 0) {
-    LOGE("Read file Error");
+    ALOGE("Read file Error");
     return false;
   }
   ALOGD("Read object file size %d", (int)mEmittedELFExecutable.size());
diff --git a/lib/ExecutionEngine/MCCacheWriter.cpp b/lib/ExecutionEngine/MCCacheWriter.cpp
index 6fbf4ba..38fcd3e 100644
--- a/lib/ExecutionEngine/MCCacheWriter.cpp
+++ b/lib/ExecutionEngine/MCCacheWriter.cpp
@@ -77,7 +77,7 @@
   MCO_Header *header = (MCO_Header *)malloc(sizeof(MCO_Header));
 
   if (!header) {
-    LOGE("Unable to allocate for header.\n");
+    ALOGE("Unable to allocate for header.\n");
     return false;
   }
 
@@ -112,7 +112,7 @@
   OBCC_DependencyTable *tab = (OBCC_DependencyTable *)malloc(tableSize);
 
   if (!tab) {
-    LOGE("Unable to allocate for dependency table section.\n");
+    ALOGE("Unable to allocate for dependency table section.\n");
     return false;
   }
 
@@ -143,7 +143,7 @@
   OBCC_PragmaList *list = (OBCC_PragmaList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for pragma list\n");
+    ALOGE("Unable to allocate for pragma list\n");
     return false;
   }
 
@@ -186,7 +186,7 @@
   OBCC_StringPool *pool = (OBCC_StringPool *)malloc(size);
 
   if (!pool) {
-    LOGE("Unable to allocate string pool.\n");
+    ALOGE("Unable to allocate string pool.\n");
     return false;
   }
 
@@ -221,7 +221,7 @@
   OBCC_String_Ptr *list = (OBCC_String_Ptr*)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for export variable name list\n");
+    ALOGE("Unable to allocate for export variable name list\n");
     return false;
   }
 
@@ -245,7 +245,7 @@
   OBCC_String_Ptr *list = (OBCC_String_Ptr*)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for export function name list\n");
+    ALOGE("Unable to allocate for export function name list\n");
     return false;
   }
 
@@ -271,7 +271,7 @@
   OBCC_ObjectSlotList *list = (OBCC_ObjectSlotList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for object slot list\n");
+    ALOGE("Unable to allocate for object slot list\n");
     return false;
   }
 
@@ -319,13 +319,13 @@
 #define WRITE_SECTION(NAME, OFFSET, SIZE, SECTION)                          \
   do {                                                                      \
     if (mInfoFile->seek(OFFSET, SEEK_SET) == -1) {                          \
-      LOGE("Unable to seek to " #NAME " section for writing.\n");           \
+      ALOGE("Unable to seek to " #NAME " section for writing.\n");           \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (mInfoFile->write(reinterpret_cast<char *>(SECTION), (SIZE)) !=      \
         static_cast<ssize_t>(SIZE)) {                                       \
-      LOGE("Unable to write " #NAME " section to cache file.\n");           \
+      ALOGE("Unable to write " #NAME " section to cache file.\n");           \
       return false;                                                         \
     }                                                                       \
   } while (0)
@@ -352,7 +352,7 @@
   if (static_cast<size_t>(mObjFile->write(mpOwner->getELF(),
                                           mpOwner->getELFSize()))
       != mpOwner->getELFSize()) {
-      LOGE("Unable to write ELF to cache file.\n");
+      ALOGE("Unable to write ELF to cache file.\n");
       return false;
   }
 
diff --git a/lib/ExecutionEngine/OldJIT/CacheReader.cpp b/lib/ExecutionEngine/OldJIT/CacheReader.cpp
index feb5ef4..8eceb5f 100644
--- a/lib/ExecutionEngine/OldJIT/CacheReader.cpp
+++ b/lib/ExecutionEngine/OldJIT/CacheReader.cpp
@@ -65,7 +65,7 @@
   mpResult.reset(new (nothrow) ScriptCached(S));
 
   if (!mpResult) {
-    LOGE("Unable to allocate ScriptCached object.\n");
+    ALOGE("Unable to allocate ScriptCached object.\n");
     return NULL;
   }
 
@@ -97,24 +97,24 @@
   struct stat stfile;
 
   if (fstat(mInfoFile->getFD(), &stfile) < 0) {
-    LOGE("Unable to stat metadata information file.\n");
+    ALOGE("Unable to stat metadata information file.\n");
     return false;
   }
 
   mInfoFileSize = stfile.st_size;
 
   if (mInfoFileSize < (off_t)sizeof(OBCC_Header)) {
-    LOGE("Metadata information file is too small to be correct.\n");
+    ALOGE("Metadata information file is too small to be correct.\n");
     return false;
   }
 
   if (fstat(mObjFile->getFD(), &stfile) < 0) {
-    LOGE("Unable to stat executable file.\n");
+    ALOGE("Unable to stat executable file.\n");
     return false;
   }
 
   if (stfile.st_size < (off_t)ContextManager::ContextSize) {
-    LOGE("Executable file is too small to be correct.\n");
+    ALOGE("Executable file is too small to be correct.\n");
     return false;
   }
 
@@ -124,19 +124,19 @@
 
 bool CacheReader::readHeader() {
   if (mInfoFile->seek(0, SEEK_SET) != 0) {
-    LOGE("Unable to seek to 0. (reason: %s)\n", strerror(errno));
+    ALOGE("Unable to seek to 0. (reason: %s)\n", strerror(errno));
     return false;
   }
 
   mpHeader = (OBCC_Header *)malloc(sizeof(OBCC_Header));
   if (!mpHeader) {
-    LOGE("Unable to allocate for cache header.\n");
+    ALOGE("Unable to allocate for cache header.\n");
     return false;
   }
 
   if (mInfoFile->read((char *)mpHeader, sizeof(OBCC_Header)) !=
       (ssize_t)sizeof(OBCC_Header)) {
-    LOGE("Unable to read cache header.\n");
+    ALOGE("Unable to read cache header.\n");
     return false;
   }
 
@@ -152,7 +152,7 @@
 
 bool CacheReader::checkHeader() {
   if (memcmp(mpHeader->magic, OBCC_MAGIC, 4) != 0) {
-    LOGE("Bad magic word\n");
+    ALOGE("Bad magic word\n");
     return false;
   }
 
@@ -172,14 +172,14 @@
   bool isLittleEndian = (*reinterpret_cast<char *>(&number) == 1);
   if ((isLittleEndian && mpHeader->endianness != 'e') ||
       (!isLittleEndian && mpHeader->endianness != 'E')) {
-    LOGE("Machine endianness mismatch.\n");
+    ALOGE("Machine endianness mismatch.\n");
     return false;
   }
 
   if ((unsigned int)mpHeader->sizeof_off_t != sizeof(off_t) ||
       (unsigned int)mpHeader->sizeof_size_t != sizeof(size_t) ||
       (unsigned int)mpHeader->sizeof_ptr_t != sizeof(void *)) {
-    LOGE("Machine integer size mismatch.\n");
+    ALOGE("Machine integer size mismatch.\n");
     return false;
   }
 
@@ -194,17 +194,17 @@
     off_t size = (off_t)mpHeader-> NAME##_size;                             \
                                                                             \
     if (mInfoFileSize < offset || mInfoFileSize < offset + size) {          \
-      LOGE(#NAME " section overflow.\n");                                   \
+      ALOGE(#NAME " section overflow.\n");                                   \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (offset % sizeof(int) != 0) {                                        \
-      LOGE(#NAME " offset must aligned to %d.\n", (int)sizeof(int));        \
+      ALOGE(#NAME " offset must aligned to %d.\n", (int)sizeof(int));        \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (size < static_cast<off_t>(sizeof(size_t))) {                        \
-      LOGE(#NAME " size is too small to be correct.\n");                    \
+      ALOGE(#NAME " size is too small to be correct.\n");                    \
       return false;                                                         \
     }                                                                       \
   } while (0)
@@ -221,7 +221,7 @@
   // TODO(logan): Move this to some where else.
   long pagesize = sysconf(_SC_PAGESIZE);
   if ((uintptr_t)mpHeader->context_cached_addr % pagesize != 0) {
-    LOGE("cached address is not aligned to pagesize.\n");
+    ALOGE("cached address is not aligned to pagesize.\n");
     return false;
   }
 
@@ -233,7 +233,7 @@
   TYPE *NAME##_raw = (TYPE *)malloc(mpHeader->NAME##_size);                 \
                                                                             \
   if (!NAME##_raw) {                                                        \
-    LOGE("Unable to allocate for " #NAME "\n");                             \
+    ALOGE("Unable to allocate for " #NAME "\n");                             \
     return false;                                                           \
   }                                                                         \
                                                                             \
@@ -241,14 +241,14 @@
   AUTO_MANAGED_HOLDER = NAME##_raw;                                         \
                                                                             \
   if (mInfoFile->seek(mpHeader->NAME##_offset, SEEK_SET) == -1) {           \
-    LOGE("Unable to seek to " #NAME " section\n");                          \
+    ALOGE("Unable to seek to " #NAME " section\n");                          \
     return false;                                                           \
   }                                                                         \
                                                                             \
   if (mInfoFile->read(reinterpret_cast<char *>(NAME##_raw),                 \
                   mpHeader->NAME##_size) != (ssize_t)mpHeader->NAME##_size) \
   {                                                                         \
-    LOGE("Unable to read " #NAME ".\n");                                    \
+    ALOGE("Unable to read " #NAME ".\n");                                    \
     return false;                                                           \
   }
 
@@ -276,7 +276,7 @@
   // Ensure that every c-style string is ended with '\0'
   for (size_t i = 0; i < poolR->count; ++i) {
     if (pool[i][poolR->list[i].length] != '\0') {
-      LOGE("The %lu-th string does not end with '\\0'.\n", (unsigned long)i);
+      ALOGE("The %lu-th string does not end with '\\0'.\n", (unsigned long)i);
       return false;
     }
   }
@@ -294,7 +294,7 @@
 
 bool CacheReader::checkDependency() {
   if (mDependencies.size() != mpCachedDependTable->count) {
-    LOGE("Dependencies count mismatch. (%lu vs %lu)\n",
+    ALOGE("Dependencies count mismatch. (%lu vs %lu)\n",
          (unsigned long)mDependencies.size(),
          (unsigned long)mpCachedDependTable->count);
     return false;
@@ -315,18 +315,18 @@
     unsigned char const *depCachedSHA1 = depCached->sha1;
 
     if (depName != depCachedName) {
-      LOGE("Cache dependency name mismatch:\n");
-      LOGE("  given:  %s\n", depName.c_str());
-      LOGE("  cached: %s\n", depCachedName);
+      ALOGE("Cache dependency name mismatch:\n");
+      ALOGE("  given:  %s\n", depName.c_str());
+      ALOGE("  cached: %s\n", depCachedName);
 
       return false;
     }
 
     if (memcmp(depSHA1, depCachedSHA1, 20) != 0) {
-      LOGE("Cache dependency %s sha1 mismatch:\n", depCachedName);
+      ALOGE("Cache dependency %s sha1 mismatch:\n", depCachedName);
 
 #define PRINT_SHA1(PREFIX, X, POSTFIX) \
-      LOGE(PREFIX "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" \
+      ALOGE(PREFIX "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" \
                   "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" POSTFIX, \
            X[0], X[1], X[2], X[3], X[4], X[5], X[6], X[7], X[8], X[9], \
            X[10],X[11],X[12],X[13],X[14],X[15],X[16],X[17],X[18],X[19]);
@@ -340,7 +340,7 @@
     }
 
     if (depType != depCachedType) {
-      LOGE("Cache dependency %s resource type mismatch.\n", depCachedName);
+      ALOGE("Cache dependency %s resource type mismatch.\n", depCachedName);
       return false;
     }
   }
@@ -429,7 +429,7 @@
   }
 
   if (sum != 0) {
-    LOGE("Checksum check failed\n");
+    ALOGE("Checksum check failed\n");
     return false;
   }
 
diff --git a/lib/ExecutionEngine/OldJIT/CacheWriter.cpp b/lib/ExecutionEngine/OldJIT/CacheWriter.cpp
index 4b53617..36bf281 100644
--- a/lib/ExecutionEngine/OldJIT/CacheWriter.cpp
+++ b/lib/ExecutionEngine/OldJIT/CacheWriter.cpp
@@ -85,7 +85,7 @@
   OBCC_Header *header = (OBCC_Header *)malloc(sizeof(OBCC_Header));
 
   if (!header) {
-    LOGE("Unable to allocate for header.\n");
+    ALOGE("Unable to allocate for header.\n");
     return false;
   }
 
@@ -123,7 +123,7 @@
   OBCC_DependencyTable *tab = (OBCC_DependencyTable *)malloc(tableSize);
 
   if (!tab) {
-    LOGE("Unable to allocate for dependency table section.\n");
+    ALOGE("Unable to allocate for dependency table section.\n");
     return false;
   }
 
@@ -155,7 +155,7 @@
   OBCC_FuncTable *tab = (OBCC_FuncTable *)malloc(tableSize);
 
   if (!tab) {
-    LOGE("Unable to allocate for function table section.\n");
+    ALOGE("Unable to allocate for function table section.\n");
     return false;
   }
 
@@ -190,7 +190,7 @@
   OBCC_PragmaList *list = (OBCC_PragmaList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for pragma list\n");
+    ALOGE("Unable to allocate for pragma list\n");
     return false;
   }
 
@@ -240,7 +240,7 @@
   OBCC_StringPool *pool = (OBCC_StringPool *)malloc(size);
 
   if (!pool) {
-    LOGE("Unable to allocate string pool.\n");
+    ALOGE("Unable to allocate string pool.\n");
     return false;
   }
 
@@ -275,7 +275,7 @@
   OBCC_ExportVarList *list = (OBCC_ExportVarList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for export variable list\n");
+    ALOGE("Unable to allocate for export variable list\n");
     return false;
   }
 
@@ -296,7 +296,7 @@
   OBCC_ExportFuncList *list = (OBCC_ExportFuncList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for export function list\n");
+    ALOGE("Unable to allocate for export function list\n");
     return false;
   }
 
@@ -319,7 +319,7 @@
   OBCC_ObjectSlotList *list = (OBCC_ObjectSlotList *)malloc(listSize);
 
   if (!list) {
-    LOGE("Unable to allocate for object slot list\n");
+    ALOGE("Unable to allocate for object slot list\n");
     return false;
   }
 
@@ -380,13 +380,13 @@
 #define WRITE_SECTION(NAME, OFFSET, SIZE, SECTION)                          \
   do {                                                                      \
     if (mInfoFile->seek(OFFSET, SEEK_SET) == -1) {                          \
-      LOGE("Unable to seek to " #NAME " section for writing.\n");           \
+      ALOGE("Unable to seek to " #NAME " section for writing.\n");           \
       return false;                                                         \
     }                                                                       \
                                                                             \
     if (mInfoFile->write(reinterpret_cast<char *>(SECTION), (SIZE)) !=      \
         static_cast<ssize_t>(SIZE)) {                                       \
-      LOGE("Unable to write " #NAME " section to cache file.\n");           \
+      ALOGE("Unable to write " #NAME " section to cache file.\n");           \
       return false;                                                         \
     }                                                                       \
   } while (0)
@@ -416,7 +416,7 @@
   char const *context = (char const *)mpOwner->getContext();
   size_t context_size = ContextManager::ContextSize;
   if (mObjFile->write(context, context_size) != (ssize_t)context_size) {
-    LOGE("Unable to write context image to executable file\n");
+    ALOGE("Unable to write context image to executable file\n");
     return false;
   }
 
diff --git a/lib/ExecutionEngine/OldJIT/ContextManager.cpp b/lib/ExecutionEngine/OldJIT/ContextManager.cpp
index 8ae9476..5dca382 100644
--- a/lib/ExecutionEngine/OldJIT/ContextManager.cpp
+++ b/lib/ExecutionEngine/OldJIT/ContextManager.cpp
@@ -68,11 +68,11 @@
       }
 
       if (result && result != MAP_FAILED) {
-        LOGE("Unable to allocate. suggested=%p, result=%p\n", addr, result);
+        ALOGE("Unable to allocate. suggested=%p, result=%p\n", addr, result);
         munmap(result, ContextSize);
       }
 
-      LOGE("Unable to allocate. addr=%p.  Retry ...\n", addr);
+      ALOGE("Unable to allocate. addr=%p.  Retry ...\n", addr);
     }
     // Release mContextSlotOccupiedLock
   }
@@ -82,7 +82,7 @@
                       MAP_PRIVATE | MAP_ANON, -1, 0);
 
   if (!result || result == MAP_FAILED) {
-    LOGE("Unable to mmap. (reason: %s)\n", strerror(errno));
+    ALOGE("Unable to mmap. (reason: %s)\n", strerror(errno));
     return NULL;
   }
 
@@ -97,20 +97,20 @@
   // slot address.  And the image offset is aligned to the pagesize.
 
   if (imageFd < 0) {
-    LOGE("Invalid file descriptor for bcc context image\n");
+    ALOGE("Invalid file descriptor for bcc context image\n");
     return NULL;
   }
 
   unsigned long pagesize = (unsigned long)sysconf(_SC_PAGESIZE);
 
   if (imageOffset % pagesize > 0) {
-    LOGE("BCC context image offset is not aligned to page size\n");
+    ALOGE("BCC context image offset is not aligned to page size\n");
     return NULL;
   }
 
   ssize_t slot = getSlotIndexFromAddress(addr);
   if (slot < 0) {
-    LOGE("Suggested address is not a bcc context slot address\n");
+    ALOGE("Suggested address is not a bcc context slot address\n");
     return NULL;
   }
 
@@ -126,12 +126,12 @@
                       MAP_PRIVATE, imageFd, imageOffset);
 
   if (!result || result == MAP_FAILED) {
-    LOGE("Unable to allocate. addr=%p\n", addr);
+    ALOGE("Unable to allocate. addr=%p\n", addr);
     return NULL;
   }
 
   if (result != addr) {
-    LOGE("Unable to allocate at suggested=%p, result=%p\n", addr, result);
+    ALOGE("Unable to allocate at suggested=%p, result=%p\n", addr, result);
     munmap(result, ContextSize);
     return NULL;
   }
@@ -153,7 +153,7 @@
 
   // Unmap
   if (munmap(addr, ContextSize) < 0) {
-    LOGE("Unable to unmap. addr=%p (reason: %s)\n", addr, strerror(errno));
+    ALOGE("Unable to unmap. addr=%p (reason: %s)\n", addr, strerror(errno));
     return;
   }
 
diff --git a/lib/ExecutionEngine/Script.cpp b/lib/ExecutionEngine/Script.cpp
index 29e3898..c26785f 100644
--- a/lib/ExecutionEngine/Script.cpp
+++ b/lib/ExecutionEngine/Script.cpp
@@ -88,19 +88,19 @@
 
   if (!resName) {
     mErrorCode = BCC_INVALID_VALUE;
-    LOGE("Invalid argument: resName = NULL\n");
+    ALOGE("Invalid argument: resName = NULL\n");
     return 1;
   }
 
   if (mStatus != ScriptStatus::Unknown) {
     mErrorCode = BCC_INVALID_OPERATION;
-    LOGE("Bad operation: Adding source after bccPrepareExecutable\n");
+    ALOGE("Bad operation: Adding source after bccPrepareExecutable\n");
     return 1;
   }
 
   if (!bitcode) {
     mErrorCode = BCC_INVALID_VALUE;
-    LOGE("Invalid argument: bitcode = NULL\n");
+    ALOGE("Invalid argument: bitcode = NULL\n");
     return 1;
   }
 
@@ -110,7 +110,7 @@
 
   if (!mSourceList[idx]) {
     mErrorCode = BCC_OUT_OF_MEMORY;
-    LOGE("Out of memory while adding source bitcode\n");
+    ALOGE("Out of memory while adding source bitcode\n");
     return 1;
   }
 
@@ -123,13 +123,13 @@
                             unsigned long flags) {
   if (mStatus != ScriptStatus::Unknown) {
     mErrorCode = BCC_INVALID_OPERATION;
-    LOGE("Bad operation: Adding source after bccPrepareExecutable\n");
+    ALOGE("Bad operation: Adding source after bccPrepareExecutable\n");
     return 1;
   }
 
   if (!module) {
     mErrorCode = BCC_INVALID_VALUE;
-    LOGE("Invalid argument: module = NULL\n");
+    ALOGE("Invalid argument: module = NULL\n");
     return 1;
   }
 
@@ -137,7 +137,7 @@
 
   if (!mSourceList[idx]) {
     mErrorCode = BCC_OUT_OF_MEMORY;
-    LOGE("Out of memory when add source module\n");
+    ALOGE("Out of memory when add source module\n");
     return 1;
   }
 
@@ -150,20 +150,20 @@
                           unsigned long flags) {
   if (mStatus != ScriptStatus::Unknown) {
     mErrorCode = BCC_INVALID_OPERATION;
-    LOGE("Bad operation: Adding source after bccPrepareExecutable\n");
+    ALOGE("Bad operation: Adding source after bccPrepareExecutable\n");
     return 1;
   }
 
   if (!path) {
     mErrorCode = BCC_INVALID_VALUE;
-    LOGE("Invalid argument: path = NULL\n");
+    ALOGE("Invalid argument: path = NULL\n");
     return 1;
   }
 
   struct stat sb;
   if (stat(path, &sb) != 0) {
     mErrorCode = BCC_INVALID_VALUE;
-    LOGE("File not found: %s\n", path);
+    ALOGE("File not found: %s\n", path);
     return 1;
   }
 
@@ -171,7 +171,7 @@
 
   if (!mSourceList[idx]) {
     mErrorCode = BCC_OUT_OF_MEMORY;
-    LOGE("Out of memory while adding source file\n");
+    ALOGE("Out of memory while adding source file\n");
     return 1;
   }
 
@@ -199,7 +199,7 @@
 #endif
   int status = internalCompile(true);
   if (status != 0) {
-    LOGE("LLVM error message: %s\n", getCompilerErrorMessage());
+    ALOGE("LLVM error message: %s\n", getCompilerErrorMessage());
   }
   return status;
 }
@@ -210,7 +210,7 @@
                               unsigned long flags) {
   if (mStatus != ScriptStatus::Unknown) {
     mErrorCode = BCC_INVALID_OPERATION;
-    LOGE("Invalid operation: %s\n", __func__);
+    ALOGE("Invalid operation: %s\n", __func__);
     return 1;
   }
 
@@ -233,7 +233,7 @@
 
   int status = internalCompile(false);
   if (status != 0) {
-    LOGE("LLVM error message: %s\n", getCompilerErrorMessage());
+    ALOGE("LLVM error message: %s\n", getCompilerErrorMessage());
   }
   return status;
 }
@@ -326,7 +326,7 @@
 
   if (!mCompiled) {
     mErrorCode = BCC_OUT_OF_MEMORY;
-    LOGE("Out of memory: %s %d\n", __FILE__, __LINE__);
+    ALOGE("Out of memory: %s %d\n", __FILE__, __LINE__);
     return 1;
   }
 
@@ -341,33 +341,33 @@
   // Parse Bitcode File (if necessary)
   for (size_t i = 0; i < 2; ++i) {
     if (mSourceList[i] && mSourceList[i]->prepareModule(mCompiled) != 0) {
-      LOGE("Unable to parse bitcode for source[%lu]\n", (unsigned long)i);
+      ALOGE("Unable to parse bitcode for source[%lu]\n", (unsigned long)i);
       return 1;
     }
   }
 
   // Set the main source module
   if (!mSourceList[0] || !mSourceList[0]->getModule()) {
-    LOGE("Source bitcode is not setted.\n");
+    ALOGE("Source bitcode is not setted.\n");
     return 1;
   }
 
   if (mCompiled->readModule(mSourceList[0]->takeModule()) != 0) {
-    LOGE("Unable to read source module\n");
+    ALOGE("Unable to read source module\n");
     return 1;
   }
 
   // Link the source module with the library module
   if (mSourceList[1]) {
     if (mCompiled->linkModule(mSourceList[1]->takeModule()) != 0) {
-      LOGE("Unable to link library module\n");
+      ALOGE("Unable to link library module\n");
       return 1;
     }
   }
 
   // Compile and JIT the code
   if (mCompiled->compile(compileOnly) != 0) {
-    LOGE("Unable to compile.\n");
+    ALOGE("Unable to compile.\n");
     return 1;
   }
 
@@ -442,7 +442,7 @@
         objFile.close();
 
         if (unlink(objPath.c_str()) != 0) {
-          LOGE("Unable to remove the invalid cache file: %s. (reason: %s)\n",
+          ALOGE("Unable to remove the invalid cache file: %s. (reason: %s)\n",
                objPath.c_str(), strerror(errno));
         }
 
@@ -450,7 +450,7 @@
         infoFile.close();
 
         if (unlink(infoPath.c_str()) != 0) {
-          LOGE("Unable to remove the invalid cache file: %s. (reason: %s)\n",
+          ALOGE("Unable to remove the invalid cache file: %s. (reason: %s)\n",
                infoPath.c_str(), strerror(errno));
         }
       }
@@ -749,7 +749,7 @@
 
   if (mStatus != ScriptStatus::Unknown) {
     mErrorCode = BCC_INVALID_OPERATION;
-    LOGE("Invalid operation: %s\n", __func__);
+    ALOGE("Invalid operation: %s\n", __func__);
     return 1;
   }
   return 0;
diff --git a/lib/ExecutionEngine/Sha1Helper.cpp b/lib/ExecutionEngine/Sha1Helper.cpp
index 1ef717a..0acd6b8 100644
--- a/lib/ExecutionEngine/Sha1Helper.cpp
+++ b/lib/ExecutionEngine/Sha1Helper.cpp
@@ -53,7 +53,7 @@
   FileHandle file;
 
   if (file.open(filename, OpenMode::Read) < 0) {
-    LOGE("Unable to calculate the sha1 checksum of %s\n", filename);
+    ALOGE("Unable to calculate the sha1 checksum of %s\n", filename);
     memset(result, '\0', 20);
     return;
   }
@@ -85,7 +85,7 @@
 void readSHA1(unsigned char *result, int result_size, char const *filename) {
   FileHandle file;
   if (file.open(filename, OpenMode::Read) < 0) {
-    LOGE("Unable to read binary sha1 file %s\n", filename);
+    ALOGE("Unable to read binary sha1 file %s\n", filename);
     memset(result, '\0', result_size);
     return;
   }
diff --git a/lib/ExecutionEngine/SourceInfo.cpp b/lib/ExecutionEngine/SourceInfo.cpp
index 1dd212d..019ecb1 100644
--- a/lib/ExecutionEngine/SourceInfo.cpp
+++ b/lib/ExecutionEngine/SourceInfo.cpp
@@ -142,7 +142,7 @@
           llvm::StringRef(buffer.bitcode, buffer.bitcodeSize)));
 
       if (!MEM.get()) {
-        LOGE("Unable to MemoryBuffer::getMemBuffer(addr=%p, size=%lu)\n",
+        ALOGE("Unable to MemoryBuffer::getMemBuffer(addr=%p, size=%lu)\n",
              buffer.bitcode, (unsigned long)buffer.bitcodeSize);
         return 1;
       }
@@ -156,7 +156,7 @@
       llvm::OwningPtr<llvm::MemoryBuffer> MEM;
 
       if (llvm::error_code ec = llvm::MemoryBuffer::getFile(file.path, MEM)) {
-        LOGE("Unable to MemoryBuffer::getFile(path=%s)\n", file.path);
+        ALOGE("Unable to MemoryBuffer::getFile(path=%s)\n", file.path);
         return 1;
       }