hanchenye-llvm-project/clang/lib/Serialization
Bruno Cardoso Lopes c23af5707d [ASTReader] Sort RawComments before merging
`RawComments` are sorted by comparing underlying `SourceLocation`'s. This is
done by comparing `FileID` and `Offset`; when the `FileID` is the same it means
the locations are within the same TU and the `Offset` is used.

FileID, from the source code: "A mostly-opaque identifier, where 0 is
"invalid", >0 is this module, and <-1 is something loaded from another
module.". That said, when de-serializing SourceLocations, FileID's from
RawComments loaded from other modules get negative IDs where previously they
were positive. This makes imported RawComments unsorted, leading to a wrong
merge with other comments from the current TU. Fix that by sorting RawComments
properly after de-serialization and before merge.

This fixes an assertion in `ASTContext::getRawCommentForDeclNoCache`,
which fires only in a debug build of clang.

Differential Revision: https://reviews.llvm.org/D27546

rdar://problem/29287314

llvm-svn: 290134
2016-12-19 21:06:06 +00:00
..
ASTCommon.cpp Revert "[c++1z] P0195R2: Support pack-expansion of using-declarations." 2016-12-19 10:09:25 +00:00
ASTCommon.h PR29097: add an update record when we instantiate the default member 2016-08-24 21:25:37 +00:00
ASTReader.cpp [ASTReader] Sort RawComments before merging 2016-12-19 21:06:06 +00:00
ASTReaderDecl.cpp Revert "[c++1z] P0195R2: Support pack-expansion of using-declarations." 2016-12-19 10:09:25 +00:00
ASTReaderInternals.h Remove move constructors that are identical to the generated default move ctor. 2016-10-21 18:55:07 +00:00
ASTReaderStmt.cpp [OpenMP] Sema and parsing for 'target teams' pragma 2016-12-17 05:48:59 +00:00
ASTWriter.cpp Attempt to fix build failure and regressions due to r290056 2016-12-18 06:35:06 +00:00
ASTWriterDecl.cpp Revert "[c++1z] P0195R2: Support pack-expansion of using-declarations." 2016-12-19 10:09:25 +00:00
ASTWriterStmt.cpp [OpenMP] Sema and parsing for 'target teams' pragma 2016-12-17 05:48:59 +00:00
CMakeLists.txt Introduce module file extensions to piggy-back data onto module files. 2015-11-03 18:33:07 +00:00
GeneratePCH.cpp C++ Modules TS: add frontend support for building pcm files from module 2016-08-26 00:14:38 +00:00
GlobalModuleIndex.cpp Bitcode: Decouple block info block state from reader. 2016-11-08 04:17:11 +00:00
Module.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ModuleFileExtension.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
ModuleManager.cpp [VFS] Replace TimeValue usage with std::chrono 2016-11-09 10:52:22 +00:00
MultiOnDiskHashTable.h [NFC] Header cleanup 2016-07-18 19:02:11 +00:00