summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-01-12 09:06:06 +0000
committerJay Foad <jay.foad@gmail.com>2011-01-12 09:06:06 +0000
commit39c7980772fd980ff06384453d0df1c25ed4fe7e (patch)
tree03b3de9c2e0547301263cf88e9a498c7bbb68ddc /clang/lib/AST/Decl.cpp
parentebbeb792345cf5ef490f2a8d75d1e271082ef457 (diff)
downloadbcm5719-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/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 786f28a60da..8331bf68a17 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1855,8 +1855,8 @@ bool FunctionDecl::isOutOfLine() const {
// FieldDecl Implementation
//===----------------------------------------------------------------------===//
-FieldDecl *FieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T,
+FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
+ SourceLocation L, IdentifierInfo *Id, QualType T,
TypeSourceInfo *TInfo, Expr *BW, bool Mutable) {
return new (C) FieldDecl(Decl::Field, DC, L, Id, T, TInfo, BW, Mutable);
}
@@ -2000,7 +2000,7 @@ RecordDecl::RecordDecl(Kind DK, TagKind TK, DeclContext *DC, SourceLocation L,
assert(classof(static_cast<Decl*>(this)) && "Invalid Kind!");
}
-RecordDecl *RecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC,
+RecordDecl *RecordDecl::Create(const ASTContext &C, TagKind TK, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
SourceLocation TKL, RecordDecl* PrevDecl) {
@@ -2009,7 +2009,7 @@ RecordDecl *RecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC,
return R;
}
-RecordDecl *RecordDecl::Create(ASTContext &C, EmptyShell Empty) {
+RecordDecl *RecordDecl::Create(const ASTContext &C, EmptyShell Empty) {
return new (C) RecordDecl(Record, TTK_Struct, 0, SourceLocation(), 0, 0,
SourceLocation());
}
OpenPOWER on IntegriCloud