Snap for 7468467 from 9e0902dc0af86f5c5ce367729365c50ab2f6fadf to mainline-mediaprovider-release

Change-Id: I7d3515885e6ac94da091d53ea39bd8e381a18322
diff --git a/Android.bp b/Android.bp
index 28f1b8a..e7800af 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,6 +14,39 @@
 // limitations under the License.
 //
 
+package {
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// See: http://go/android-license-faq
+license {
+    name: "frameworks_compile_libbcc_license",
+    visibility: [":__subpackages__"],
+    license_kinds: [
+        "SPDX-license-identifier-Apache-2.0",
+        "SPDX-license-identifier-BSD",
+        "SPDX-license-identifier-MIT",
+        "SPDX-license-identifier-NCSA",
+        "legacy_unencumbered",
+    ],
+    license_text: [
+        "NOTICE",
+    ],
+}
+
 cc_defaults {
     name: "libbcc-defaults",
     defaults: [
@@ -87,12 +120,6 @@
                 "-DDISABLE_CLCORE_NEON",
             ],
         },
-        mips: {
-            cflags: ["-DFORCE_MIPS_CODEGEN"],
-        },
-        mips64: {
-            cflags: ["-DFORCE_MIPS64_CODEGEN"],
-        },
     },
     target: {
         android_x86: {
diff --git a/README.html b/README.html
index c4b9653..1cc5908 100644
--- a/README.html
+++ b/README.html
@@ -317,9 +317,9 @@
 <li>Android devices demand fast start-up time, small size, and high
 performance <em>at the same time</em>. libbcc attempts to address these
 design constraints.</li>
-<li>it supports on-device linking. Each device vendor can supply his or
-her own runtime bitcode library (lib*.bc) that differentiates his or
-her system. Specialization becomes ecosystem-friendly.</li>
+<li>it supports on-device linking. Each device vendor can supply their
+own runtime bitcode library (lib*.bc) that differentiates their
+system. Specialization becomes ecosystem-friendly.</li>
 </ul>
 <p>libbcc provides:</p>
 <ul class="simple">
diff --git a/README.rst b/README.rst
index a6db1f1..f81eaa7 100644
--- a/README.rst
+++ b/README.rst
@@ -16,9 +16,9 @@
   performance *at the same time*. libbcc attempts to address these
   design constraints.
 
-* it supports on-device linking. Each device vendor can supply his or
-  her own runtime bitcode library (lib*.bc) that differentiates his or
-  her system. Specialization becomes ecosystem-friendly.
+* it supports on-device linking. Each device vendor can supply their
+  own runtime bitcode library (lib*.bc) that differentiates their
+  system. Specialization becomes ecosystem-friendly.
 
 libbcc provides:
 
diff --git a/bcinfo/Android.bp b/bcinfo/Android.bp
index 27a10b3..95f7f0d 100644
--- a/bcinfo/Android.bp
+++ b/bcinfo/Android.bp
@@ -14,6 +14,16 @@
 // limitations under the License.
 //
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    //   SPDX-license-identifier-NCSA
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_library_shared {
     name: "libbcinfo",
     vendor_available: true,
@@ -81,12 +91,6 @@
                 "libcutils",
                 "liblog",
             ],
-            product_variables: {
-                unbundled_build: {
-                    // don't build for unbundled branches
-                    enabled: false,
-                },
-            },
         },
         android: {
             shared_libs: [
diff --git a/bcinfo/BitReader_2_7/Android.bp b/bcinfo/BitReader_2_7/Android.bp
index 3003ff0..22636fb 100644
--- a/bcinfo/BitReader_2_7/Android.bp
+++ b/bcinfo/BitReader_2_7/Android.bp
@@ -1,3 +1,12 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-NCSA
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_library_static {
     name: "libLLVMBitReader_2_7",
     vendor_available: true,
diff --git a/bcinfo/BitReader_3_0/Android.bp b/bcinfo/BitReader_3_0/Android.bp
index 858d2d0..f3e58e7 100644
--- a/bcinfo/BitReader_3_0/Android.bp
+++ b/bcinfo/BitReader_3_0/Android.bp
@@ -1,3 +1,12 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-NCSA
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_library_static {
     name: "libLLVMBitReader_3_0",
     vendor_available: true,
diff --git a/bcinfo/Wrap/Android.bp b/bcinfo/Wrap/Android.bp
index 575bdbb..f86684a 100644
--- a/bcinfo/Wrap/Android.bp
+++ b/bcinfo/Wrap/Android.bp
@@ -14,6 +14,16 @@
 // limitations under the License.
 //
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    //   SPDX-license-identifier-NCSA
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_library_static {
     name: "libLLVMWrap",
     vendor_available: true,
diff --git a/bcinfo/tools/Android.bp b/bcinfo/tools/Android.bp
index 99dfb03..17d9c03 100644
--- a/bcinfo/tools/Android.bp
+++ b/bcinfo/tools/Android.bp
@@ -16,6 +16,15 @@
 
 // Executable for host
 // ========================================================
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_binary_host {
     name: "bcinfo",
     defaults: ["llvm-defaults"],
diff --git a/include/bcc/Compiler.h b/include/bcc/Compiler.h
index 708e1b0..715cb2c 100644
--- a/include/bcc/Compiler.h
+++ b/include/bcc/Compiler.h
@@ -109,9 +109,9 @@
 
   ~Compiler();
 
-  // Compare undefined external functions in pScript against a 'whitelist' of
-  // all RenderScript functions.  Returns error if any external function that is
-  // not in this whitelist is callable from the script.
+  // Compare undefined external functions in pScript against a list of allowed
+  // RenderScript functions.  Returns error if any external function that is
+  // not in this list is callable from the script.
   enum ErrorCode screenGlobalFunctions(Script &pScript);
 
   void translateGEPs(Script &pScript);
diff --git a/lib/Android.bp b/lib/Android.bp
index d5a33f6..583afa0 100644
--- a/lib/Android.bp
+++ b/lib/Android.bp
@@ -12,6 +12,15 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_library {
     name: "libbcc",
     vendor_available: true,
@@ -35,7 +44,7 @@
         "RSKernelExpand.cpp",
         "RSScreenFunctionsPass.cpp",
         "RSScriptGroupFusion.cpp",
-        "RSStubsWhiteList.cpp",
+        "RSFunctionsList.cpp",
         "RSX86CallConvPass.cpp",
         "RSX86TranslateGEPPass.cpp",
         "Script.cpp",
diff --git a/lib/RSStubsWhiteList.cpp b/lib/RSFunctionsList.cpp
similarity index 99%
rename from lib/RSStubsWhiteList.cpp
rename to lib/RSFunctionsList.cpp
index fc93b60..d2845b5 100644
--- a/lib/RSStubsWhiteList.cpp
+++ b/lib/RSFunctionsList.cpp
@@ -16,7 +16,7 @@
 
 // Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
 
-#include "RSStubsWhiteList.h"
+#include "RSFunctionsList.h"
 
 std::array<std::string_view, 2328> stubList = {
 "_Z10half_recipDv2_f",
diff --git a/lib/RSStubsWhiteList.h b/lib/RSFunctionsList.h
similarity index 90%
rename from lib/RSStubsWhiteList.h
rename to lib/RSFunctionsList.h
index 17e64ce..f60af97 100644
--- a/lib/RSStubsWhiteList.h
+++ b/lib/RSFunctionsList.h
@@ -16,8 +16,8 @@
 
 // Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
 
-#ifndef RSStubsWhiteList_H
-#define RSStubsWhiteList_H
+#ifndef RSFunctionsList_H
+#define RSFunctionsList_H
 
 #include <cstdlib>
 #include <array>
@@ -25,4 +25,4 @@
 
 extern std::array<std::string_view, 2328> stubList;
 
-#endif // RSStubsWhiteList_H
+#endif // RSFunctionsList_H
diff --git a/lib/RSScreenFunctionsPass.cpp b/lib/RSScreenFunctionsPass.cpp
index 26fb4ea..9a63ebd 100644
--- a/lib/RSScreenFunctionsPass.cpp
+++ b/lib/RSScreenFunctionsPass.cpp
@@ -16,7 +16,7 @@
 
 #include "Log.h"
 #include "RSTransforms.h"
-#include "RSStubsWhiteList.h"
+#include "RSFunctionsList.h"
 
 #include <cstdlib>
 
@@ -48,7 +48,7 @@
     // A global function symbol is legal if
     // a. it has a body, i.e. is not empty or
     // b. its name starts with "llvm." or
-    // c. it is present in the whitelist
+    // c. it is present in the RS Functions list.
 
     if (!F.empty())
       return true;
diff --git a/lib/RSScriptGroupFusion.cpp b/lib/RSScriptGroupFusion.cpp
index 170c2c6..409a5a6 100644
--- a/lib/RSScriptGroupFusion.cpp
+++ b/lib/RSScriptGroupFusion.cpp
@@ -75,7 +75,7 @@
   return function;
 }
 
-// The whitelist of supported signature bits. Context or user data arguments are
+// The collection of supported signature bits. Context or user data arguments are
 // not currently supported in kernel fusion. To support them or any new kinds of
 // arguments in the future, it requires not only listing the signature bits here,
 // but also implementing additional necessary fusion logic in the getFusedFuncSig(),
diff --git a/lib/Source.cpp b/lib/Source.cpp
index d99eb10..63c4a5a 100644
--- a/lib/Source.cpp
+++ b/lib/Source.cpp
@@ -45,11 +45,12 @@
 // return nullptr and will NOT take the ownership of pInput.
 static inline std::unique_ptr<llvm::Module> helper_load_bitcode(llvm::LLVMContext &pContext,
                                                 std::unique_ptr<llvm::MemoryBuffer> &&pInput) {
+  auto bufferId = pInput->getBufferIdentifier();
   llvm::ErrorOr<std::unique_ptr<llvm::Module> > moduleOrError
       = llvm::getLazyBitcodeModule(std::move(pInput), pContext);
   if (std::error_code ec = moduleOrError.getError()) {
     ALOGE("Unable to parse the given bitcode file `%s'! (%s)",
-          pInput->getBufferIdentifier(), ec.message().c_str());
+          bufferId, ec.message().c_str());
   }
 
   return std::move(moduleOrError.get());
diff --git a/libbcc-targets.mk b/libbcc-targets.mk
index 7bb2384..eaf636d 100644
--- a/libbcc-targets.mk
+++ b/libbcc-targets.mk
@@ -29,8 +29,6 @@
 endif
 
 LOCAL_CFLAGS_arm64 += -DFORCE_ARM64_CODEGEN -DARCH_ARM_HAVE_NEON -DARCH_ARM_HAVE_VFP -DARCH_ARM_HAVE_VFP_D32 -DDISABLE_CLCORE_NEON
-LOCAL_CFLAGS_mips += -DFORCE_MIPS_CODEGEN
-LOCAL_CFLAGS_mips64 += -DFORCE_MIPS64_CODEGEN
 
 LOCAL_CFLAGS_x86 += -DFORCE_X86_CODEGEN
 LOCAL_CFLAGS_x86_64 += -DFORCE_X86_64_CODEGEN
@@ -41,7 +39,7 @@
 endif
 
 
-ifeq (,$(filter $(TARGET_ARCH),arm64 arm mips mips64 x86 x86_64))
+ifeq (,$(filter $(TARGET_ARCH),arm64 arm x86 x86_64))
   $(error Unsupported architecture $(TARGET_ARCH))
 endif
 
diff --git a/tests/libbcc/test_reduce_general_cleanup.ll b/tests/libbcc/test_reduce_general_cleanup.ll
index 214bc5c..9257aea 100644
--- a/tests/libbcc/test_reduce_general_cleanup.ll
+++ b/tests/libbcc/test_reduce_general_cleanup.ll
@@ -1,4 +1,4 @@
-; Check that the unexpanded accumulator functions and the dummy variables are deleted.
+; Check that the unexpanded accumulator functions and the temp variables are deleted.
 ; There doesn't seem to be any way to compute the basename of %s, hence the unfortunate
 ;   explicit uses of "test_reduce_general_cleanup" below.
 ; There doesn't seem to be a way to write a CHECK-NOT pattern that matches only at the
diff --git a/tools/Android.bp b/tools/Android.bp
index 15e0a1e..4761453 100644
--- a/tools/Android.bp
+++ b/tools/Android.bp
@@ -1,3 +1,12 @@
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 subdirs = [
     "bcc",
     "bcc_compat",
diff --git a/tools/bcc/Android.bp b/tools/bcc/Android.bp
index 5a64c4d..d2d36ad 100644
--- a/tools/bcc/Android.bp
+++ b/tools/bcc/Android.bp
@@ -14,6 +14,15 @@
 // limitations under the License.
 //
 
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_binary {
     name: "bcc",
     host_supported: true,
diff --git a/tools/bcc_compat/Android.bp b/tools/bcc_compat/Android.bp
index 2cc54c7..192d576 100644
--- a/tools/bcc_compat/Android.bp
+++ b/tools/bcc_compat/Android.bp
@@ -16,6 +16,15 @@
 
 // Executable for host
 // ========================================================
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_binary_host {
     name: "bcc_compat",
     defaults: ["libbcc-defaults"],
diff --git a/tools/bcc_strip_attr/Android.bp b/tools/bcc_strip_attr/Android.bp
index b463b2f..7243770 100644
--- a/tools/bcc_strip_attr/Android.bp
+++ b/tools/bcc_strip_attr/Android.bp
@@ -16,6 +16,15 @@
 
 // Executable for host
 // ========================================================
+package {
+    // See: http://go/android-license-faq
+    // A large-scale-change added 'default_applicable_licenses' to import
+    // all of the 'license_kinds' from "frameworks_compile_libbcc_license"
+    // to get the below license kinds:
+    //   SPDX-license-identifier-Apache-2.0
+    default_applicable_licenses: ["frameworks_compile_libbcc_license"],
+}
+
 cc_binary_host {
     name: "bcc_strip_attr",
     defaults: ["libbcc-defaults"],