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
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index 679e809..46800cd 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -1725,8 +1725,8 @@
}
public:
- static FieldDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
- IdentifierInfo *Id, QualType T,
+ static FieldDecl *Create(const ASTContext &C, DeclContext *DC,
+ SourceLocation L, IdentifierInfo *Id, QualType T,
TypeSourceInfo *TInfo, Expr *BW, bool Mutable);
/// isMutable - Determines whether this field is mutable (C++ only).
@@ -2371,11 +2371,11 @@
RecordDecl *PrevDecl, SourceLocation TKL);
public:
- static RecordDecl *Create(ASTContext &C, TagKind TK, DeclContext *DC,
+ static RecordDecl *Create(const ASTContext &C, TagKind TK, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
SourceLocation TKL = SourceLocation(),
RecordDecl* PrevDecl = 0);
- static RecordDecl *Create(ASTContext &C, EmptyShell Empty);
+ static RecordDecl *Create(const ASTContext &C, EmptyShell Empty);
const RecordDecl *getPreviousDeclaration() const {
return cast_or_null<RecordDecl>(TagDecl::getPreviousDeclaration());