summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PrecompiledPreamble.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Preamble] Check system dependencies in preamble tooIlya Biryukov2018-07-091-1/+11
| | | | | | | | | | | | | | | | | | | | | | Summary: PrecompiledPreamble hasn't checked if the system dependencies changed before. This resulted in invalid preamble not being rebuilt if headers that changed were found in -isystem include paths. This pattern is sometimes used to avoid showing warnings in third party code, so we want to correctly handle those cases. Tested in clangd, see the follow-up patch. Reviewers: sammccall, ioeric Reviewed By: sammccall Subscribers: omtcyfz, cfe-commits Differential Revision: https://reviews.llvm.org/D48946 llvm-svn: 336528
* s/LLVM_ON_WIN32/_WIN32/, clangNico Weber2018-04-271-1/+1
| | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. llvm-svn: 331069
* [vfs] Don't bail out after a missing -ivfsoverlay fileBen Langmuir2018-03-231-4/+0
| | | | | | | | | | | | | This make -ivfsoverlay behave more like other fatal errors (e.g. missing -include file) by skipping the missing file instead of bailing out of the whole compilation. This makes it possible for libclang to still provide some functionallity as well as to correctly produce the fatal error diagnostic (previously we lost the diagnostic in libclang since there was no TU to tie it to). rdar://33385423 llvm-svn: 328337
* [Frontend] Allow to use PrecompiledPreamble without calling CanReuseIlya Biryukov2018-01-181-13/+29
| | | | | | | | | | | | | | | | | | | Summary: The new method 'OverridePreamble' allows to override the preamble of any source file without checking if preamble bounds or dependencies were changed. This is used for completion in clangd. Reviewers: bkramer, sammccall Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41990 llvm-svn: 322853
* Added helper to get size of PrecompiledPreambleIlya Biryukov2017-12-211-3/+24
| | | | llvm-svn: 321266
* [clang] Add BeforeExecute method to PrecompiledPreambleIlya Biryukov2017-12-201-0/+2
| | | | | | | | | | | | | | | | | Summary: Adds BeforeExecute method to PrecompiledPreamble to be called before Execute(). This method can be overriden. Patch by William Enright. Reviewers: malaperle, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: arphaman, cfe-commits, ilya-biryukov Differential Revision: https://reviews.llvm.org/D41365 llvm-svn: 321189
* [clang] Add PPCallbacks list to preprocessor when building a preacompiled ↵Ilya Biryukov2017-12-151-17/+8
| | | | | | | | | | | | | | | | | | | | preamble. Summary: Revision D38639 needs this commit in order to properly make open definition calls on include statements work. Patch by William Enright. Reviewers: malaperle, krasimir, bkramer, ilya-biryukov Reviewed By: malaperle, ilya-biryukov Subscribers: cfe-commits, arphaman, ilya-biryukov Differential Revision: https://reviews.llvm.org/D39375 llvm-svn: 320804
* Avoid copying the data of in-memory preamblesIlya Biryukov2017-11-241-3/+1
| | | | | | | | | | | | | | Summary: Preambles are large and we should avoid copying them. Reviewers: bkramer, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40302 llvm-svn: 318945
* Use llvm-config.h instead of config.hIlya Biryukov2017-11-171-1/+1
| | | | | | To fix standalone builds broken by r318411 (config.h is private to llvm). llvm-svn: 318514
* Allow to store precompiled preambles in memory.Ilya Biryukov2017-11-161-30/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These preambles are built by ASTUnit and clangd. Previously, preambles were always stored on disk. In-memory preambles are routed back to the compiler as virtual files in a custom VFS. Interface of ASTUnit does not allow to use in-memory preambles, as ASTUnit::CodeComplete receives FileManager as a parameter, so we can't change VFS used by the compiler inside the CodeComplete method. A follow-up commit will update clangd in clang-tools-extra to use in-memory preambles. Reviewers: klimek, sammccall, bkramer Reviewed By: klimek Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D39842 llvm-svn: 318411
* Create fewer copies of StringMaps. No functionality change intended.Benjamin Kramer2017-10-221-1/+1
| | | | llvm-svn: 316301
* Set PreprocessorOpts.GeneratePreamble=true in PrecompiledPreamble.Ilya Biryukov2017-10-091-0/+2
| | | | | | | | | | | | | | | | Summary: It was previsouly set only in ASTUnit, but it should be set for all client of PrecompiledPreamble. Reviewers: erikjv, bkramer, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38617 llvm-svn: 315212
* [PCH] Fixed preamble breaking with BOM presence (and particularly, ↵Cameron Desrochers2017-09-201-2/+1
| | | | | | | | | | | | | | fluctuating BOM presence) This patch fixes broken preamble-skipping when the preamble region includes a byte order mark (BOM). Previously, parsing would fail if preamble PCH generation was enabled and a BOM was present. This also fixes preamble invalidation when a BOM appears or disappears. This may seem to be an obscure edge case, but it happens regularly with IDEs that pass buffer overrides that never (or always) have a BOM, yet the underlying file from the initial parse that generated a PCH might (or might not) have a BOM. I've included a test case for these scenarios. Differential Revision: https://reviews.llvm.org/D37491 llvm-svn: 313796
* Fixed a race condition in PrecompiledPreamble.Ilya Biryukov2017-08-101-1/+9
| | | | | | | | | | | | | | | | Summary: Two PrecompiledPreambles, used in parallel on separate threads, could be writing preamble to the same temporary file. Reviewers: bkramer, krasimir, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36529 llvm-svn: 310618
* Fix unused-variable compilation error.Haojian Wu2017-06-211-0/+2
| | | | llvm-svn: 305898
* Moved code hanlding precompiled preamble out of the ASTUnit.Ilya Biryukov2017-06-211-0/+561
Reviewers: bkramer, krasimir, arphaman, akyrtzi, klimek Reviewed By: klimek Subscribers: mgorny, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34287 llvm-svn: 305890
OpenPOWER on IntegriCloud