aboutsummaryrefslogtreecommitdiffstats
path: root/slang_rs_export_element.cpp
diff options
context:
space:
mode:
authorZonr Chang <zonr@google.com>2010-10-05 20:39:03 +0800
committerShih-wei Liao <sliao@google.com>2010-10-06 01:22:05 -0700
commit92b344a51c6c4934e96882bd401e4b13d6d03db8 (patch)
tree1b9b06e2a10db5b4ffc3eba2dd5813bc135e13bc /slang_rs_export_element.cpp
parent66aa299de2b5e0b0c7bfae7628e29a3961247aed (diff)
downloadframeworks_compile_slang-92b344a51c6c4934e96882bd401e4b13d6d03db8.tar.gz
frameworks_compile_slang-92b344a51c6c4934e96882bd401e4b13d6d03db8.tar.bz2
frameworks_compile_slang-92b344a51c6c4934e96882bd401e4b13d6d03db8.zip
Create RSExportMatrixType which is a subclass of RSExportType
to support rs_matrix{2x2,3x3,4x4} explicitly.
Diffstat (limited to 'slang_rs_export_element.cpp')
-rw-r--r--slang_rs_export_element.cpp34
1 files changed, 1 insertions, 33 deletions
diff --git a/slang_rs_export_element.cpp b/slang_rs_export_element.cpp
index 1ecacce..e646212 100644
--- a/slang_rs_export_element.cpp
+++ b/slang_rs_export_element.cpp
@@ -96,37 +96,6 @@ RSExportType *RSExportElement::Create(RSContext *Context,
ET = EVT;
break;
}
- case clang::Type::Record: {
- // Must be RS object type
-
- if (TypeName.equals(llvm::StringRef("rs_matrix2x2")) ||
- TypeName.equals(llvm::StringRef("rs_matrix3x3")) ||
- TypeName.equals(llvm::StringRef("rs_matrix4x4"))) {
- const clang::RecordType *RT = static_cast<const clang::RecordType*> (T);
- const clang::RecordDecl *RD = RT->getDecl();
- RD = RD->getDefinition();
- clang::RecordDecl::field_iterator fit = RD->field_begin();
- clang::FieldDecl *FD = *fit;
- const clang::Type *FT = RSExportType::GetTypeOfDecl(FD);
- RSExportConstantArrayType *ECT =
- RSExportConstantArrayType::Create(
- Context,
- static_cast<const clang::ConstantArrayType*> (FT),
- TypeName);
- ET = ECT;
- } else {
- RSExportPrimitiveType* EPT =
- RSExportPrimitiveType::Create(Context,
- T,
- TypeName,
- EI->kind,
- EI->normalized);
- // Verify
- assert(EI->type == EPT->getType() && "Element has unexpected type");
- ET = EPT;
- }
- break;
- }
default: {
// TODO(zonr): warn that type is not exportable
fprintf(stderr, "RSExportElement::Create : type '%s' is not exportable\n",
@@ -147,8 +116,7 @@ RSExportType *RSExportElement::CreateFromDecl(RSContext *Context,
// Note: RS element like rs_pixel_rgb elements are either in the type of
// primitive or vector.
if ((CT->getTypeClass() != clang::Type::Builtin) &&
- (CT->getTypeClass() != clang::Type::ExtVector) &&
- (CT->getTypeClass() != clang::Type::Record)) {
+ (CT->getTypeClass() != clang::Type::ExtVector)) {
return RSExportType::Create(Context, T);
}