summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] When explicitly building a module file, don't include timestamps inRichard Smith2015-08-171-0/+1
| | | | | | | the produced pcm file for stable file creation across distributed build systems. llvm-svn: 245199
* [modules] Stop dropping 'module.timestamp' files into the current directoryRichard Smith2015-08-151-3/+6
| | | | | | when building with implicit modules disabled. llvm-svn: 245136
* Add sanitizer blacklists to the rules generated with -M/-MM/-MD/-MMD.Ivan Krasin2015-08-131-3/+5
| | | | | | | | | | | | | | | | | | | Summary: Clang sanitizers, such as AddressSanitizer, ThreadSanitizer, MemorySanitizer, Control Flow Integrity and others, use blacklists to specify which types / functions should not be instrumented to avoid false positives or suppress known failures. This change adds the blacklist filenames to the list of dependencies of the rules, generated with -M/-MM/-MD/-MMD. This lets CMake/Ninja recognize that certain C/C++/ObjC files need to be recompiled (if a blacklist is updated). Reviewers: pcc Subscribers: rsmith, honggyu.kim, pcc, cfe-commits Differential Revision: http://reviews.llvm.org/D11968 llvm-svn: 244867
* Fix some tabs.Richard Smith2015-08-111-4/+3
| | | | llvm-svn: 244537
* [modules] Remove now-dead code for lazy loading of files specified by ↵Richard Smith2015-08-091-17/+3
| | | | | | -fmodule-file=. llvm-svn: 244417
* [modules] PR22534: Load files specified by -fmodule-file= eagerly. In ↵Richard Smith2015-08-091-69/+30
| | | | | | particular, this avoids the need to re-parse module map files when using such a module. llvm-svn: 244416
* Unrevert r244412 (reverted in r244414), and delete the bogus line left behindRichard Smith2015-08-091-1/+3
| | | | | | in the unit test that was checking a file the test no longer creates. llvm-svn: 244415
* Revert "[modules] Don't leak -M flags for dependency file generation into ↵Justin Bogner2015-08-091-3/+1
| | | | | | | | | | | | | | | the module" This was failing tests on a bunch of bots: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/29919/steps/check-all http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/29627/steps/check-all http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_check/9959/ http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/5591/ This reverts r244412 llvm-svn: 244414
* [modules] Don't leak -M flags for dependency file generation into the moduleRichard Smith2015-08-091-1/+3
| | | | | | | | | | build process when we implicitly build a module. Previously, we'd create the specified .d file once for each implicitly-built module and then finally overwrite it with the correct contents after the requested build completes. (This fails if you use stdout as a dependency file, which is what the provided testcase does, and is how I discovered this brokenness.) llvm-svn: 244412
* [modules] Attach dependency listeners to the module manager once when it'sRichard Smith2015-08-091-9/+7
| | | | | | | | created, rather than creating and attaching a new listener each time we load a module file (yes, the old ones were kept around too!). No functionality change intended, but a bit more sanity. llvm-svn: 244411
* [modules] Produce an error if -cc1 wants to implicitly build a module and noRichard Smith2015-07-211-8/+7
| | | | | | | module cache has been provided, rather than creating one in the current directory. llvm-svn: 242819
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-8/+8
| | | | | | | | | | | | | - introduces a new cc1 option -fmodule-format=[raw,obj] with 'raw' being the default - supports arbitrary module container formats that libclang is agnostic to - adds the format to the module hash to avoid collisions - splits the old PCHContainerOperations into PCHContainerWriter and a PCHContainerReader. Thanks to Richard Smith for reviewing this patch! llvm-svn: 242499
* Extend -ftime-report to give more information about time spent reading ↵Richard Smith2015-07-141-2/+19
| | | | | | module files. llvm-svn: 242094
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-061-3/+3
| | | | | | | | and std::move to avoid implicit std::string construction. Patch by Eugene Kosov. llvm-svn: 241433
* Revert r241330. It compiled with Visual C++ 2013 and gcc 4.9.1 (mingw) but ↵Yaron Keren2015-07-031-3/+3
| | | | | | now fails the bots. llvm-svn: 241335
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-031-3/+3
| | | | | | | | and std::move to avoid implicit std::string construction. Patch by Eugene Kosov. llvm-svn: 241330
* Revert r241319, investigating.Yaron Keren2015-07-031-3/+3
| | | | llvm-svn: 241321
* Replace some const std::string & with llvm::StringRef or std::stringYaron Keren2015-07-031-3/+3
| | | | | | | | | | and std::move to avoid implicit std::string construction. Part 1/2. Patch by Eugene Kosov. llvm-svn: 241319
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-201-25/+31
| | | | | | | | | | | | | | | | A PCHContainerOperations abstract interface provides operations for creating and unwrapping containers for serialized ASTs (precompiled headers and clang modules). The default implementation is RawPCHContainerOperations, which uses a flat file for the output. The main application for this interface will be an ObjectFilePCHContainerOperations implementation that uses LLVM to wrap the module in an ELF/Mach-O/COFF container to store debug info alongside the AST. rdar://problem/20091852 llvm-svn: 240225
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-3/+2
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [modules] Move implicit creation of ImportDecls for #includes transformed ↵Richard Smith2015-05-181-19/+0
| | | | | | into module imports from the frontend into Sema where it belongs. llvm-svn: 237555
* [modules] Retain the name as written for umbrella headers and directories, ↵Richard Smith2015-05-161-3/+5
| | | | | | rather than converting to an absolute path. No observable change expected, but this allows us to correctly compute the module for an umbrella header, which later changes will require. llvm-svn: 237508
* [modules] Add local submodule visibility support for declarations.Richard Smith2015-05-151-0/+5
| | | | | | | | | | | | With this change, enabling -fmodules-local-submodule-visibility results in name visibility rules being applied to submodules of the current module in addition to imported modules (that is, names no longer "leak" between submodules of the same top-level module). This also makes it much safer to textually include a non-modular library into a module: each submodule that textually includes that library will get its own "copy" of that library, and so the library becomes visible no matter which including submodule you import. llvm-svn: 237473
* [modules] Start moving the module visibility information off the Module itself.Richard Smith2015-05-011-6/+4
| | | | | | | It has no place there; it's not a property of the Module, and it makes restoring the visibility set when we leave a submodule more difficult. llvm-svn: 236300
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-63/+35
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* Use raw_pwrite_stream in clang.Rafael Espindola2015-04-141-13/+17
| | | | | | This is a small improvement to -emit-pth and allows llvm to start requiring it. llvm-svn: 234897
* [Frontend] Close open file handles before renaming output filesReid Kleckner2015-04-101-10/+12
| | | | | | | | | | | | The placement of the 'delete' call that was removed in the unique_ptr migration in r234597 was not an accident. The raw_ostream has to be destroyed before you do the rename on Windows, otherwise you get ERROR_ACCESS_DENIED. We can still use unique_ptr, we just need to do a manual reset(). Also, range-for-loop-ify this code. llvm-svn: 234612
* Return std::unique_ptr to avoid a release and recreate.Rafael Espindola2015-04-101-4/+4
| | | | llvm-svn: 234598
* Use a std::unique_ptr to make it easier to see who owns the stream.Rafael Espindola2015-04-101-10/+11
| | | | llvm-svn: 234597
* [Modules] Don't compute a modules cache path if we're not using modules!Chandler Carruth2015-03-281-1/+2
| | | | | | | | | Notably, this prevents us from doing *tons* of work to compute the modules hash, including trying to read a darwin specific plist file off of the system. There is a lot that needs cleaning up below this layer too. llvm-svn: 233462
* [Modules] Stop creating timestamps for the modules cache and trying toChandler Carruth2015-03-241-3/+4
| | | | | | | | | | | | | prune it when we have disabled implicit module generation and thus are not using any cached modules. Also update a test of explicitly generated modules to pass this CC1 flag correctly. This fixes an issue where Clang was dropping files into the source tree while running its tests. llvm-svn: 233117
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-5/+4
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* Make module files passed to a module build via -fmodule-file= available toRichard Smith2015-03-181-0/+13
| | | | | | | | | consumers of that module. Previously, such a file would only be available if the module happened to actually import something from that module. llvm-svn: 232583
* Give better diagnostics when -fmodule-file= finds a bad file: if the file isRichard Smith2015-02-281-3/+13
| | | | | | | found indirectly, explain how we got there, and distinguish between 'file not found' and 'file found but invalid'. llvm-svn: 230839
* [modules] Even if we already have a definition of a class, loading in anotherRichard Smith2015-02-251-1/+4
| | | | | | | | one can give us more lookup results (due to implicit special members). Be sure to complete the redecl chain for every kind of DeclContext before performing a lookup into it, rather than only doing so for NamespaceDecls. llvm-svn: 230558
* [modules] Fix a bug that would result in a build with P paths through a moduleRichard Smith2015-02-251-0/+3
| | | | | | | graph with M modules to take O(P) time, not just O(M) time, when using explicit module builds. llvm-svn: 230412
* Add -fno-implicit-modules.Manuel Klimek2015-02-201-0/+6
| | | | | | | If this flag is set, we error out when a module build is required. This is useful in environments where all required modules are passed via -fmodule-file. llvm-svn: 230006
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-191-8/+12
| | | | | | | | | | | | with, is the same as the one in the current compiler invocation. If they differ reject the PCH. This protects against the badness occurring from getting modules loaded from different module caches (see crashes). rdar://19889860 llvm-svn: 229909
* Diagnose timeouts in the LockFileManager and delete the dead lock fileBen Langmuir2015-02-091-2/+12
| | | | | | | | | | | | If the lock file manager times out, we should give an error rather than silently trying to load the existing module. And delete the (presumably) dead lock file, since it will otherwise prevent progress in future invokations. This is unsound since we have no way to prove that the lock file we are deleting is the same one we timed out on, but since the lock is only to avoid excessive rebuilding anyway it should be okay. Depends on llvm r228603. llvm-svn: 228604
* [modules] When using -E, we may try to merge decls despite having no SemaRichard Smith2015-02-041-14/+13
| | | | | | | | | | | object. In such a case, use the TU's DC for merging global decls rather than giving up when we find there is no TU scope. Ultimately, we should probably avoid all loading of decls when preprocessing, but there are other reasonable use cases for loading an AST file with no Sema object for which this is the right thing. llvm-svn: 228234
* PR22299: Relocate code for handling -fmodule-map-file= so that we don't try toRichard Smith2015-01-231-8/+0
| | | | | | | produce diagnostics with source locations before the diagnostics system is ready for them. llvm-svn: 226882
* [modules] If the same .pcm file is imported via two different paths, don'tRichard Smith2014-12-091-1/+3
| | | | | | complain that the contained modules are defined twice. llvm-svn: 223724
* PR21217: Slightly more eagerly load -fmodule-map-file= files and provideRichard Smith2014-12-061-0/+8
| | | | | | diagnostics if they don't exist. Based on a patch by John Thompson! llvm-svn: 223561
* [modules] Track how 'header' directives were written in module map files,Richard Smith2014-12-021-2/+9
| | | | | | | | | | | | | rather than trying to extract this information from the FileEntry after the fact. This has a number of beneficial effects. For instance, diagnostic messages for failed module builds give a path relative to the "module root" rather than an absolute file path, and the contents of the module includes file is no longer dependent on what files the including TU happened to inspect prior to triggering the module build. llvm-svn: 223095
* Make DiagnosticsEngine::takeClient return std::unique_ptr<>Alexander Kornienko2014-11-171-5/+3
| | | | | | | | | | | | | | | | | | Summary: Make DiagnosticsEngine::takeClient return std::unique_ptr<>. Updated callers to store conditional ownership using a pair of pointer and unique_ptr instead of a pointer + bool. Updated code that temporarily registers clients to use the non-owning registration (+ removed extra calls to takeClient). Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6294 llvm-svn: 222193
* A small correction for r221884. No functional changes.Alexander Kornienko2014-11-171-1/+1
| | | | llvm-svn: 222130
* Support non-owned DiagnosticConsumer in SetupSerializedDiagnosticsAlexander Kornienko2014-11-131-4/+8
| | | | | | | | | | This fixes an assertion when running clang-tidy on a file having --serialize-diagnostics in compiler options. Committing a regression test for clang-tidy separately. Patch by Aaron Wishnick! llvm-svn: 221884
* [modules] Load .pcm files specified by -fmodule-file lazily.Richard Smith2014-10-271-44/+67
| | | | llvm-svn: 220731
* Make VFS and FileManager match the current MemoryBuffer API.Benjamin Kramer2014-10-261-6/+6
| | | | | | | This eliminates converting back and forth between the 3 formats and gives us a more homogeneous interface. llvm-svn: 220657
* Driver: Include driver diagnostics when we --serialize-diagnosticsJustin Bogner2014-10-231-11/+1
| | | | | | | | | | | | | | | Currently, when --serialize-diagnostics is passed this only includes the diagnostics from clang -cc1, and driver diagnostics are dropped. This causes issues for tools that use the serialized diagnostics, since stderr is lost and these diagnostics aren't seen at all. We handle this by merging the diagnostics from the CC1 process and the driver diagnostics into a single file when the driver invokes CC1. Fixes rdar://problem/10585062 llvm-svn: 220525
OpenPOWER on IntegriCloud