From: Argyrios Kyrtzidis Date: Fri, 2 Nov 2012 02:31:22 +0000 (+0000) Subject: [libclang] Correct how the index inside the local preprocessed entities array X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19c1706ecc2a8155f1b55e412e7fbdacdd3ebb73;p=platform%2Fupstream%2Fllvm.git [libclang] Correct how the index inside the local preprocessed entities array is getting converted to a global PreprocessedEntityID. llvm-svn: 167280 --- diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 80fb464..22f5aed 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -3822,7 +3822,7 @@ PreprocessedEntityID ASTReader::findNextPreprocessedEntity( EndI = GlobalSLocOffsetMap.end(); SLocMapI != EndI; ++SLocMapI) { ModuleFile &M = *SLocMapI->second; if (M.NumPreprocessedEntities) - return getGlobalPreprocessedEntityID(M, M.BasePreprocessedEntityID); + return M.BasePreprocessedEntityID; } return getTotalNumPreprocessedEntities(); @@ -3905,8 +3905,7 @@ ASTReader::findBeginPreprocessedEntity(SourceLocation BLoc) const { if (PPI == pp_end) return findNextPreprocessedEntity(SLocMapI); - return getGlobalPreprocessedEntityID(M, - M.BasePreprocessedEntityID + (PPI - pp_begin)); + return M.BasePreprocessedEntityID + (PPI - pp_begin); } /// \brief Returns the first preprocessed entity ID that begins after \arg ELoc. @@ -3935,8 +3934,7 @@ ASTReader::findEndPreprocessedEntity(SourceLocation ELoc) const { if (PPI == pp_end) return findNextPreprocessedEntity(SLocMapI); - return getGlobalPreprocessedEntityID(M, - M.BasePreprocessedEntityID + (PPI - pp_begin)); + return M.BasePreprocessedEntityID + (PPI - pp_begin); } /// \brief Returns a pair of [Begin, End) indices of preallocated