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 | 4ba2a17694148e16eaa8d3917f657ffcd3667be4 (patch) | |
tree | eea2b0e8b20ab2099277ffc51940a4648d4447ca /lib/AST/RecordLayout.cpp | |
parent | de9d5c39a412611651d77cb41afd41e7849e0f67 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/RecordLayout.cpp')
-rw-r--r-- | lib/AST/RecordLayout.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/AST/RecordLayout.cpp b/lib/AST/RecordLayout.cpp index 2dbe737d04..e027c1ab8d 100644 --- a/lib/AST/RecordLayout.cpp +++ b/lib/AST/RecordLayout.cpp @@ -27,9 +27,10 @@ void ASTRecordLayout::Destroy(ASTContext &Ctx) { Ctx.Deallocate(this); } -ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx, uint64_t size, unsigned alignment, - unsigned datasize, const uint64_t *fieldoffsets, - unsigned fieldcount) +ASTRecordLayout::ASTRecordLayout(const ASTContext &Ctx, uint64_t size, + unsigned alignment, unsigned datasize, + const uint64_t *fieldoffsets, + unsigned fieldcount) : Size(size), DataSize(datasize), FieldOffsets(0), Alignment(alignment), FieldCount(fieldcount), CXXInfo(0) { if (FieldCount > 0) { @@ -39,7 +40,7 @@ ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx, uint64_t size, unsigned alignm } // Constructor for C++ records. -ASTRecordLayout::ASTRecordLayout(ASTContext &Ctx, +ASTRecordLayout::ASTRecordLayout(const ASTContext &Ctx, uint64_t size, unsigned alignment, uint64_t datasize, const uint64_t *fieldoffsets, |