aboutsummaryrefslogtreecommitdiffstats
path: root/slang_rs_object_ref_count.h
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2011-04-18 16:38:03 -0700
committerStephen Hines <srhines@google.com>2011-04-20 17:18:51 -0700
commitd0b5edd02be5f09c1d8d211f4a06b031a7b66510 (patch)
tree2fe7f5b68827a0ff5dd2cbda58afe48dcdd7c5b2 /slang_rs_object_ref_count.h
parent7207645766b118ef18081363bb58e39d3e715c2f (diff)
downloadandroid_frameworks_compile_slang-d0b5edd02be5f09c1d8d211f4a06b031a7b66510.tar.gz
android_frameworks_compile_slang-d0b5edd02be5f09c1d8d211f4a06b031a7b66510.tar.bz2
android_frameworks_compile_slang-d0b5edd02be5f09c1d8d211f4a06b031a7b66510.zip
Disallow union copies that contain RS object types
This also cleans up RSObjectRefCount's usage of ASTContext a bit. BUG=4283858 Change-Id: I9ca61e27fc5d6eb1befc2da4fe2d157f5936a56f
Diffstat (limited to 'slang_rs_object_ref_count.h')
-rw-r--r--slang_rs_object_ref_count.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/slang_rs_object_ref_count.h b/slang_rs_object_ref_count.h
index 78984a7..fd3b5dc 100644
--- a/slang_rs_object_ref_count.h
+++ b/slang_rs_object_ref_count.h
@@ -59,11 +59,9 @@ class RSObjectRefCount : public clang::StmtVisitor<RSObjectRefCount> {
return;
}
- void ReplaceRSObjectAssignment(clang::BinaryOperator *AS,
- clang::Diagnostic *Diags);
+ void ReplaceRSObjectAssignment(clang::BinaryOperator *AS);
- void AppendRSObjectInit(clang::Diagnostic *Diags,
- clang::VarDecl *VD,
+ void AppendRSObjectInit(clang::VarDecl *VD,
clang::DeclStmt *DS,
RSExportPrimitiveType::DataType DT,
clang::Expr *InitExpr);
@@ -73,9 +71,9 @@ class RSObjectRefCount : public clang::StmtVisitor<RSObjectRefCount> {
static clang::Stmt *ClearRSObject(clang::VarDecl *VD);
};
+ clang::ASTContext &mCtx;
std::stack<Scope*> mScopeStack;
bool RSInitFD;
- clang::Diagnostic *mDiags;
// RSSetObjectFD and RSClearObjectFD holds FunctionDecl of rsSetObject()
// and rsClearObject() in the current ASTContext.
@@ -103,15 +101,15 @@ class RSObjectRefCount : public clang::StmtVisitor<RSObjectRefCount> {
const clang::SourceLocation &Loc);
public:
- RSObjectRefCount()
- : RSInitFD(false) {
+ explicit RSObjectRefCount(clang::ASTContext &C)
+ : mCtx(C),
+ RSInitFD(false) {
return;
}
- void Init(clang::ASTContext &C, clang::Diagnostic *Diags) {
+ void Init() {
if (!RSInitFD) {
- GetRSRefCountingFunctions(C);
- mDiags = Diags;
+ GetRSRefCountingFunctions(mCtx);
RSInitFD = true;
}
return;