summaryrefslogtreecommitdiffstats
path: root/tools/diagtool
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] allow the use of refactoring diagnosticsAlex Lorenz2017-10-161-0/+1
| | | | | | | | | | This commit allows the refactoring library to use its own set of refactoring-specific diagnostics to reports things like initiation errors. Differential Revision: https://reviews.llvm.org/D38772 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315924 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Cross Translation Unit support libraryGabor Horvath2017-09-221-0/+1
| | | | | | | | | | | | | | | | | | | This patch introduces a class that can help to build tools that require cross translation unit facilities. This class allows function definitions to be loaded from external AST files based on an index. In order to use this functionality an index is required. The index format is a flat text file but it might be replaced with a different solution in the near future. USRs are used as names to look up the functions definitions. This class also does caching to avoid redundant loading of AST files. Right now only function defnitions can be loaded using this API because this is what the in progress cross translation unit feature of the Static Analyzer requires. In to future this might be extended to classes, types etc. Differential Revision: https://reviews.llvm.org/D34512 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313975 91177308-0d34-0410-b5e6-96231b3b80d8
* [diagtool] Change default tree behavior to print only flagsJonas Devlieghere2017-09-051-9/+27
| | | | | | | | | | | | | | This patch changes the default behavior of `diagtool tree` to only display warning flags and not the internal warnings flags. The latter is an implementation detail of the compiler and usually not what the users wants. Furthermore, flags that are enabled by default are now also printed in green. Originally, this was only the case for the diagnostic names. Differential revision: https://reviews.llvm.org/D37390 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312546 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Loop modernization in diagtoolJonas Devlieghere2017-09-055-62/+57
| | | | | | Precommit for https://reviews.llvm.org/D37390 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312545 91177308-0d34-0410-b5e6-96231b3b80d8
* [diagtool] Add ability to pass in the id and return the name for aDon Hinton2017-08-031-1/+17
| | | | | | | | particular diagnostic. Differential Revision: https://reviews.llvm.org/D36252 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309955 91177308-0d34-0410-b5e6-96231b3b80d8
* [diagtool] Add a 'find-diagnostic-id' subcommand that converts a name ofAlex Lorenz2017-07-122-0/+59
| | | | | | | | | | | | the diagnostic to its enum value This will be used by a script that invokes clang in a debugger and forces it to stop when it reports a particular diagnostic. Differential Revision: https://reviews.llvm.org/D35306 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307813 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase ↵David Blaikie2017-01-061-2/+2
| | | | | | | | | | | | | | and CodeCompleteConsumer" Aleksey Shlypanikov pointed out my mistake in migrating an explicit unique_ptr to auto - I was expecting the function returned a unique_ptr, but instead it returned a raw pointer - introducing a leak. Thanks Aleksey! This reapplies r291184, reverted in r291249. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291270 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-061-2/+2
| | | | | | | | | | CodeCompleteConsumer" Caused a memory leak reported by asan. Reverting while I investigate. This reverts commit r291184. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291249 91177308-0d34-0410-b5e6-96231b3b80d8
* IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-051-2/+2
| | | | | | CodeCompleteConsumer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291184 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Header cleanupMehdi Amini2016-07-182-2/+0
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275882 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove autoconf supportChris Bieneman2016-01-261-26/+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
* [libclang] Add entry points that take a full command line including argv[0].Benjamin Kramer2015-11-181-2/+4
| | | | | | | | | | | | This provides both a more uniform interface and makes libclang behave like clang tooling wrt relative paths against argv[0]. This is necessary for finding paths to a c++ standard library relative to a clang binary given in a compilation database. It can also be used to find paths relative to libclang.so if the full path to it is passed in. Differential Revision: http://reviews.llvm.org/D14695 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253466 91177308-0d34-0410-b5e6-96231b3b80d8
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250827 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250822 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-223-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-223-3/+3
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230454 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-1/+1
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230423 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-241-1/+1
| | | | | | | This reverts commit r230305. Off to fix another round of missing dependencies on various platforms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230309 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-241-1/+1
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230305 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-211-1/+1
| | | | | | | | This reverts commit 230099. The Linux configure+make build variant still needs some work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230103 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-1/+1
| | | | | | | | | | | | | | 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 2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230089 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format a recent commit I madeDavid Blaikie2014-11-191-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222317 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.David Blaikie2014-11-192-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222306 91177308-0d34-0410-b5e6-96231b3b80d8
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-301-1/+1
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216824 91177308-0d34-0410-b5e6-96231b3b80d8
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-132-4/+4
| | | | | | Modifications made by clang-tidy with minor tweaks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215557 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing header guards.Benjamin Kramer2014-08-081-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215202 91177308-0d34-0410-b5e6-96231b3b80d8
* diagtool: refactor TreeView to resemble C++Alp Toker2014-06-201-103/+101
| | | | | | | Replace lots of old-school parameter passing with neat class members. No attempt made yet to modernize loops, but it's a start. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211327 91177308-0d34-0410-b5e6-96231b3b80d8
* diagtool: simplify TreeView diagnostic classificationAlp Toker2014-06-191-3/+3
| | | | | | This utility doesn't need to know about the specifics of diagnostic levels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211323 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-084-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210422 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace llvm::array_endof with C++11's std::end.Benjamin Kramer2014-04-121-2/+2
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206111 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-151-1/+1
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204002 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
* Add 'remark' diagnostic type in 'clang'Tobias Grosser2014-02-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic. A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized. This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks. This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202475 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-4/+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
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-101-7/+1
| | | | | | CMakeLists.txt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196916 91177308-0d34-0410-b5e6-96231b3b80d8
* Rather than duplicating extension diagnostics to allow them to cause aRichard Smith2013-11-121-2/+1
| | | | | | | | | | | substitution failure, allow a flag to be set on the Diagnostic object, to mark it as 'causes substitution failure'. Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior rather than a bunch of flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194444 91177308-0d34-0410-b5e6-96231b3b80d8
* Move individual group name strings from the OptionTable into one big char ↵Craig Topper2013-08-293-9/+9
| | | | | | array. Then only store offsets into it in the OptionTable. Saves about 4K from the clang binary and removes 400 relocation entries from DiagnosticIDs.o. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189568 91177308-0d34-0410-b5e6-96231b3b80d8
* Reorder and shrink size of NameLen field in diagnostic group table. Shaves ↵Craig Topper2013-08-282-5/+7
| | | | | | ~4K from clang binary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189445 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge diagnostic group tables to reduce data size and relocation entries.Craig Topper2013-08-282-15/+23
| | | | | | | | | | | | | The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed. My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189438 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-1/+1
| | | | | | | | | | | | | | | | | | 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
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-201-2/+1
| | | | | | | Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172945 91177308-0d34-0410-b5e6-96231b3b80d8
* these now depend on the bitcode reader too.Chris Lattner2013-01-192-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172906 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort #include lines for tools/...Chandler Carruth2012-12-044-9/+9
| | | | | | Completely automated with sort_includes.py git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-232-3/+6
| | | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
* Add color output to 'diagtool tree' to show what warnings are enabled by ↵Ted Kremenek2012-10-051-3/+45
| | | | | | default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165338 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-inline asm] Add various MC components to clang build to support MS-style ↵Chad Rosier2012-08-091-1/+4
| | | | | | inline assembly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161594 91177308-0d34-0410-b5e6-96231b3b80d8
* Add various MC components to clang build to support MS-style inline assembly.Chad Rosier2012-08-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161498 91177308-0d34-0410-b5e6-96231b3b80d8
* Include clang-check as part of the clang installation.David Blaikie2012-07-311-3/+0
| | | | | | | | | | This also tidies up a couple of other tools we were (partially) installing: * c-index-test was being installed but shouldn't be (it's just a clang-dev tool) * diagtool was being installed in cmake but not make (& shouldn't be installed in either) Review by Manuel Klimek, Doug Gregor, and Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161073 91177308-0d34-0410-b5e6-96231b3b80d8