aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-05-23[analyzer] Add a new frontend flag to display all checker optionsKristof Umann1-0/+10
Add the new frontend flag -analyzer-checker-option-help to display all checker/package options. Differential Revision: https://reviews.llvm.org/D57858 llvm-svn: 361552
2019-05-01[analyzer] Don't display implementation checkers under ↵Kristof Umann1-7/+9
-analyzer-checker-help, but do under the new flag -analyzer-checker-help-hidden During my work on analyzer dependencies, I created a great amount of new checkers that emitted no diagnostics at all, and were purely modeling some function or another. However, the user shouldn't really disable/enable these by hand, hence this patch, which hides these by default. I intentionally chose not to hide alpha checkers, because they have a scary enough name, in my opinion, to cause no surprise when they emit false positives or cause crashes. The patch introduces the Hidden bit into the TableGen files (you may remember it before I removed it in D53995), and checkers that are either marked as hidden, or are in a package that is marked hidden won't be displayed under -analyzer-checker-help. -analyzer-checker-help-hidden, a new flag meant for developers only, displays the full list. Differential Revision: https://reviews.llvm.org/D60925 llvm-svn: 359720
2019-01-26[analyzer][NFC] Supply CheckerRegistry with AnalyzerOptionsKristof Umann1-2/+5
Since pretty much all methods of CheckerRegistry has AnalyzerOptions as an argument, it makes sense to just simply require it in it's constructor. Differential Revision: https://reviews.llvm.org/D56988 llvm-svn: 352279
2019-01-26[analyzer] Supply all checkers with a shouldRegister functionKristof Umann1-2/+3
Introduce the boolean ento::shouldRegister##CHECKERNAME(const LangOptions &LO) function very similarly to ento::register##CHECKERNAME. This will force every checker to implement this function, but maybe it isn't that bad: I saw a lot of ObjC or C++ specific checkers that should probably not register themselves based on some LangOptions (mine too), but they do anyways. A big benefit of this is that all registry functions now register their checker, once it is called, registration is guaranteed. This patch is a part of a greater effort to reinvent checker registration, more info here: D54438#1315953 Differential Revision: https://reviews.llvm.org/D55424 llvm-svn: 352277
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-12-15[analyzer][NFC] Merge ClangCheckerRegistry to CheckerRegistryKristof Umann1-1/+2
Now that CheckerRegistry lies in Frontend, we can finally eliminate ClangCheckerRegistry. Fortunately, this also provides us with a DiagnosticsEngine, so I went ahead and removed some parameters from it's methods. Differential Revision: https://reviews.llvm.org/D54437 llvm-svn: 349280
2018-12-15[analyzer] Prefer returns values to out-params in CheckerRegistry.cppKristof Umann1-1/+2
Renaming collectCheckers to getEnabledCheckers Changing the functionality to acquire all enabled checkers, rather then collect checkers for a specific CheckerOptInfo (for example, collecting all checkers for { "core", true }, which meant enabling all checkers from the core package, which was an unnecessary complication). Removing CheckerOptInfo, instead of storing whether the option was claimed via a field, we handle errors immediately, as getEnabledCheckers can now access a DiagnosticsEngine. Realize that the remaining information it stored is directly accessible through AnalyzerOptions.CheckerControlList. Fix a test with -analyzer-disable-checker -verify accidentally left in. llvm-svn: 349274
2018-12-04PTH-- Remove feature entirely-Erich Keane1-1/+0
When debugging a boost build with a modified version of Clang, I discovered that the PTH implementation stores TokenKind in 8 bits. However, we currently have 368 TokenKinds. The result is that the value gets truncated and the wrong token gets picked up when including PTH files. It seems that this will go wrong every time someone uses a token that uses the 9th bit. Upon asking on IRC, it was brought up that this was a highly experimental features that was considered a failure. I discovered via googling that BoostBuild (mostly Boost.Math) is the only user of this feature, using the CC1 flag directly. I believe that this can be transferred over to normal PCH with minimal effort: https://github.com/boostorg/build/issues/367 Based on advice on IRC and research showing that this is a nearly completely unused feature, this patch removes it entirely. Note: I considered leaving the build-flags in place and making them emit an error/warning, however since I've basically identified and warned the only user, it seemed better to just remove them. Differential Revision: https://reviews.llvm.org/D54547 Change-Id: If32744275ef1f585357bd6c1c813d96973c4d8d9 llvm-svn: 348266
2018-11-17Sink BuryPointer from Clang into LLVM for reuse thereDavid Blaikie1-2/+3
llvm-svn: 347141
2018-11-02[analyzer] New flag to print all -analyzer-config optionsKristof Umann1-0/+8
A new -cc1 flag is avaible for the said purpose: -analyzer-config-help Differential Revision: https://reviews.llvm.org/D53296 llvm-svn: 345989
2018-10-10[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."Fangrui Song1-1/+1
Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009 Reviewers: rupprecht, alexshap, jhenderson Reviewed By: rupprecht Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51109 llvm-svn: 344098
2018-10-03[Frontend] Delete -print-decl-contextsFangrui Song1-1/+0
Summary: Its job is covered by -ast-dump. The option is rarely used and lacks many AST nodes which will lead to llvm_unreachable() crash. Reviewers: rsmith, arphaman Reviewed By: rsmith Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52529 llvm-svn: 343660
2018-09-15[modules] Frontend support for building a header module from a list ofRichard Smith1-0/+2
headaer files. llvm-svn: 342304
2018-07-30Remove trailing spaceFangrui Song1-2/+2
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
2018-05-31Add a new driver mode to dump compiler feature and extension options.Aaron Ballman1-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. llvm-svn: 333653
2018-02-10Make a build bot happy.Gabor Horvath1-1/+1
llvm-svn: 324809
2018-02-10[Templight] Template Instantiation ObserverGabor Horvath1-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 llvm-svn: 324808
2017-10-18[CMake] Use #cmakedefine01 for ↵NAKAMURA Takumi1-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 llvm-svn: 316061
2017-07-26Update after LLVM change r309087George Rimar1-1/+2
llvm-svn: 309088
2017-07-18[CMake] Move CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) into ↵NAKAMURA Takumi1-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 llvm-svn: 308277
2017-06-09Add -frewrite-imports flag.Richard Smith1-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. llvm-svn: 305116
2017-01-13unique_ptrify createDriverOptTableDavid Blaikie1-1/+1
llvm-svn: 291919
2016-08-26C++ Modules TS: add frontend support for building pcm files from moduleRichard Smith1-1/+4
interface files. At the moment, all declarations (and no macros) are exported, and 'export' declarations are not supported yet. llvm-svn: 279794
2016-08-08[analyzer] Command line option to show enabled checker list.Gabor Horvath1-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 llvm-svn: 278006
2016-03-15Make it possible for AST plugins to enable themselves by defaultJohn Brawn1-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 llvm-svn: 263546
2016-02-11Revert r260265, "clang-cl: Support loading plugins on Windows"NAKAMURA Takumi1-8/+1
It causes memory exhaust on mingw-w64(x64). Investigating. llvm-svn: 260536
2016-02-09clang-cl: Support loading plugins on WindowsEhsan Akhgari1-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 llvm-svn: 260265
2016-02-07[Frontend] Make the memory management of FrontendAction pointers explicit by ↵Argyrios Kyrtzidis1-42/+47
using unique_ptr. llvm-svn: 260048
2014-08-29Provide a BuryPointer for unique_ptrs.David Blaikie1-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... llvm-svn: 216742
2014-07-16Make clang's rewrite engine a core featureAlp Toker1-22/+4
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. llvm-svn: 213171
2014-05-26[C++11] Use 'nullptr'.Craig Topper1-4/+4
llvm-svn: 209612
2014-05-17[objcmt] Don't wrap a PCH generation action with a ObjCMigrateAction one, it ↵Argyrios Kyrtzidis1-1/+2
messes up the PCH file. rdar://16941811 llvm-svn: 209059
2014-05-03[leaks] Don't leak the fake arguments we synthesize for LLVM optionChandler Carruth1-2/+2
parsing. llvm-svn: 207899
2014-03-07Replace OwningPtr with std::unique_ptr.Ahmed Charles1-3/+3
This compiles cleanly with lldb/lld/clang-tools-extra/llvm. llvm-svn: 203279
2014-03-07Change OwningPtr::take() to OwningPtr::release().Ahmed Charles1-2/+2
This is a precursor to moving to std::unique_ptr. llvm-svn: 203275
2014-02-05Add a CC1 option -verify-pchBen Langmuir1-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 llvm-svn: 200884
2013-12-27Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany1-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 llvm-svn: 198073
2013-11-27Bring back a StringRef used in some build configurationsAlp Toker1-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. llvm-svn: 195872
2013-11-27Remove a whole lot of unused variablesAlp Toker1-1/+0
There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. llvm-svn: 195814
2013-11-13[objcmt] If the frontend option is frontend::MigrateSource then we don't ↵Argyrios Kyrtzidis1-20/+22
need to create the arcmt wrappers. llvm-svn: 194627
2013-10-07Remove -ast-dump-xml.Richard Smith1-1/+0
llvm-svn: 192131
2013-10-02Objective-C migrator. Simplify migrator option Fariborz Jahanian1-4/+1
processing in preparation for adding several more options. // rdar://15003157 llvm-svn: 191842
2013-08-28ObjectiveC migrator. This patch infers readonly properties for no-parameter Fariborz Jahanian1-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. llvm-svn: 189537
2013-08-07Indicate success for simple options when clang called with -cc1.Rafael Espindola1-3/+3
Patch by David Wiberg. llvm-svn: 187888
2013-07-09ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian1-2/+3
migration. Also, fixes an old bug where older migration flags were not being checked for properly. llvm-svn: 185948
2013-06-14[Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner1-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 llvm-svn: 183989
2013-03-27<rdar://problem/13509689> Introduce -module-file-info option that provides ↵Douglas Gregor1-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. llvm-svn: 178148
2013-01-06use early returns to simplify and de-nestSean Silva1-11/+9
llvm-svn: 171654
2012-12-13Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the userRoman Divacky1-2/+44
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). llvm-svn: 170135
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-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. llvm-svn: 169237