Apply changes to migrate to upstream (Nov 25th 2011).
- HandleTopLevelDecl now returns bool.
- Additional APValue::MemberPointer case for switching.
Change-Id: Ieb7a693f96b07b7659712a3ab0abd200ce7df505
diff --git a/slang_backend.cpp b/slang_backend.cpp
index d4bf137..b885c6d 100644
--- a/slang_backend.cpp
+++ b/slang_backend.cpp
@@ -248,9 +248,9 @@
return;
}
-void Backend::HandleTopLevelDecl(clang::DeclGroupRef D) {
+bool Backend::HandleTopLevelDecl(clang::DeclGroupRef D) {
mGen->HandleTopLevelDecl(D);
- return;
+ return true;
}
void Backend::HandleTranslationUnit(clang::ASTContext &Ctx) {
diff --git a/slang_backend.h b/slang_backend.h
index 3e6dd60..71cd1c7 100644
--- a/slang_backend.h
+++ b/slang_backend.h
@@ -116,7 +116,7 @@
// called by the parser to process every top-level Decl*. Note that D can be
// the head of a chain of Decls (e.g. for `int a, b` the chain will have two
// elements). Use Decl::getNextDeclarator() to walk the chain.
- virtual void HandleTopLevelDecl(clang::DeclGroupRef D);
+ virtual bool HandleTopLevelDecl(clang::DeclGroupRef D);
// HandleTranslationUnit - This method is called when the ASTs for entire
// translation unit have been parsed.
diff --git a/slang_rs_backend.cpp b/slang_rs_backend.cpp
index d4a081b..7c749b9 100644
--- a/slang_rs_backend.cpp
+++ b/slang_rs_backend.cpp
@@ -74,7 +74,7 @@
return;
}
-void RSBackend::HandleTopLevelDecl(clang::DeclGroupRef D) {
+bool RSBackend::HandleTopLevelDecl(clang::DeclGroupRef D) {
// Disallow user-defined functions with prefix "rs"
if (!mAllowRSPrefix) {
// Iterate all function declarations in the program.
@@ -103,8 +103,7 @@
}
}
- Backend::HandleTopLevelDecl(D);
- return;
+ return Backend::HandleTopLevelDecl(D);
}
namespace {
diff --git a/slang_rs_backend.h b/slang_rs_backend.h
index 49d4f00..c984ae7 100644
--- a/slang_rs_backend.h
+++ b/slang_rs_backend.h
@@ -63,7 +63,7 @@
return mContext->getTargetAPI();
}
- virtual void HandleTopLevelDecl(clang::DeclGroupRef D);
+ virtual bool HandleTopLevelDecl(clang::DeclGroupRef D);
virtual void HandleTranslationUnitPre(clang::ASTContext &C);
diff --git a/slang_rs_reflection.cpp b/slang_rs_reflection.cpp
index 15bda24..454946f 100644
--- a/slang_rs_reflection.cpp
+++ b/slang_rs_reflection.cpp
@@ -805,6 +805,7 @@
}
break;
}
+ case clang::APValue::MemberPointer:
case clang::APValue::Uninitialized:
case clang::APValue::ComplexInt:
case clang::APValue::ComplexFloat: