[cfe-commits] r140054 - in /cfe/trunk: include/clang/Serialization/ASTReader.h lib/Serialization/ASTReader.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Sep 19 13:40:02 PDT 2011
Author: akirtzidis
Date: Mon Sep 19 15:40:02 2011
New Revision: 140054
URL: http://llvm.org/viewvc/llvm-project?rev=140054&view=rev
Log:
Const-ify some methods in ASTReader.
Modified:
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/lib/Serialization/ASTReader.cpp
Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=140054&r1=140053&r2=140054&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Mon Sep 19 15:40:02 2011
@@ -1142,7 +1142,7 @@
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 @@
/// \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.
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=140054&r1=140053&r2=140054&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Mon Sep 19 15:40:02 2011
@@ -1440,8 +1440,8 @@
}
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");
More information about the cfe-commits
mailing list