summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/FrontendActions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add -cc1 flag -ast-dump-all to perform an AST dump including entities that ↵Richard Smith2017-03-091-0/+1
| | | | | | haven't yet been deserialized. llvm-svn: 297412
* [GeneratePCHAction] If preprocessor option 'AllowPCHWithCompilerErrors' is ↵Argyrios Kyrtzidis2017-02-271-1/+7
| | | | | | enabled, don't delete the produced PCH file if error diagnostics occurred. llvm-svn: 296320
* [modules] For -module-file-info, print out the resource dir path, since it ↵Argyrios Kyrtzidis2017-02-251-0/+1
| | | | | | is included in the module hash. llvm-svn: 296261
* PCH: fix a regression that reports a module is defined in both pch and pcm.Manman Ren2017-01-091-0/+6
| | | | | | | | | | | | | | | | | In r276159, we started to say that a module X is defined in a pch if we specify -fmodule-name when building the pch. This caused a regression that reports module X is defined in both pch and pcm if we generate the pch with -fmodule-name=X and then in a separate clang invocation, we include the pch and also import X.pcm. This patch adds an option CompilingPCH similar to CompilingModule. When we use -fmodule-name=X while building a pch, modular headers in X will be textually included and the compiler knows that we are not building module X, so we don't put module X in SUBMODULE_DEFINITION of the pch. Differential Revision: http://reviews.llvm.org/D28415 llvm-svn: 291465
* Revert "[Modules] Make header inclusion order from umbrella dirs deterministic"Bruno Cardoso Lopes2016-12-121-11/+3
| | | | | | | | | | | Reverts commit r289478. This broke http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2070 (and maybe http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/2246) llvm-svn: 289494
* [Modules] Make header inclusion order from umbrella dirs deterministicBruno Cardoso Lopes2016-12-121-3/+11
| | | | | | | | | | | | | Sort the headers by name before adding the includes in collectModuleHeaderIncludes. This makes the include order for building umbrellas deterministic across different filesystems and also guarantees that the ASTWriter always dump top headers in the same order. There's currently no good way to test for this behavior. rdar://problem/28116411 llvm-svn: 289478
* C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith2016-08-261-31/+50
| | | | | | | interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. llvm-svn: 279794
* Refactor to remove the assumption that we know the name of the module we're ↵Richard Smith2016-08-251-2/+2
| | | | | | emitting at the point when we create a PCHGenerator (with the C++ modules TS, we find that out part way through parsing the input). llvm-svn: 279766
* Module: add -fprebuilt-module-path to support loading prebuilt modules.Manman Ren2016-08-181-1/+2
| | | | | | | | | | | | | In this mode, there is no need to load any module map and the programmer can simply use "@import" syntax to load the module directly from a prebuilt module path. When loading from prebuilt module path, we don't support rebuilding of the module files and we ignore compatible configuration mismatches. rdar://27290316 Differential Revision: http://reviews.llvm.org/D23125 llvm-svn: 279096
* Print the module format in clang -module-file-info.Adrian Prantl2016-08-171-2/+7
| | | | llvm-svn: 279005
* Support object-file-wrapped modules in clang -module-file-info.Adrian Prantl2016-08-171-0/+8
| | | | | | rdar://problem/24504815 llvm-svn: 279004
* Modules: add command line option fmodules-disable-diagnostic-validationManman Ren2016-07-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 llvm-svn: 276769
* [NFC] Header cleanupMehdi Amini2016-07-181-3/+2
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* Frontend: Simplify ownership model for clang's output streams.Peter Collingbourne2016-07-151-18/+25
| | | | | | | | | | | | | | This changes the CompilerInstance::createOutputFile function to return a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream implicitly owned by the CompilerInstance. This in most cases required that I move ownership of the output stream to the relevant ASTConsumer. The motivation for this change is to allow BackendConsumer to be a client of interfaces such as D20268 which take ownership of the output stream. Differential Revision: http://reviews.llvm.org/D21537 llvm-svn: 275507
* [PCH] Add a fno-pch-timestamp option to cc1 to disable inclusion of ↵Pierre Gousseau2016-07-131-1/+4
| | | | | | | | | | | | timestamps in PCH files. This is to allow distributed build systems, that do not preserve time stamps, to use PCH files. Second and last part of the patch proposed at: Differential Revision: http://reviews.llvm.org/D20867 llvm-svn: 275267
* RenderScript support in the FrontendPirama Arumuga Nainar2016-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Create a new Frontend LangOpt to specify the renderscript language. It is enabled by the "-x renderscript" option from the driver. Add a "kernel" function attribute only for RenderScript (an "ignored attribute" warning is generated otherwise). Make the NativeHalfType and NativeHalfArgsAndReturns LangOpts be implied by the RenderScript LangOpt. Reviewers: rsmith Subscribers: cfe-commits, srhines Differential Revision: http://reviews.llvm.org/D21198 llvm-svn: 272342
* [Modules] Use vfs for (recursive) directory iterationBruno Cardoso Lopes2016-05-161-6/+7
| | | | | | | | | | | | | | | | Clang performs directory walk while searching headers inside modules by using the ::sys::fs instead of ::vfs. This prevents any code that uses the VFS (e.g, reproducer scripts) to actually find such headers, since the VFS will never be searched for those. Change these places to use vfs::recursive_directory_iterator and vfs::directory_iterator instead. Differential Revision: http://reviews.llvm.org/D20266 rdar://problem/25880368 llvm-svn: 269661
* [Tooling] Fix broken dependency for shared buildEtienne Bergeron2016-05-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There virtual destructor can't be found and cause a compilation error on a shared build. To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Which produce this error: ``` tools/clang/unittests/Tooling/CMakeFiles/ToolingTests.dir/ToolingTest.cpp.o: In function `clang::tooling::newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test::TestBody()': ToolingTest.cpp:(.text._ZN5clang7tooling66newFrontendActionFactory_CreatesFrontendActionFactoryFromType_Test8TestBodyEv+0x49): undefined reference to `clang::SyntaxOnlyAction::~SyntaxOnlyAction()' ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20218 llvm-svn: 269334
* [modules] addHeaderInclude() can't fail.Davide Italiano2016-03-021-21/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D17794 llvm-svn: 262463
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-191-0/+2
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* Remove use of builtin comma operator.Richard Trieu2016-02-181-1/+2
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261271
* [modules] Make sure we always include the contents of private headers whenRichard Smith2016-01-081-9/+11
| | | | | | | | | | building a module. Prior to this change, the private header's content would only be included if the header were included by another header in the same module. If not (if the private header is only used by the .cc files of the module, or is included from outside the module via -Wno-private-header), a #include of that file would be silently ignored. llvm-svn: 257222
* [modules] Refactor handling of -fmodules-embed-*. Track this properly ratherRichard Smith2015-11-261-10/+11
| | | | | | | than reusing the "overridden buffer" mechanism. This will allow us to make embedded files and overridden files behave differently in future. llvm-svn: 254121
* [modules] Add -cc1 flag -fmodules-embed-all-files.Richard Smith2015-11-241-0/+2
| | | | | | | | | | | | | | This flag causes all files that were read by the compilation to be embedded into a produced module file. This is useful for distributed build systems that use an include scanning system to determine which files are "needed" by a compilation, and only provide those files to remote compilation workers. Since using a module can require any file that is part of that module (or anything it transitively includes), files that are not found by an include scanner can be required in a regular build using explicit modules. With this flag, only files that are actually referenced by transitively-#included files are required to be present on the build machine. llvm-svn: 253950
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-031-5/+25
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
* Further simplify the interface of PCHContainerGeneratorAdrian Prantl2015-09-191-2/+2
| | | | | | | | by dropping the const qualifier on the CI. NFC llvm-svn: 248101
* Simplify the interface of PCHContainerGenerator and friendsAdrian Prantl2015-09-181-10/+4
| | | | | | | | by passing in a CompilerInstance instead of all its individual members. NFC. llvm-svn: 248053
* [modules] When explicitly building a module file, don't include timestamps inRichard Smith2015-08-171-1/+3
| | | | | | | the produced pcm file for stable file creation across distributed build systems. llvm-svn: 245199
* [modules] Add an experimental -cc1 feature to embed the contents of an inputRichard Smith2015-08-141-2/+11
| | | | | | | | | | | file in the .pcm files. This allows a smaller set of files to be sent to a remote build worker when building with explicit modules (for instance, module map files need not be sent along with the corresponding precompiled modules). This doesn't actually make the embedded files visible to header search, so it's not useful as a packaging format for public header files. llvm-svn: 245028
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-171-4/+4
| | | | | | | | | | | | | - 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
* [Modules] Consider -fmodule-feature in module hash and when loadingBen Langmuir2015-06-231-0/+7
| | | | | | | Any extra features from -fmodule-feature are part of the module hash and need to get validated on load. Also print them with -module-file-info. llvm-svn: 240433
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Introduce a PCHContainerOperations interface (NFC).Adrian Prantl2015-06-201-20/+39
| | | | | | | | | | | | | | | | 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
* [modules] Retain the name as written for umbrella headers and directories, ↵Richard Smith2015-05-161-30/+22
| | | | | | 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
* Use raw_pwrite_stream in clang.Rafael Espindola2015-04-141-6/+1
| | | | | | This is a small improvement to -emit-pth and allows llvm to start requiring it. llvm-svn: 234897
* Bring r234620 back now that llvm is fixed.Rafael Espindola2015-04-131-6/+5
| | | | | | | | | | LLVM can now detect if a fd is seekable on windows. Original commit message: Actually check if lseek works instead of using a filename based heuristic. llvm-svn: 234738
* Reformat.NAKAMURA Takumi2015-04-131-3/+3
| | | | llvm-svn: 234731
* Revert r234620 and others, "Actually check if lseek works instead of using a ↵NAKAMURA Takumi2015-04-131-6/+6
| | | | | | | | | | filename based heuristic." It was affected by r234615, which was reverted in r234721. r234620, "Actually check if lseek works instead of using a filename based heuristic." r234621, "Testcase for the previous commit." r234718, "Suppress clang/test/PCH/emit-pth.c on win32, for now while investigating." llvm-svn: 234730
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-3/+2
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* Actually check if lseek works instead of using a filename based heuristic.Rafael Espindola2015-04-101-6/+6
| | | | llvm-svn: 234620
* Return a pointer instead of having a pointer outparam and a bool return.Rafael Espindola2015-04-101-15/+15
| | | | llvm-svn: 234592
* Return a pointer instead of having a pointer outparam and a bool return.Rafael Espindola2015-04-101-13/+13
| | | | llvm-svn: 234590
* Ensure that we still parse preprocessed CUDA files as CUDA when we useArtem Belevich2015-03-191-0/+1
| | | | | | | | | -save-temps option. Summary: Fixes PR22926. Review: http://reviews.llvm.org/D8383 llvm-svn: 232737
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-1/+1
| | | | | | | | | | | | | | | 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
* [modules] Teach the AST reader to handle the case of importing a moduleChandler Carruth2015-03-141-2/+2
| | | | | | | | | | | | | | | | | | | with a subset of the existing target CPU features or mismatched CPU names. While we can't check that the CPU name used to build the module will end up being able to codegen correctly for the translation unit, we actually check that the imported features are a subset of the existing features. While here, rewrite the code to use std::set_difference and have it diagnose all of the differences found. Test case added which walks the set relationships and ensures we diagnose all the right cases and accept the others. No functional change for implicit modules here, just better diagnostics. llvm-svn: 232248
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-36/+4
| | | | llvm-svn: 230454
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-4/+36
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 llvm-svn: 230423
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-36/+4
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. llvm-svn: 230309
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-4/+36
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. Take 3. llvm-svn: 230305
OpenPOWER on IntegriCloud