summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorErik Verbruggen <erikjv@me.com>2017-02-16 09:49:30 +0000
committerErik Verbruggen <erikjv@me.com>2017-02-16 09:49:30 +0000
commit2c7c38d9bb804a534787d05a915aae712567814a (patch)
tree11fd3f94b52d798f11a1c64bfd9245aff513b9f5 /llvm/lib
parent21c3d8e0fc2d413daefbbb71c3fe13659e612b37 (diff)
downloadbcm5719-llvm-2c7c38d9bb804a534787d05a915aae712567814a.tar.gz
bcm5719-llvm-2c7c38d9bb804a534787d05a915aae712567814a.zip
Cache FileID when translating diagnostics in PCH files
Modules/preambles/PCH files can contain diagnostics, which, when used, are added to the current ASTUnit. For that to work, they are translated to use the current FileManager's FileIDs. When the entry is not the main file, all local source locations will be checked by a linear search. Now this is a problem, when there are lots of diagnostics (say, 25000) and lots of local source locations (say, 440000), and end up taking seconds when using such a preamble. The fix is to cache the last FileID, because many subsequent diagnostics refer to the same file. This reduces the time spent in ASTUnit::TranslateStoredDiagnostics from seconds to a few milliseconds for files with many slocs/diagnostics. This fixes PR31353. Differential Revision: https://reviews.llvm.org/D29755 llvm-svn: 295301
Diffstat (limited to 'llvm/lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud