summaryrefslogtreecommitdiffstats
path: root/tools/clang-check
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
* Remove 'Filename' parameter from BeginSourceFileAction.Richard Smith2017-06-091-2/+1
| | | | | | | | | | No-one was using this, and it's not meaningful in general -- FrontendActions can be run on inputs that don't have a corresponding source file. The current frontend input can be obtained by asking the FrontendAction if any future action actually needs it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305045 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297412 91177308-0d34-0410-b5e6-96231b3b80d8
* Frontend: Simplify ownership model for clang's output streams.Peter Collingbourne2016-07-151-1/+1
| | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275507 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272233 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove autoconf supportChris Bieneman2016-01-261-28/+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
* Make the clang module container format selectable from the command line.Adrian Prantl2015-07-172-3/+1
| | | | | | | | | | | | | - 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242499 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r241770 and add Basic to the dependencies of clang-check instead.Adrian Prantl2015-07-091-0/+1
| | | | | | PR24067. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241782 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Fix a linker issue with clang-check on Linux."Adrian Prantl2015-07-081-2/+0
| | | | | | This reverts commit r241636 as it turned out to be unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241684 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang-check: Prune redundant libdeps introduced in r241653.NAKAMURA Takumi2015-07-081-14/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241680 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Reorder libdeps. NFC.NAKAMURA Takumi2015-07-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241661 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-083-5/+35
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241653 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-073-27/+5
| | | | | | failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241642 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a linker issue with clang-check on Linux.Adrian Prantl2015-07-071-0/+2
| | | | | | There must be a better way to fix this — I'll keep investigating. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241636 91177308-0d34-0410-b5e6-96231b3b80d8
* Add LLVM backend dependencies to clang-check also in cmake.Adrian Prantl2015-07-071-1/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241627 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-073-4/+11
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241620 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-3/+2
| | | | 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-2/+3
| | | | | | | | | | | | | | | | | 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-3/+2
| | | | | | | 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-2/+3
| | | | | | | | | | | | | | 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-3/+2
| | | | | | | | 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-2/+3
| | | | | | | | | | | | | | 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
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-201-3/+2
| | | | | | | | This reverts commit r230067. Investigating another batch of problems found by the bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230073 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-201-2/+3
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230067 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort the #include lines using llvm/utils/sort_includes.pyChandler Carruth2015-01-141-1/+1
| | | | | | | No functionality changed, this is a purely mechanical cleanup to ensure the #include order remains consistent across the project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225975 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ArgumentsAdjuster an std::function.Alexander Kornienko2014-12-031-3/+3
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6505 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223248 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Move -extra-arg handling to CommonOptionsProviderAlexander Kornienko2014-11-041-61/+7
| | | | | | | | | | | | | | | | | | Summary: Handle -extra-arg and -extra-arg-before options in the CommonOptionsProvider so they can be used in all clang tools. Adjust arguments in a CompilationDatabase wrapper instead of adding ArgumentsAdjuster to the tool. Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6073 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221248 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-111-1/+2
| | | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215393 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-101-2/+3
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215323 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-3/+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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213325 91177308-0d34-0410-b5e6-96231b3b80d8
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-2/+3
| | | | | | | | | (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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang's rewrite engine a core featureAlp Toker2014-07-161-1/+1
| | | | | | | | | | | | | | | 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
* Follow-up to r207071: Let newFrontendActionFactory() return a unique_ptr.Nico Weber2014-04-281-2/+2
| | | | | | | This exposed a leak, fix that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207396 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-151-4/+4
| | | | | | 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-1/+1
| | | | | | 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
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202625 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-2/+2
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
* Filter-out irrelevant command-line options in CommonOptionsParser.Alexander Kornienko2013-12-121-27/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Leave only -help, -version and options from the specified category. Updated clang-check and clang-tidy. As clang-tidy is in a separate repository, here's the diff: Index: tools/extra/clang-tidy/tool/ClangTidyMain.cpp =================================================================== --- tools/extra/clang-tidy/tool/ClangTidyMain.cpp (revision 197024) +++ tools/extra/clang-tidy/tool/ClangTidyMain.cpp (working copy) @@ -39,7 +39,7 @@ // FIXME: Add option to list name/description of all checks. int main(int argc, const char **argv) { - CommonOptionsParser OptionsParser(argc, argv); + CommonOptionsParser OptionsParser(argc, argv, ClangTidyCategory); SmallVector<clang::tidy::ClangTidyError, 16> Errors; clang::tidy::runClangTidy(Checks, OptionsParser.getCompilations(), Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits, revane, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2379 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197139 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Update target_link_libraries() and LLVM_LINK_COMPONENTS for each ↵NAKAMURA Takumi2013-12-101-6/+6
| | | | | | CMakeLists.txt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196916 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-142-2/+3
| | | | | | | | | | | | | | | | | | 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
* clang-check: add missing space in MakefileHans Wennborg2013-06-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183406 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-check: Link the static analyzer in the Makefile build too.Benjamin Kramer2013-06-061-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183404 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for static analysis to clang-checkPavel Labath2013-06-062-8/+37
| | | | | | | | | | | | | | Summary: This adds a command line argument '-analyze' to clang-check which runs the clang static analyzer on the source files. Reviewers: klimek CC: cfe-commits, revane Differential Revision: http://llvm-reviews.chandlerc.com/D926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183399 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-check: Enable specification of additional compiler argumentsPavel Labath2013-06-051-0/+40
| | | | | | | | | | | | | | Summary: This adds two command-line parameters: -extra-arg and -extra-arg-before, which enable the user to pass additional parameters to the compiler command. Reviewers: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D919 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183320 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
* clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()NAKAMURA Takumi2013-01-181-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172818 91177308-0d34-0410-b5e6-96231b3b80d8
* Style and Doc fix for CommonOptionsParserEdwin Vane2012-12-141-2/+2
| | | | | | | | | | | | | - Renaming GetCompilations() and GetSourcePathList() to follow LLVM style. - Updating docs to reflect name change. - Also updating help text to not mention clang-check since this class can be used by any tool. Reviewed By: Alexander Kornienko git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170229 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-check: Add clangRewriteCore.a to the Makefile build to make it link again.Benjamin Kramer2012-10-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165119 91177308-0d34-0410-b5e6-96231b3b80d8
* As opposed to the clang-fixit tool described onDaniel Jasper2012-10-033-5/+74
| | | | | | | | | | http://clang.llvm.org/docs/ClangTools.html, this adds -fixit option to clang-check. Thus, clang-check can become a general-purpose tool to run clang capitalizing on the info stored in a compilation database. Review: http://llvm-reviews.chandlerc.com/D51 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165110 91177308-0d34-0410-b5e6-96231b3b80d8
* Workaround for MacOSX build failure with gcc <= 4.4Alexander Kornienko2012-09-101-6/+6
| | | | | | | | | | | | | | | | Summary: A better solution to http://llvm.org/bugs/show_bug.cgi?id=13777 Named namespace + more unique name to make ODR violations unlikely. Reviewers: chandlerc, doug.gregor, klimek Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D38 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163513 91177308-0d34-0410-b5e6-96231b3b80d8