[clang] 8f5b061 - [clang][Interp][NFC] Make some Record methods const

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 03:51:37 PDT 2022


Author: Timm Bäder
Date: 2022-09-29T12:50:56+02:00
New Revision: 8f5b061254744dedd95b6c0d03b909b4084611a3

URL: https://github.com/llvm/llvm-project/commit/8f5b061254744dedd95b6c0d03b909b4084611a3
DIFF: https://github.com/llvm/llvm-project/commit/8f5b061254744dedd95b6c0d03b909b4084611a3.diff

LOG: [clang][Interp][NFC] Make some Record methods const

Added: 
    

Modified: 
    clang/lib/AST/Interp/Record.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Record.h b/clang/lib/AST/Interp/Record.h
index db559d7a6bf4..117dd2b32d58 100644
--- a/clang/lib/AST/Interp/Record.h
+++ b/clang/lib/AST/Interp/Record.h
@@ -66,7 +66,7 @@ class Record {
     return llvm::make_range(Fields.begin(), Fields.end());
   }
 
-  unsigned getNumFields() { return Fields.size(); }
+  unsigned getNumFields() const { return Fields.size(); }
   Field *getField(unsigned I) { return &Fields[I]; }
 
   using const_base_iter = BaseList::const_iterator;
@@ -74,7 +74,7 @@ class Record {
     return llvm::make_range(Bases.begin(), Bases.end());
   }
 
-  unsigned getNumBases() { return Bases.size(); }
+  unsigned getNumBases() const { return Bases.size(); }
   Base *getBase(unsigned I) { return &Bases[I]; }
 
   using const_virtual_iter = VirtualBaseList::const_iterator;
@@ -82,7 +82,7 @@ class Record {
     return llvm::make_range(VirtualBases.begin(), VirtualBases.end());
   }
 
-  unsigned getNumVirtualBases() { return VirtualBases.size(); }
+  unsigned getNumVirtualBases() const { return VirtualBases.size(); }
   Base *getVirtualBase(unsigned I) { return &VirtualBases[I]; }
 
 private:


        


More information about the cfe-commits mailing list