Don't use anonymous literal structures for RS object types.
Bug: 22926131
Using an anonymous structure type prevents us from being able to use
LLVM to determine the actual typename. This is problematic, because
there are some cases where bcc needs to be able to detect/act on RS
object types. Giving each of these structures a legitimate name has no
impact on the generated code (since we are already using typedefs).
This change is also safe for targeting prior Android releases with our
toolchain.
This change also adjusts the API generator to ensure that we can
generate relevant code/docs/tests for handling RS objects. A new
TypeKind is added for RS_OBJECT, instead of using SIMPLE.
Change-Id: Iaff928f5821af66cfc9b3aea2ff5549d0c8a9408
diff --git a/api/Specification.cpp b/api/Specification.cpp
index 7862d31..f02e429 100644
--- a/api/Specification.cpp
+++ b/api/Specification.cpp
@@ -378,6 +378,9 @@
spec->mKind = SIMPLE;
spec->mSimpleType = scanner->getValue();
}
+ if (scanner->findOptionalTag("rs_object:")) {
+ spec->mKind = RS_OBJECT;
+ }
if (scanner->findOptionalTag("struct:")) {
spec->mKind = STRUCT;
spec->mStructName = scanner->getValue();