Update language to comply with Android’s inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Test: m rs-api-doc-generator
Test: run relevant parts of generate.sh
Change-Id: I1c2ca132c9f7245968da31f957a8c83cefc68266
diff --git a/script_api/Android.bp b/script_api/Android.bp
index 943f956..7d0741b 100644
--- a/script_api/Android.bp
+++ b/script_api/Android.bp
@@ -10,7 +10,7 @@
"GenerateTestFiles.cpp",
"Scanner.cpp",
"Utilities.cpp",
- "GenerateStubsWhiteList.cpp",
+ "GenerateRSFunctionsList.cpp",
],
cflags: [
diff --git a/script_api/GenerateStubsWhiteList.cpp b/script_api/GenerateRSFunctionsList.cpp
similarity index 96%
rename from script_api/GenerateStubsWhiteList.cpp
rename to script_api/GenerateRSFunctionsList.cpp
index 1c98adf..26dd1ef 100644
--- a/script_api/GenerateStubsWhiteList.cpp
+++ b/script_api/GenerateRSFunctionsList.cpp
@@ -386,18 +386,18 @@
return success;
}
-/* Generate the white list file of the mangled function prototypes. This generated list is used
+/* Generate the file with the mangled function names. This generated list is used
* to validate unresolved external references. 'lastApiLevel' is the largest api level found in
* all spec files.
*/
-static bool generateWhiteListFile(unsigned int lastApiLevel) {
+static bool generateRSFunctionsListFile(unsigned int lastApiLevel) {
bool success = true;
// We generate all the manglings in a set to remove duplicates and to order them.
set<string> allManglings;
for (auto f : systemSpecification.getFunctions()) {
const Function* function = f.second;
for (auto spec : function->getSpecifications()) {
- // Compiler intrinsics are not runtime APIs. Do not include them in the whitelist.
+ // Compiler intrinsics are not runtime APIs. Do not include them.
if (spec->isIntrinsic()) {
continue;
}
@@ -410,12 +410,12 @@
if (success) {
GeneratedFile file;
- if (!file.start(".", "RSStubsWhiteList.cpp")) {
+ if (!file.start(".", "RSFunctionsList.cpp")) {
return false;
}
file.writeNotices();
- file << "#include \"RSStubsWhiteList.h\"\n\n";
+ file << "#include \"RSFunctionsList.h\"\n\n";
file << "std::array<std::string_view, " << allManglings.size() << "> stubList = {\n";
for (const auto& e : allManglings) {
file << "\"" << e << "\",\n";
@@ -423,18 +423,18 @@
file << "};\n";
GeneratedFile header;
- if (!header.start(".", "RSStubsWhiteList.h")) {
+ if (!header.start(".", "RSFunctionsList.h")) {
return false;
}
header.writeNotices();
- header << "#ifndef RSStubsWhiteList_H\n";
- header << "#define RSStubsWhiteList_H\n\n";
+ header << "#ifndef RSFunctionsList_H\n";
+ header << "#define RSFunctionsList_H\n\n";
header << "#include <cstdlib>\n";
header << "#include <array>\n";
header << "#include <string_view>\n\n";
header << "extern std::array<std::string_view, " << allManglings.size() << "> stubList;\n\n";
- header << "#endif // RSStubsWhiteList_H\n";
+ header << "#endif // RSFunctionsList_H\n";
}
return success;
}
@@ -493,7 +493,7 @@
* Since some structures can't be defined at the global level, we use casts of simple byte
* buffers to get around that restriction.
*
- * This file can be used to verify the white list that's also generated in this file. To do so,
+ * This file can be used to verify the function list that's also generated in this file. To do so,
* run "llvm-nm -undefined-only -just-symbol-name" on the resulting bit code.
*/
static bool generateApiTesterFile(const string& slangTestDirectory, unsigned int apiLevel) {
@@ -562,9 +562,9 @@
return true;
}
-bool generateStubsWhiteList(const string& slangTestDirectory, unsigned int maxApiLevel) {
+bool generateRSFunctionsList(const string& slangTestDirectory, unsigned int maxApiLevel) {
unsigned int lastApiLevel = min(systemSpecification.getMaximumApiLevel(), maxApiLevel);
- if (!generateWhiteListFile(lastApiLevel)) {
+ if (!generateRSFunctionsListFile(lastApiLevel)) {
return false;
}
// Generate a test file for each apiLevel.
diff --git a/script_api/Generator.h b/script_api/Generator.h
index dc61edc..2cbc37f 100644
--- a/script_api/Generator.h
+++ b/script_api/Generator.h
@@ -29,10 +29,10 @@
*/
bool generateDocumentation(const std::string& director);
-/* Generates the RSStubsWhiteList.cpp file. Also generates script test files that are used
- * when testing slang and that can be used to manually verify the white list.
- * The implementation is in GenerateStubsWhiteList.cpp.
+/* Generates the RSFunctionsList.cpp file. Also generates script test files that are used
+ * when testing slang and that can be used to manually verify the list.
+ * The implementation is in GenerateRSFunctionsList.cpp.
*/
-bool generateStubsWhiteList(const std::string& slangTestDirectory, unsigned int maxApiLevel);
+bool generateRSFunctionsList(const std::string& slangTestDirectory, unsigned int maxApiLevel);
#endif // ANDROID_RS_API_GENERATOR_GENERATOR_H
diff --git a/script_api/Specification.cpp b/script_api/Specification.cpp
index 95ebc78..32354e4 100644
--- a/script_api/Specification.cpp
+++ b/script_api/Specification.cpp
@@ -937,7 +937,7 @@
bool success = generateHeaderFiles("include") &&
generateDocumentation("docs") &&
generateTestFiles("test", maxApiLevel) &&
- generateStubsWhiteList("slangtest", maxApiLevel);
+ generateRSFunctionsList("slangtest", maxApiLevel);
if (success) {
cout << "Successfully processed " << mTypes.size() << " types, " << mConstants.size()
<< " constants, and " << mFunctions.size() << " functions.\n";
diff --git a/script_api/generate.sh b/script_api/generate.sh
index 9b14ee5..befed81 100755
--- a/script_api/generate.sh
+++ b/script_api/generate.sh
@@ -63,5 +63,5 @@
done
rm -rf slangtest
-mv RSStubsWhiteList.cpp ../../compile/libbcc/lib/
-mv RSStubsWhiteList.h ../../compile/libbcc/lib/
+mv RSFunctionsList.cpp ../../compile/libbcc/lib/
+mv RsFunctionsList.h ../../compile/libbcc/lib/