aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGClass.cpp
diff options
context:
space:
mode:
authorScott Douglass <sdouglass@arm.com>2015-06-10 13:53:15 +0000
committerScott Douglass <sdouglass@arm.com>2015-06-10 13:53:15 +0000
commit503fc39d1f86c1ea39ae33c7b6752a9d3e2fcbca (patch)
tree953ea747aebeafddc11278de9b0f7e8f98ef9bc2 /clang/lib/CodeGen/CGClass.cpp
parent965bf6a3cebe04300f9826017e1258c12dc21222 (diff)
downloadllvm-503fc39d1f86c1ea39ae33c7b6752a9d3e2fcbca.zip
llvm-503fc39d1f86c1ea39ae33c7b6752a9d3e2fcbca.tar.gz
llvm-503fc39d1f86c1ea39ae33c7b6752a9d3e2fcbca.tar.bz2
add ConstEvaluatedExprVisitor
Differential Revision: http://reviews.llvm.org/D10210 llvm-svn: 239474
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r--clang/lib/CodeGen/CGClass.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index cd75da2..1320cd3 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -370,25 +370,25 @@ namespace {
/// A visitor which checks whether an initializer uses 'this' in a
/// way which requires the vtable to be properly set.
- struct DynamicThisUseChecker : EvaluatedExprVisitor<DynamicThisUseChecker> {
- typedef EvaluatedExprVisitor<DynamicThisUseChecker> super;
+ struct DynamicThisUseChecker : ConstEvaluatedExprVisitor<DynamicThisUseChecker> {
+ typedef ConstEvaluatedExprVisitor<DynamicThisUseChecker> super;
bool UsesThis;
- DynamicThisUseChecker(ASTContext &C) : super(C), UsesThis(false) {}
+ DynamicThisUseChecker(const ASTContext &C) : super(C), UsesThis(false) {}
// Black-list all explicit and implicit references to 'this'.
//
// Do we need to worry about external references to 'this' derived
// from arbitrary code? If so, then anything which runs arbitrary
// external code might potentially access the vtable.
- void VisitCXXThisExpr(CXXThisExpr *E) { UsesThis = true; }
+ void VisitCXXThisExpr(const CXXThisExpr *E) { UsesThis = true; }
};
}
static bool BaseInitializerUsesThis(ASTContext &C, const Expr *Init) {
DynamicThisUseChecker Checker(C);
- Checker.Visit(const_cast<Expr*>(Init));
+ Checker.Visit(Init);
return Checker.UsesThis;
}