]> granicus.if.org Git - clang/commitdiff
Const-ify some methods in ASTReader.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 19 Sep 2011 20:40:02 +0000 (20:40 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 19 Sep 2011 20:40:02 +0000 (20:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140054 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp

index 9f3973bc24a649dd0c5bc50dd037908e8966026b..ce980f775b11776063f252bf24c57d85651d7b35 100644 (file)
@@ -1142,7 +1142,7 @@ public:
                           unsigned &Idx);
 
   /// \brief Read a source location from raw form.
-  SourceLocation ReadSourceLocation(Module &Module, unsigned Raw) {
+  SourceLocation ReadSourceLocation(Module &Module, unsigned Raw) const {
     unsigned Flag = Raw & (1U << 31);
     unsigned Offset = Raw & ~(1U << 31);
     assert(Module.SLocRemap.find(Offset) != Module.SLocRemap.end() &&
@@ -1215,7 +1215,7 @@ public:
   /// \brief Determine the global preprocessed entity ID that corresponds to
   /// the given local ID within the given module.
   serialization::PreprocessedEntityID 
-  getGlobalPreprocessedEntityID(Module &M, unsigned LocalID);
+  getGlobalPreprocessedEntityID(Module &M, unsigned LocalID) const;
   
   /// \brief Note that the identifier is a macro whose record will be loaded
   /// from the given AST file at the given (file-local) offset.
index 6c0afb59b40c30374eebb18492f8d5697cf5dac8..30e3c8cb920482e427bd4510425aa470b6cf8702 100644 (file)
@@ -1440,8 +1440,8 @@ PreprocessedEntity *ASTReader::LoadPreprocessedEntity(Module &F) {
 }
 
 PreprocessedEntityID 
-ASTReader::getGlobalPreprocessedEntityID(Module &M, unsigned LocalID) {
-  ContinuousRangeMap<uint32_t, int, 2>::iterator 
+ASTReader::getGlobalPreprocessedEntityID(Module &M, unsigned LocalID) const {
+  ContinuousRangeMap<uint32_t, int, 2>::const_iterator 
     I = M.PreprocessedEntityRemap.find(LocalID - NUM_PREDEF_PP_ENTITY_IDS);
   assert(I != M.PreprocessedEntityRemap.end() 
          && "Invalid index into preprocessed entity index remap");