summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* cmake: Add INSTALL_WITH_TOOLCHAIN option to add_*_library macrosTom Stellard2019-07-121-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This will simplify the macros by allowing us to remove the hard-coded list of libraries that should be installed when LLVM_INSTALL_TOOLCHAIN_ONLY is enabled. Reviewers: beanz, smeenai Reviewed By: beanz Subscribers: aheejin, mehdi_amini, mgorny, steven_wu, dexonsmith, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D64580 llvm-svn: 365902
* Rename libclang_shared to libclang-cppSylvestre Ledru2019-07-111-2/+2
| | | | | | | | | | | | | | | | Summary: Fix bug 42475 Reviewers: beanz, tstellar Reviewed By: beanz Subscribers: kimgr, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64278 llvm-svn: 365831
* [clang-shlib] Fix clang-shlib for PRIVATE dependenciesShoaib Meenai2019-07-111-2/+29
| | | | | | | | | | | | | | Any static library with a PRIVATE dependency ends up with a $<LINK_ONLY:...> generator expression in its INTERFACE_LINK_LIBRARIES, which won't be evaluated by the $<TARGET_PROPERTY:...>, so we end up with an unevaluated generator expression in the generated build file and Ninja chokes on the dollar sign. Just use the static library directly for its dependencies instead of trying to propagate dependencies manually. Differential Revision: https://reviews.llvm.org/D64579 llvm-svn: 365825
* Revert Recommit "[CommandLine] Remove OptionCategory and SubCommand caches ↵Haojian Wu2019-07-111-1/+3
| | | | | | | | | | from the Option class." This reverts r365675 (git commit 43d75f977853c3ec891a440c362b2df183a211b5) The patch causes a crash in SupportTests (CommandLineTest.AliasesWithArguments). llvm-svn: 365742
* [Concepts] Concept definitions (D40381)Saar Raz2019-07-101-0/+1
| | | | | | | First in a series of patches to land C++2a Concepts support. This patch adds AST and parsing support for concept-declarations. llvm-svn: 365699
* Recommit "[CommandLine] Remove OptionCategory and SubCommand caches from the ↵Don Hinton2019-07-101-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Option class." Previously reverted in 364141 due to buildbot breakage, and fixed here by making GeneralCategory global a ManagedStatic. Summary: This change processes `OptionCategory`s and `SubCommand`s as they are seen instead of caching them in the Option class and processing them later. Doing so simplifies the work needed to be done by the Global parser and significantly reduces the size of the Option class to a mere 64 bytes. Removing the `OptionCategory` cache saved 24 bytes, and removing the `SubCommand` cache saved an additional 48 bytes, for a total of a 72 byte reduction. Reviewed By: serge-sans-paille Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62105 llvm-svn: 365675
* [libclang] Fix hang in release / assertion in debug when evaluating ↵Emilio Cobos Alvarez2019-07-091-0/+2
| | | | | | | | | | | | | value-dependent types. Expression evaluator doesn't work in value-dependent types, so ensure that the precondition it asserts holds. This fixes https://bugs.llvm.org/show_bug.cgi?id=42532 Differential Revision: https://reviews.llvm.org/D64409 llvm-svn: 365490
* cmake: Add CLANG_LINK_CLANG_DYLIB optionTom Stellard2019-07-0312-12/+12
| | | | | | | | | | | | | | | | Summary: Setting CLANG_LINK_CLANG_DYLIB=ON causes clang tools to link against libclang_shared.so instead of the individual component libraries. Reviewers: mgorny, beanz, smeenai, phosek, sylvestre.ledru Subscribers: arphaman, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63503 llvm-svn: 365092
* [Bitcode] Move Bitstream to a separate libraryFrancis Visoiu Mistrih2019-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This moves Bitcode/Bitstream*, Bitcode/BitCodes.h to Bitstream/. This is needed to avoid a circular dependency when using the bitstream code for parsing optimization remarks. Since Bitcode uses Core for the IR part: libLLVMRemarks -> Bitcode -> Core and Core uses libLLVMRemarks to generate remarks (see IR/RemarkStreamer.cpp): Core -> libLLVMRemarks we need to separate the Bitstream and Bitcode part. For clang-doc, it seems that it doesn't need the whole bitcode layer, so I updated the CMake to only use the bitstream part. Differential Revision: https://reviews.llvm.org/D63899 llvm-svn: 365091
* [clang-scan-deps] use `-Wno-error` when scanning for dependenciesAlex Lorenz2019-07-031-0/+1
| | | | | | | | | Warnings can be promoted to errors. But that shouldn't prevent us from getting the dependencies! Differential Revision: https://reviews.llvm.org/D64149 llvm-svn: 365065
* Change std::{lower,upper}_bound to llvm::{lower,upper}_bound or ↵Fangrui Song2019-07-032-6/+2
| | | | | | llvm::partition_point. NFC llvm-svn: 365006
* [C++2a] Add __builtin_bit_cast, used to implement std::bit_castErik Pilkington2019-07-022-0/+4
| | | | | | | | | | | | | | | | | | This commit adds a new builtin, __builtin_bit_cast(T, v), which performs a bit_cast from a value v to a type T. This expression can be evaluated at compile time under specific circumstances. The compile time evaluation currently doesn't support bit-fields, but I'm planning on fixing this in a follow up (some of the logic for figuring this out is in CodeGen). I'm also planning follow-ups for supporting some more esoteric types that the constexpr evaluator supports, as well as extending __builtin_memcpy constexpr evaluation to use the same infrastructure. rdar://44987528 Differential revision: https://reviews.llvm.org/D62825 llvm-svn: 364954
* [Driver] Fix style issues of --print-supported-cpus after D63105Fangrui Song2019-06-291-5/+4
| | | | | | | | Reviewed By: ziangwan Differential Revision: https://reviews.llvm.org/D63822 llvm-svn: 364704
* [clang-scan-deps] Introduce the DependencyScanning library with theAlex Lorenz2019-06-262-114/+23
| | | | | | | | | | | | | thread worker code and better error handling This commit extracts out the code that will powers the fast scanning worker into a new file in a new DependencyScanning library. The error and output handling is improved so that the clients can gather errors/results from the worker directly. Differential Revision: https://reviews.llvm.org/D63681 llvm-svn: 364474
* Print NULL as "(null)" in diagnostic messageXing Xue2019-06-261-4/+6
| | | | | | | | | | | | | | | | | | | Summary: Passing a null pointer to the printf family for a %s format specifier leads to undefined behaviour. The tests currently expect (null). Explicitly test for a null pointer and provide the expected string. Authored By: andusy Reviewers: hubert.reinterpretcast, xingxue, jasonliu, daltenty, cebowleratibm Reviewed By: hubert.reinterpretcast Subscribers: arphaman, jsji, cfe-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63786 llvm-svn: 364462
* [clang-scan-deps] print the dependencies to stdoutAlex Lorenz2019-06-211-7/+58
| | | | | | | | and remove the need to use -MD options in the CDB Differential Revision: https://reviews.llvm.org/D63579 llvm-svn: 364088
* [git-clang-format] recognize hxx as a C++ fileMiklos Vajna2019-06-211-1/+1
| | | | | | | | | | | clangd, clang-tidy, etc does that already, no reason why git-clang-format should skip hxx files. Reviewed By: ilya-biryukov Differential Revision: https://reviews.llvm.org/D63621 llvm-svn: 364014
* git-clang-format: Remove trailing whitespace in docstring. NFC.Sam Clegg2019-06-191-13/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D62915 llvm-svn: 363759
* [Clang] Rename -split-dwarf-file to -split-dwarf-outputAaron Puchert2019-06-151-6/+6
| | | | | | | | | | | | | | | | | | Summary: This is the first in a series of changes trying to align clang -cc1 flags for Split DWARF with those of llc. The unfortunate side effect of having -split-dwarf-output for single file Split DWARF will disappear again in a subsequent change. The change is the result of a discussion in D59673. Reviewers: dblaikie, echristo Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D63130 llvm-svn: 363494
* Add --print-supported-cpus flag for clang.Ziang Wan2019-06-141-0/+25
| | | | | | | | | | | | This patch allows clang users to print out a list of supported CPU models using clang [--target=<target triple>] --print-supported-cpus Then, users can select the CPU model to compile to using clang --target=<triple> -mcpu=<model> a.c It is a handy feature to help cross compilation. llvm-svn: 363464
* [clang-scan-deps] Fix -DBUILD_SHARED_LIBS=ON buildSam Clegg2019-06-131-0/+1
| | | | | | | | The -DBUILD_SHARED_LIBS=ON build was broken in rL363204 Differential Revision: https://reviews.llvm.org/D63245 llvm-svn: 363238
* clang-format extension: Widen the supported versions rangeHans Wennborg2019-06-131-1/+1
| | | | | | | | So that it covers also the latest VS 2019 version. By Antonio Maiorano! llvm-svn: 363230
* [clang-scan-deps] Include <mutex> in ClangScanDeps.cpp to ensure itAlex Lorenz2019-06-121-0/+1
| | | | | | builds on all platforms llvm-svn: 363208
* NFC, Update the ClangScanDeps.cpp file's license commentAlex Lorenz2019-06-121-5/+4
| | | | | | | The file ClangScanDeps.cpp from r363204 had the old outdated LLVM license comment at the top of the file that I committed by accident. llvm-svn: 363207
* NFC, fixup indentation in CMakeLists.txt from r363204 as requestedAlex Lorenz2019-06-121-3/+3
| | | | | | | | | in the review. I missed that review comment from https://reviews.llvm.org/D60233 in the original commit. llvm-svn: 363205
* [clang-scan-deps] initial outline of the tool that runs preprocessor to findAlex Lorenz2019-06-123-0/+245
| | | | | | | | | | | | | | | | | | | | | | | dependencies over a JSON compilation database This commit introduces an outline for the clang-scan-deps tool that will be used to implement fast dependency discovery phase using implicit modules for explicit module builds. The initial version of the tool works by computing non-modular header dependencies for files in the compilation database without any optimizations (i.e. without source minimization from r362459). The tool spawns a number of worker threads to run the clang compiler workers in parallel. The immediate goal for clang-scan-deps is to create a ClangScanDeps library which will be used to build up this tool to use the source minimization and caching multi-threaded filesystem to implement the optimized non-incremental dependency scanning phase for a non-modular build. This will allow us to do benchmarks and comparisons for performance that the minimization and caching give us Differential Revision: https://reviews.llvm.org/D60233 llvm-svn: 363204
* [libclang] Allow skipping warnings from all included filesNikolai Kosjar2019-06-114-5/+15
| | | | | | | | | | | | Depending on the included files and the used warning flags, e.g. - Weverything, a huge number of warnings can be reported for included files. As processing that many diagnostics comes with a performance impact and not all clients are interested in those diagnostics, add a flag to skip them. Differential Revision: https://reviews.llvm.org/D48116 llvm-svn: 363067
* Make sure a test from r363036 does not write into a working directoryIlya Biryukov2019-06-111-0/+2
| | | | | | | | | | It breaks if build directory is not writable. This change is required to fix our integrate. Also add a flush() call, otherwise time trace option does not produce the full output. llvm-svn: 363052
* [Support][Test] Time profiler: add regression testAnton Afanasyev2019-06-111-0/+5
| | | | | | | | | | | | | | | | | | Summary: Add output to `llvm::errs()` when `-ftime-trace` option is enabled, add regression test checking this option works as expected. Reviewers: thakis, aganea Subscribers: cfe-commits, llvm-commits Tags: #clang, #llvm This is recommit of r362821 Differential Revision: https://reviews.llvm.org/D61914 llvm-svn: 363036
* Revert "[Support][Test] Time profiler: add regression test"Anton Afanasyev2019-06-071-5/+0
| | | | | | | This reverts commit 44282a60c90fdded249d57d91b12c6c0907102ec. This breaks buildbot. llvm-svn: 362824
* [Support][Test] Time profiler: add regression testAnton Afanasyev2019-06-071-0/+5
| | | | | | | | | | | | | | | | | | Summary: Add output to `llvm::errs()` when `-ftime-trace` option is enabled, add regression test checking this option works as expected. Reviewers: thakis, aganea Subscribers: cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61914 > llvm-svn: 362792 llvm-svn: 362821
* Revert rL362792 : [Support][Test] Time profiler: add regression testSimon Pilgrim2019-06-071-5/+0
| | | | | | | | | | | | | | | | | | Summary: Add output to `llvm::errs()` when `-ftime-trace` option is enabled, add regression test checking this option works as expected. Reviewers: thakis, aganea Subscribers: cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61914 ........ Breaks buildbots - @anton-afanasyev please can you take a look? llvm-svn: 362816
* Build with _XOPEN_SOURCE defined on AIXDavid Tenty2019-06-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open and POSIX compatibility mode, to work around stray macros and other bugs in the headers provided by the system and build compiler. This patch adds the config to cmake to build with _XOPEN_SOURCE defined on AIX with a few exceptions. Google Test internals require access to platform specific thread info constructs on AIX so in that case we build with _ALL_SOURCE defined instead. Libclang also uses header which needs _ALL_SOURCE on AIX so we leave that as is as well. We also add building on AIX with the large file API and doing CMake header checks with X/OPEN definitions so the results are consistent with the environment that will be present in the build. Reviewers: hubert.reinterpretcast, xingxue, andusy Reviewed By: hubert.reinterpretcast Subscribers: mgorny, jsji, cfe-commits, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62533 llvm-svn: 362808
* [Support][Test] Time profiler: add regression testAnton Afanasyev2019-06-071-0/+5
| | | | | | | | | | | | | | | | Summary: Add output to `llvm::errs()` when `-ftime-trace` option is enabled, add regression test checking this option works as expected. Reviewers: thakis, aganea Subscribers: cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61914 llvm-svn: 362792
* Add Attribute NoThrow as an Exception Specifier TypeErich Keane2019-05-301-0/+2
| | | | | | | | | | | | | | | In response to https://bugs.llvm.org/show_bug.cgi?id=33235, it became clear that the current mechanism of hacking through checks for the exception specification of a function gets confused really quickly when there are alternate exception specifiers. This patch introcues EST_NoThrow, which is the equivilent of EST_noexcept when caused by EST_noThrow. The existing implementation is left in place to cover functions with no FunctionProtoType. Differential Revision: https://reviews.llvm.org/D62435 llvm-svn: 362119
* Rename clangToolingRefactor to clangToolingRefactoring for consistency with ↵Nico Weber2019-05-252-2/+2
| | | | | | | | | | its directory See "[cfe-dev] The name of clang/lib/Tooling/Refactoring". Differential Revision: https://reviews.llvm.org/D62420 llvm-svn: 361684
* Fix target property to make BUILD_SHARED_LIBS workChris Bieneman2019-05-211-1/+1
| | | | | | | | Public and Private link libraries get merged in the LINK_LIBRARIES property instead of being kept separate. With any luck this will get `BUILD_SHARED_LIBS` working again on Linux. llvm-svn: 361334
* [CMake] One more stab at fixing BUILD_SHARED_LIBSChris Bieneman2019-05-211-0/+1
| | | | | | If clang's libraries are build SHARED, we need to grab their `PRIVATE_LINK_LIBRARIES` properties and add those to clang_shared's interface. llvm-svn: 361275
* [libclang] visit c++14 lambda capture init expressionsNikolai Kosjar2019-05-211-2/+6
| | | | | | | | Patch by Milian Wolff. Differential Revision: https://reviews.llvm.org/D60672 llvm-svn: 361234
* [ClangFormat] Editor integrations inherit default style from clang-format binarySam McCall2019-05-174-8/+11
| | | | | | | | | | | | | | | | Summary: This allows downstream customizations to the default style to work without needing to also modify the editor integrations. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49719 llvm-svn: 360996
* Re-land: Add Clang shared library with C++ exportsChris Bieneman2019-05-173-0/+22
| | | | | | | | | Summary: This patch adds a libClang_shared library on *nix systems which exports the entire C++ API. In order to support this on Windows we should really refactor llvm-shlib and share code between the two. This also uses a slightly different method for generating the shared library, which I should back-port to llvm-shlib. Instead of linking the static archives and passing linker flags to force loading the whole libraries, this patch creates object libraries for every library (which has no cost in the build system), and link the object libraries. llvm-svn: 360985
* Revert r360946 "Add Clang shared library with C++ exports"Nico Weber2019-05-173-17/+0
| | | | | | | | It breaks LLVM_ENABLE_PIC=OFF builds, and it's not clear if the object library approach doesn't impact the normal clang binary. llvm-svn: 360973
* Add Clang shared library with C++ exportsChris Bieneman2019-05-163-0/+17
| | | | | | | | | | | | | | | | | Summary: This patch adds a libClang_shared library on *nix systems which exports the entire C++ API. In order to support this on Windows we should really refactor llvm-shlib and share code between the two. This also uses a slightly different method for generating the shared library, which I should back-port to llvm-shlib. Instead of linking the static archives and passing linker flags to force loading the whole libraries, this patch creates object libraries for every library (which has no cost in the build system), and link the object libraries. Reviewers: tstellar, winksaville Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61909 llvm-svn: 360946
* Implement __builtin_LINE() et. al. to support source location capture.Eric Fiselier2019-05-161-0/+1
| | | | | | | | | | | | | | | | | Summary: This patch implements the source location builtins `__builtin_LINE(), `__builtin_FUNCTION()`, `__builtin_FILE()` and `__builtin_COLUMN()`. These builtins are needed to implement [`std::experimental::source_location`](https://rawgit.com/cplusplus/fundamentals-ts/v2/main.html#reflection.src_loc.creation). With the exception of `__builtin_COLUMN`, GCC also implements these builtins, and Clangs behavior is intended to match as closely as possible. Reviewers: rsmith, joerg, aaron.ballman, bogner, majnemer, shafik, martong Reviewed By: rsmith Subscribers: rnkovacs, loskutov, riccibruno, mgorny, kunitoki, alexr, majnemer, hfinkel, cfe-commits Differential Revision: https://reviews.llvm.org/D37035 llvm-svn: 360937
* Recommit [Object] Change object::SectionRef::getContents() to return ↵Fangrui Song2019-05-161-4/+7
| | | | | | | | | | | | Expected<StringRef> r360876 didn't fix 2 call sites in clang. Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now. Follow-up of D61781. llvm-svn: 360892
* Temporarily revert "Change -gz and -Wa,--compress-debug-sections to use gABI ↵Eric Christopher2019-05-141-1/+2
| | | | | | | | | | | | | compression (SHF_COMPRESSED)" This affects users of older (pre 2.26) binutils in such a way that they can't necessarily work around it as it doesn't support the compress option on the command line. Reverting to unblock them and we can revisit whether to make this change now or fix how we want to express the option. This reverts commit bdb21337e6e1732c9895966449c33c408336d295/r360403. llvm-svn: 360703
* Introduce the ability to dump the AST to JSON.Aaron Ballman2019-05-132-5/+6
| | | | | | This adds the -ast-dump=json cc1 flag (in addition to -ast-dump=default, which is the default if no dump format is specified), as well as some initial AST dumping functionality and tests. llvm-svn: 360622
* [libclang] Forward isInline for NamespaceDecl to libclangNikolai Kosjar2019-05-103-0/+16
| | | | llvm-svn: 360428
* Change -gz and -Wa,--compress-debug-sections to use gABI compression ↵Fangrui Song2019-05-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | (SHF_COMPRESSED) Since July 15, 2015 (binutils-gdb commit 19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas --compress-debug-sections=zlib (gcc -gz) means zlib-gabi: SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug). clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It is 2019 now and it is not unreasonable to assume users of the new feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661). Change clang's default accordingly to improve standard conformance. zlib-gnu becomes out of fashion and gets poorer toolchain support. Its mangled names confuse tools and are more likely to cause problems. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D61689 llvm-svn: 360403
* [c++20] Implement P0846R0: allow (ADL-only) calls to template-ids whoseRichard Smith2019-05-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | template name is not visible to unqualified lookup. In order to support this without a severe degradation in our ability to diagnose typos in template names, this change significantly restructures the way we handle template-id-shaped syntax for which lookup of the template name finds nothing. Instead of eagerly diagnosing an undeclared template name, we now form a placeholder template-name representing a name that is known to not find any templates. When the parser sees such a name, it attempts to disambiguate whether we have a less-than comparison or a template-id. Any diagnostics or typo-correction for the name are delayed until its point of use. The upshot should be a small improvement of our diagostic quality overall: we now take more syntactic context into account when trying to resolve an undeclared identifier on the left hand side of a '<'. In fact, this works well enough that the backwards-compatible portion (for an undeclared identifier rather than a lookup that finds functions but no function templates) is enabled in all language modes. llvm-svn: 360308
OpenPOWER on IntegriCloud