summaryrefslogtreecommitdiff
path: root/lib/FrontendTool
Commit message (Collapse)AuthorAgeFilesLines
* [modules] Frontend support for building a header module from a list ofRichard Smith2018-09-151-0/+2
| | | | | | headaer files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342304 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-301-2/+2
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new driver mode to dump compiler feature and extension options.Aaron Ballman2018-05-311-0/+2
| | | | | | Add the ability to dump compiler option-related information to a JSON file via the -compiler-options-dump option. Specifically, it dumps the features/extensions lists -- however, this output could be extended to other information should it be useful. In order to support features and extensions, I moved them into a .def file so that we could build the various lists we care about from them without a significant increase in maintenance burden. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333653 91177308-0d34-0410-b5e6-96231b3b80d8
* Make a build bot happy.Gabor Horvath2018-02-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324809 91177308-0d34-0410-b5e6-96231b3b80d8
* [Templight] Template Instantiation ObserverGabor Horvath2018-02-101-2/+7
| | | | | | | | | | | | | | | | | | | | | | This patch adds a base-class called TemplateInstantiationObserver which gets notified whenever a template instantiation is entered or exited during semantic analysis. This is a base class used to implement the template profiling and debugging tool called Templight (https://github.com/mikael-s-persson/templight). The patch also makes a few more changes: * ActiveTemplateInstantiation class is moved out of the Sema class (so it can be used with inclusion of Sema.h). * CreateFrontendAction function in front-end utilities is given external linkage (not longer a hidden static function). * TemplateInstObserverChain data member added to Sema class to hold the list of template-inst observers. * Notifications to the template-inst observer are added at the key places where templates are instantiated. Patch by: Abel Sinkovics! Differential Revision: https://reviews.llvm.org/D5767 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324808 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use #cmakedefine01 for ↵NAKAMURA Takumi2017-10-181-7/+7
| | | | | | | | | | | | CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) It'd be better that they are #cmakedefine01 rather than #cmakedefine. (#if FOO rather than #if defined(FOO)) Then we can find missing #include "clang/Config/config.h" in the future. Differential Revision: https://reviews.llvm.org/D35541 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316061 91177308-0d34-0410-b5e6-96231b3b80d8
* Update after LLVM change r309087George Rimar2017-07-261-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309088 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into ↵NAKAMURA Takumi2017-07-181-0/+1
| | | | | | | | | | | | | | clang/Config/config.h. LLVM_ENABLE_MODULES is sensitive of -D. Move them into config.h. FIXME: It'd be better that they are #cmakedefine01 rather than #cmakedefine. (#if FOO rather than #if defined(FOO)) Then we can find missing #include "clang/Config/config.h" in the future. Differential Revision: https://reviews.llvm.org/D35527 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308277 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -frewrite-imports flag.Richard Smith2017-06-091-1/+2
| | | | | | | | | If specified, when preprocessing, the contents of imported .pcm files will be included in preprocessed output. The resulting preprocessed file can then be compiled standalone without the module sources or .pcm files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305116 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptrify createDriverOptTableDavid Blaikie2017-01-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291919 91177308-0d34-0410-b5e6-96231b3b80d8
* C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith2016-08-261-1/+4
| | | | | | | | interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279794 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Command line option to show enabled checker list.Gabor Horvath2016-08-081-0/+5
| | | | | | | | | | | | | This patch adds a command line option to list the checkers that were enabled by analyzer-checker and not disabled by -analyzer-disable-checker. It can be very useful to debug long command lines when it is not immediately apparent which checkers are turned on and which checkers are turned off. Differential Revision: https://reviews.llvm.org/D23060 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278006 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible for AST plugins to enable themselves by defaultJohn Brawn2016-03-151-1/+15
| | | | | | | | | | | | | Currently when an AST plugin is loaded it must then be enabled by passing -plugin pluginname or -add-plugin pluginname to the -cc1 command line. This patch adds a method to PluginASTAction which allows it to declare that the action happens before, instead of, or after the main AST action, plus the relevant changes to make the plugin action happen at that time automatically. Differential Revision: http://reviews.llvm.org/D17959 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263546 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r260265, "clang-cl: Support loading plugins on Windows"NAKAMURA Takumi2016-02-111-8/+1
| | | | | | It causes memory exhaust on mingw-w64(x64). Investigating. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260536 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support loading plugins on WindowsEhsan Akhgari2016-02-091-1/+8
| | | | | | | | | | | | This builds on the support being added to LLVM to import and export registries from DLLs. This will allow us to pick up the registry entries added in the DLL's copy of FrontendPluginRegistry. This will allow us to use plugins on Windows using: $ clang-cl -Xclang -load -Xclang plugin.dll \ -Xclang -add-plugin -Xclang foo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260265 91177308-0d34-0410-b5e6-96231b3b80d8
* [Frontend] Make the memory management of FrontendAction pointers explicit by ↵Argyrios Kyrtzidis2016-02-071-42/+47
| | | | | | using unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260048 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove autoconf supportChris Bieneman2016-01-261-25/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258862 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a BuryPointer for unique_ptrs.David Blaikie2014-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In theory, it'd be nice if we could move to a case where all buried pointers were buried via unique_ptr to demonstrate that the program had finished with the value (that we could really have cleanly deallocated it) but instead chose to bury it. I think the main reason that's not possible right now is the various IntrusiveRefCntPtrs in the Frontend, sharing ownership for a variety of compiler bits (see the various similar "CompilerInstance::releaseAndLeak*" functions). I have yet to figure out their correct ownership semantics - but perhaps, even if the intrusiveness can be removed, the shared ownership may yet remain and that would lead to a non-unique burying as is there today. (though we could model that a little better - by passing in a shared_ptr, etc - rather than needing the two step that's currently used in those other releaseAndLeak* functions) This might be a bit more robust if BuryPointer took the boolean: BuryPointer(bool, unique_ptr<T>) and the choice to bury was made internally - that way, even when DisableFree was not set, the unique_ptr would still be null in the caller and there'd be no chance of accidentally having a different codepath where the value is used after burial in !DisableFree, but it becomes null only in DisableFree, etc... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216742 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang's rewrite engine a core featureAlp Toker2014-07-162-26/+5
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213171 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-05-261-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209612 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Don't wrap a PCH generation action with a ObjCMigrateAction one, it ↵Argyrios Kyrtzidis2014-05-171-1/+2
| | | | | | | | messes up the PCH file. rdar://16941811 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209059 91177308-0d34-0410-b5e6-96231b3b80d8
* [leaks] Don't leak the fake arguments we synthesize for LLVM optionChandler Carruth2014-05-031-2/+2
| | | | | | parsing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207899 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-071-3/+3
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-071-2/+2
| | | | | | This is a precursor to moving to std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203275 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-10/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202238 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Resurrect mis-dropped dependency to ClangDriverOptions since r201842.NAKAMURA Takumi2014-02-231-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201978 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-6/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a CC1 option -verify-pchBen Langmuir2014-02-051-0/+1
| | | | | | | | | This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200884 91177308-0d34-0410-b5e6-96231b3b80d8
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-271-1/+2
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198073 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-101-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196864 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-091-1/+7
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196800 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring back a StringRef used in some build configurationsAlp Toker2013-11-271-0/+2
| | | | | | | | | | This was removed in the great unused local cleanup of r195814. Adding cast-to-void to suppress unused variable warnings. Should fix certain builds like ARCMT. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195872 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a whole lot of unused variablesAlp Toker2013-11-271-1/+0
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195814 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] If the frontend option is frontend::MigrateSource then we don't ↵Argyrios Kyrtzidis2013-11-131-20/+22
| | | | | | | | need to create the arcmt wrappers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194627 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -ast-dump-xml.Richard Smith2013-10-071-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192131 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C migrator. Simplify migrator option Fariborz Jahanian2013-10-021-4/+1
| | | | | | | | processing in preparation for adding several more options. // rdar://15003157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191842 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. This patch infers readonly properties for no-parameter Fariborz Jahanian2013-08-281-1/+2
| | | | | | | | instance methods returning non-void. This will be quite noisy. So, it is placed under a new migrator flag -objcmt-migrate-readonly-property. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189537 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix dependencies now that the ARC migrator depends on the static analyzer.Jordan Rose2013-08-221-1/+6
| | | | | | | | | | Thanks for pointing this out, Stephen. I think this is right now -- I attempted to try all four valid combinations with both the autoconf and CMake builds. See also LLVM changes to the configure script. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189027 91177308-0d34-0410-b5e6-96231b3b80d8
* Indicate success for simple options when clang called with -cc1.Rafael Espindola2013-08-071-3/+3
| | | | | | Patch by David Wiberg. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187888 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian2013-07-091-2/+3
| | | | | | | | migration. Also, fixes an old bug where older migration flags were not being checked for properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948 91177308-0d34-0410-b5e6-96231b3b80d8
* With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check.Jordan Rose2013-07-031-3/+8
| | | | | | | | | | | | | | | Previously, the CMake build still tried to link clang against the static analyzer libraries, even if CLANG_ENABLE_STATIC_ANALYZER was off. Furthermore, clang-check depends on the analyzer, so it should be disabled (in both CMake and configure builds). In theory, clang-check could be made to conditionally include analyzer support (like clang itself), but for now this at least gets a CMake ALL_BUILD working. Patch by Stephen Kelly, modified by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185548 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-5/+5
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183989 91177308-0d34-0410-b5e6-96231b3b80d8
* <rdar://problem/13509689> Introduce -module-file-info option that provides ↵Douglas Gregor2013-03-271-0/+1
| | | | | | | | | | | | | information about a particular module file. This option can be useful for end users who want to know why they ended up with a ton of different variants of the "std" module in their module cache. This problem should go away over time, as we reduce the need for module variants, but it will never go away entirely. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178148 91177308-0d34-0410-b5e6-96231b3b80d8
* use early returns to simplify and de-nestSean Silva2013-01-061-11/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171654 91177308-0d34-0410-b5e6-96231b3b80d8
* Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the userRoman Divacky2012-12-132-2/+59
| | | | | | | | | | | specifies not to. Dont build ASTMatchers with Rewriter disabled and StaticAnalyzer when it's disabled. Without all those three, the clang binary shrinks (x86_64) from ~36MB to ~32MB (unstripped). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170135 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
* PR14303: Add a NoDriverOption flag to those options which are not accepted byRichard Smith2012-11-091-1/+4
| | | | | | | | the driver (the options defined in CC1Options.td) and exclude their help from "clang --help". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167638 91177308-0d34-0410-b5e6-96231b3b80d8
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-012-2/+3
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163050 91177308-0d34-0410-b5e6-96231b3b80d8
* Make AnalyzerOptions a shared object between CompilerInvocation andTed Kremenek2012-08-311-1/+1
| | | | | | | AnalysisManager, allowing the StringMap of configuration values to be propagated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162978 91177308-0d34-0410-b5e6-96231b3b80d8
* Added -ast-list option to dump filterable AST decl node names.Alexander Kornienko2012-07-311-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161040 91177308-0d34-0410-b5e6-96231b3b80d8