summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* If a module build reports errors, don't try to load itBen Langmuir2014-07-191-13/+21
| | | | | | ... just to find out that it didn't build. llvm-svn: 213454
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-2/+2
| | | | | | | | | This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-2/+2
| | | | | | | | | (after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) llvm-svn: 213307
* Peel away old-style file remapping typedefs and cruftAlp Toker2014-07-071-17/+10
| | | | llvm-svn: 212438
* Fix layering of file remapping and header search initializationAlp Toker2014-07-071-1/+67
| | | | | | | | These two functions initialize the source manager and header search objects and shouldn't be in InitPreprocessor which is concerned with priming the preprocessor itself and predefining macros. llvm-svn: 212434
* Update for llvm api change.Rafael Espindola2014-07-061-3/+6
| | | | llvm-svn: 212408
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-061-1/+2
| | | | llvm-svn: 212388
* Constify a read-only parameter and give function a better nameAlp Toker2014-07-061-1/+1
| | | | | | | This makes it clear that TargetInfo doesn't capture the LangOptions object, rather uses it to apply adjustments. llvm-svn: 212386
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-051-1/+1
| | | | llvm-svn: 212369
* Consider module depedencies when checking a preamble in libclangBen Langmuir2014-06-301-0/+6
| | | | | | | | | | | | | Add module dependencies (header files, module map files) to the list of files to check when deciding whether to rebuild a preamble. That fixes using preambles with module imports so long as they are in non-overridden files. My intent is to use to unify the existing dependency collectors to the new “DependencyCollectory” interface from this commit, starting with the DependencyFileGenerator. llvm-svn: 212060
* Remove 'const' from MemoryBuffers used through the SourceManagerDavid Blaikie2014-06-271-1/+1
| | | | | | | | | | | | | | This removes a const_cast added in r211884 that occurred due to an inconsistency in how MemoryBuffers are handled between some parts of clang and LLVM. MemoryBuffers are immutable and the general convention in the LLVM project is to omit const from immutable types as it's simply redundant/verbose (see llvm::Type, for example). While this change doesn't remove "const" from /every/ MemoryBuffer, it at least makes this chain of ownership/usage consistent. llvm-svn: 211915
* Frontend: Add a CC1 flag to dump module dependencies to a directoryJustin Bogner2014-06-191-0/+22
| | | | | | | | | | | | | | | | | | This adds the -module-dependency-dir to clang -cc1, which specifies a directory to copy all of a module's dependencies into in a form suitable to be used as a VFS using -ivfsoverlay with the generated vfs.yaml. This is useful for crashdumps that involve modules, so that the module dependencies will be intact when a crash report script is used to reproduce a problem on another machine. We currently encode the absolute path to the dump directory, due to limitations in the VFS system. Until we can handle relative paths in the VFS, users of the VFS map may need to run a simple search and replace in the file. llvm-svn: 211303
* Retry building modules that were compiled by other instances and are out-of-dateBen Langmuir2014-06-171-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When another clang instance builds a module, it may still be considered "out of date" for the current instance in a couple of cases*. This patch prevents us from giving spurious errors when compilers race to build a module by allowing the module load to fail when the pcm was built by a different compiler instance. * Cases where a module can be out of date despite just having been built: 1) There are different -I paths between invocations that result in finding a different module map file for some dependent module. This is not an error, and should never be diagnosed. <rdar://problem/16843887> 2) There are file system races where the headers making up a module are touched or moved. Although this can sometimes mean trouble, diagnosing it only during a build-race is worse than useless and we cannot detect this in general. It is more robust to just rebuild. This was causing spurious issues in some setups where only the modtime of headers was bumped during a build. <rdar://problem/16157638> llvm-svn: 211129
* Update for llvm api change.Rafael Espindola2014-06-131-1/+2
| | | | llvm-svn: 210921
* Include system_error directly.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210802
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-5/+5
| | | | llvm-svn: 210780
* Use std::error_code instead of llvm::error_code.Rafael Espindola2014-06-111-1/+1
| | | | | | This is an update for a llvm api change. llvm-svn: 210688
* Revert "Revert "Devise a package-private means to determine the LLVM version ↵Alp Toker2014-06-061-3/+2
| | | | | | | | | | | string"" We probably just need to touch LLVM's configure this time to work around the totally inadequate Makefile build server integration. This reverts commit r210314. llvm-svn: 210320
* Revert "Devise a package-private means to determine the LLVM version string"Alp Toker2014-06-061-2/+3
| | | | | | | | This didn't work out on the build servers. Investigating This reverts commit r210313. llvm-svn: 210314
* Devise a package-private means to determine the LLVM version stringAlp Toker2014-06-061-3/+2
| | | | | | | | | | This will unbreak clang vendor builds as a follow-up to r210238, now that we can't poke into LLVM's private config.h (nor should the string be exposed by llvm-config.h). This hopefully removes for good the last include of LLVM's config.h. llvm-svn: 210313
* Remove the last remaining llvm/Config/config.h includesAlp Toker2014-06-041-1/+2
| | | | | | | | | | | | This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. llvm-svn: 210145
* Fix leak from r210059Alp Toker2014-06-031-0/+6
| | | | | | | Also revert r210096 which temporarily disabled the test while this was being investigated. llvm-svn: 210115
* [C++11] Use 'nullptr'. Frontend edition.Craig Topper2014-05-221-17/+17
| | | | llvm-svn: 209389
* SourceManager: Use setMainFileID() consistentlyAlp Toker2014-05-211-3/+5
| | | | | | | | | | | Eliminate createMainFileID() / createMainFileIDForMemBuffer() utility functions. These didn't add much convenience and conflated two distinct operations. This change makes things easier to follow by providing a consistent interface and getting rid of a bunch of cast-to-voids. llvm-svn: 209266
* Switch Wmodule-build to a remarkBen Langmuir2014-05-081-1/+1
| | | | | | | | | On reflection, this is better despite the missing command-line handling bits for remarks. Making this a remark makes it much clearer that this is purely informational and avoids the negative connotations of a 'warning'. llvm-svn: 208367
* Let ASTReader optionally delete its ASTDeserializationListener.Nico Weber2014-05-081-22/+15
| | | | | | | | | | | | | | | | | | | | Use this to fix the leak of DeserializedDeclsDumper and DeserializedDeclsChecker in FrontendAction (found by LSan), PR19560. The "delete this" bool is necessary because both PCHGenerator and ASTUnit return the same object from both getDeserializationListener() and getASTMutationListener(), so ASTReader can't just have a unique_ptr. It's also not possible to just let FrontendAction (or CompilerInstance) own these listeners due to lifetime issues (see comments on PR19560). Finally, ASTDeserializationListener can't easily be refcounted, since several of the current listeners are allocated on the stack. Having this bool isn't ideal, but it's a pattern that's used in other places in the codebase too, and it seems better than leaking. llvm-svn: 208277
* Add -Wmodule-build to make it easy to see when modules are (re)builtBen Langmuir2014-05-051-0/+3
| | | | | | Warning is default ignore, and not in -Wall. llvm-svn: 207975
* Make module self-import an errorBen Langmuir2014-05-051-1/+1
| | | | | | | | Ideally, importing Foo.a from Foo.b would "do the right thing", but until it does, this patch makes it an error rather than allow it to silently be ignored. llvm-svn: 207948
* Eliminate ASTContext's DelayInitialization flagAlp Toker2014-05-031-3/+3
| | | | | | | | | Having various possible states of initialization following construction doesn't add value here. Also remove the unused size_reserve parameter. llvm-svn: 207897
* Reformat code following Preprocessor constructor updatesAlp Toker2014-05-021-4/+2
| | | | | | Landing this separately to make the previous commits easy to follow at home. llvm-svn: 207826
* Factor TargetInfo pointer/DelayInitialization bool pair out of Preprocessor ctorAlp Toker2014-05-021-2/+2
| | | | | | | | The Preprocessor::Initialize() function already offers a clear interface to achieve this, further reducing the confusing number of states a newly constructed preprocessor can have. llvm-svn: 207825
* Remove unused IncrProcessing parameter from Preprocessor ctorAlp Toker2014-05-021-1/+0
| | | | | | | Preprocessor::enableIncrementalProcessing() provides a consistent interface to enable the feature. llvm-svn: 207824
* [cleanup] Fix an 80-column violationJustin Bogner2014-04-281-1/+2
| | | | llvm-svn: 207446
* Quick fix for layering that broke shared library build.John Thompson2014-04-231-0/+26
| | | | llvm-svn: 207011
* Fix unused variable.John Thompson2014-04-231-1/+1
| | | | llvm-svn: 206981
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-38/+101
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Allow multiple modules with the same name to coexist in the module cacheBen Langmuir2014-04-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To differentiate between two modules with the same name, we will consider the path the module map file that they are defined by* part of the ‘key’ for looking up the precompiled module (pcm file). Specifically, this patch renames the precompiled module (pcm) files from cache-path/<module hash>/Foo.pcm to cache-path/<module hash>/Foo-<hash of module map path>.pcm In addition, I’ve taught the ASTReader to re-resolve the names of imported modules during module loading so that if the header search context changes between when a module was originally built and when it is loaded we can rebuild it if necessary. For example, if module A imports module B first time: clang -I /path/to/A -I /path/to/B ... second time: clang -I /path/to/A -I /different/path/to/B ... will now rebuild A as expected. * in the case of inferred modules, we use the module map file that allowed the inference, not the __inferred_module.map file, since the inferred file path is the same for every inferred module. llvm-svn: 206201
* [Frontend] If the module file lock owner have died, try to get the lock ↵Argyrios Kyrtzidis2014-04-061-22/+33
| | | | | | again. Needs llvm r205683. llvm-svn: 205684
* Add an option -fmodules-validate-system-headersBen Langmuir2014-03-121-3/+6
| | | | | | | | When enabled, always validate the system headers when loading a module. The end result of this is that when these headers change, we will notice and rebuild the module. llvm-svn: 203630
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-4/+4
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-6/+5
| | | | | | This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
* [Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is ↵Argyrios Kyrtzidis2014-03-071-2/+5
| | | | | | | | | | TU_Prefix avoid warning for unused macros. rdar://15034698 llvm-svn: 203213
* Add dependencies from imported modules with -MDBen Langmuir2014-03-071-1/+5
| | | | | | | | Add module dependencies to the dependency files created by -MD/-MMD/etc. by attaching an ASTReaderListener that will call into the dependency file generator when a module input file is seen in the serialized AST. llvm-svn: 203208
* [C++11] Simplify a callback to use a lambda.Richard Smith2014-03-041-18/+2
| | | | llvm-svn: 202897
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-011-21/+7
| | | | | | No functionality change. llvm-svn: 202590
* Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-281-1/+1
| | | | | | | | | | | | | | | | Was r202442 There were two issues with the original patch that have now been fixed. 1. We were memset'ing over a FileEntry in a test case. After adding a std::string to FileEntry, this still happened to not break for me. 2. I didn't pass the FileManager into the new compiler instance in compileModule. This was hidden in some cases by the fact I didn't clear the module cache in the test. Also, I changed the copy constructor for FileEntry, which was memcpy'ing in a (now) unsafe way. llvm-svn: 202539
* [ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis2014-02-271-7/+12
| | | | | | | | | | | | | | | ASTUnit::getMainBufferWithPrecompiledPreamble(). With r197755 we started reading the contents of buffer file entries, but the buffers may point to ASTReader blobs that have been disposed. Fix this by having the CompilerInstance object keep a reference to the ASTReader as well as having the ASTContext keep reference to the ExternalASTSource. This was very difficult to construct a test case for. rdar://16149782 llvm-svn: 202346
* Update for llvm api change.Rafael Espindola2014-02-241-6/+6
| | | | llvm-svn: 202053
* Recommit virtual file systemBen Langmuir2014-02-201-1/+11
| | | | | | | | | | | Previously reverted in r201755 due to causing an assertion failure. I've removed the offending assertion, and taught the CompilerInstance to create a default virtual file system inside createFileManager. In the future, we should be able to reach into the CompilerInvocation to customize this behaviour without breaking clients that don't care. llvm-svn: 201818
* Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka2014-02-201-8/+1
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
OpenPOWER on IntegriCloud