diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-01-12 09:06:06 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-01-12 09:06:06 +0000 |
commit | 39c7980772fd980ff06384453d0df1c25ed4fe7e (patch) | |
tree | 03b3de9c2e0547301263cf88e9a498c7bbb68ddc /clang/lib/AST/Expr.cpp | |
parent | ebbeb792345cf5ef490f2a8d75d1e271082ef457 (diff) | |
download | bcm5719-llvm-39c7980772fd980ff06384453d0df1c25ed4fe7e.tar.gz bcm5719-llvm-39c7980772fd980ff06384453d0df1c25ed4fe7e.zip |
PR3558: mark "logically const" accessor methods in ASTContext as const,
and mark the fields they use as mutable. This allows us to remove a few
const_casts.
llvm-svn: 123314
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index c1dc5326e59..28e1afab0ea 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -724,7 +724,7 @@ void CallExpr::setNumArgs(ASTContext& C, unsigned NumArgs) { /// isBuiltinCall - If this is a call to a builtin, return the builtin ID. If /// not, return 0. -unsigned CallExpr::isBuiltinCall(ASTContext &Context) const { +unsigned CallExpr::isBuiltinCall(const ASTContext &Context) const { // All simple function calls (e.g. func()) are implicitly cast to pointer to // function. As a result, we try and obtain the DeclRefExpr from the // ImplicitCastExpr. @@ -2453,7 +2453,7 @@ ObjCInterfaceDecl *ObjCMessageExpr::getReceiverInterface() const { return 0; } -bool ChooseExpr::isConditionTrue(ASTContext &C) const { +bool ChooseExpr::isConditionTrue(const ASTContext &C) const { return getCond()->EvaluateAsInt(C) != 0; } |