summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r367649: Improve raw_ostream so that you can "write" colors using ↵Rui Ueyama2019-08-021-4/+0
| | | | | | | | operator<< This reverts commit r367649 in an attempt to unbreak Windows bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367658 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve raw_ostream so that you can "write" colors using operator<<Rui Ueyama2019-08-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. raw_ostream supports ANSI colors so that you can write messages to the termina with colors. Previously, in order to change and reset color, you had to call `changeColor` and `resetColor` functions, respectively. So, if you print out "error: " in red, for example, you had to do something like this: OS.changeColor(raw_ostream::RED); OS << "error: "; OS.resetColor(); With this patch, you can write the same code as follows: OS << raw_ostream::RED << "error: " << raw_ostream::RESET; 2. Add a boolean flag to raw_ostream so that you can disable colored output. If you disable colors, changeColor, operator<<(Color), resetColor and other color-related functions have no effect. Most LLVM tools automatically prints out messages using colors, and you can disable it by passing a flag such as `--disable-colors`. This new flag makes it easy to write code that works that way. Differential Revision: https://reviews.llvm.org/D65564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367649 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Rename lang mode flag for C++ modeAnastasia Stulova2019-07-251-1/+1
| | | | | | | | | | | | | | | Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++ or -std=clc++/-std=CLC++. This aligns with OpenCL C conversion and removes ambiguity with OpenCL C++. Differential Revision: https://reviews.llvm.org/D65102 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367008 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Fix `-ftime-trace-granularity` optionAnton Afanasyev2019-07-241-0/+2
| | | | | | | | | | | | | | | | Summary: Move `-ftime-trace-granularity` option to frontend options. Without patch this option is showed up in the help for any tool that links libSupport. Reviewers: sammccall Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65202 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366911 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Replace cc1 options '-mdisable-fp-elim' and '-momit-leaf-frame-pointer'Yuanfang Chen2019-07-201-3/+26
| | | | | | | | | | | | | | | | with '-mframe-pointer' After D56351 and D64294, frame pointer handling is migrated to tri-state (all, non-leaf, none) in clang driver and on the function attribute. This patch makes the frame pointer handling cc1 option tri-state. Reviewers: chandlerc, rnk, t.p.northover, MaskRay Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D56353 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366645 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Support -mabi=ieeelongdouble and -mabi=ibmlongdoubleFangrui Song2019-07-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc PowerPC supports 3 representations of long double: * -mlong-double-64 long double has the same representation of double but is mangled as `e`. In clang, this is the default on AIX, FreeBSD and Linux musl. * -mlong-double-128 2 possible 128-bit floating point representations: + -mabi=ibmlongdouble IBM extended double format. Mangled as `g` In clang, this is the default on Linux glibc. + -mabi=ieeelongdouble IEEE 754 quadruple-precision format. Mangled as `u9__ieee128` (`U10__float128` before gcc 8.2) This is currently unavailable. This patch adds -mabi=ibmlongdouble and -mabi=ieeelongdouble, and thus makes the IEEE 754 quadruple-precision long double available for languages supported by clang. Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D64283 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366044 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86][PowerPC] Support -mlong-double-128Fangrui Song2019-07-121-1/+3
| | | | | | | | | | | | | | | This patch makes the driver option -mlong-double-128 available for X86 and PowerPC. The CC1 option -mlong-double-128 is available on all targets for users to test on unsupported targets. On PowerPC, -mlong-double-128 uses the IBM extended double format because we don't support -mabi=ieeelongdouble yet (D64283). Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D64277 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365866 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86][PPC] Support -mlong-double-64Fangrui Song2019-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | -mlong-double-64 is supported on some ports of gcc (i386, x86_64, and ppc{32,64}). On many other targets, there will be an error: error: unrecognized command line option '-mlong-double-64' This patch makes the driver option -mlong-double-64 available for x86 and ppc. The CC1 option -mlong-double-64 is available on all targets for users to test on unsupported targets. LongDoubleSize is added as a VALUE_LANGOPT so that the option can be shared with -mlong-double-128 when we support it in clang. Also, make powerpc*-linux-musl default to use 64-bit long double. It is currently the only supported ABI on musl and is also how people configure powerpc*-linux-musl-gcc. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D64067 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365412 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add a debug analyzer config to place an event for each tracked ↵Kristof Umann2019-07-051-0/+4
| | | | | | | | condition Differential Revision: https://reviews.llvm.org/D63642 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365208 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Fix style issues of --print-supported-cpus after D63105Fangrui Song2019-06-291-1/+1
| | | | | | | | Reviewed By: ziangwan Differential Revision: https://reviews.llvm.org/D63822 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364704 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarfAaron Puchert2019-06-261-17/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: The changes in D59673 made the choice redundant, since we can achieve single-file split DWARF just by not setting an output file name. Like llc we can also derive whether to enable Split DWARF from whether -split-dwarf-file is set, so we don't need the flag at all anymore. The test CodeGen/split-debug-filename.c distinguished between having set or not set -enable-split-dwarf with -split-dwarf-file, but we can probably just always emit the metadata into the IR. The flag -split-dwarf wasn't used at all anymore. Reviewers: dblaikie, echristo Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D63167 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364479 91177308-0d34-0410-b5e6-96231b3b80d8
* [CC1Option] Add the option to enable the debug entry valuesDjordje Todorovic2019-06-261-0/+7
| | | | | | | | | | | | | | | | | | | | | The option enables debug info about parameter's entry values. The example of using the option: clang -g -O2 -Xclang -femit-debug-entry-values test.c In addition, when the option is set add the flag all_call_sites in a subprogram in order to support GNU extension as well. ([3/13] Introduce the debug entry values.) Co-authored-by: Ananth Sowda <asowda@cisco.com> Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com> Co-authored-by: Ivan Baev <ibaev@cisco.com> Differential Revision: https://reviews.llvm.org/D58033 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364399 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-ifs] Clang Interface Stubs, first version (second landing attempt).Puyan Lotfi2019-06-201-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change reverts r363649; effectively re-landing r363626. At this point clang::Index::CodegenNameGeneratorImpl has been refactored into clang::AST::ASTNameGenerator. This makes it so that the previous circular link dependency no longer exists, fixing the previous share lib (-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649. Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Currently clang-ifs produces .ifs files that can be thought of as analogous to object (.o) files, but just for the mangled symbol info. In a subsequent patch I intend to add support for merging the .ifs files into one .ifs/.ifso file that can be the input to something like llvm-elfabi to produce something like a .so file or .dll (but without any of the code, just symbols). Differential Revision: https://reviews.llvm.org/D60974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363948 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Split type and macro definitions into opencl-c-base.hSven van Haastregt2019-06-191-2/+8
| | | | | | | | | | | | | | | | Using the -fdeclare-opencl-builtins option will require a way to predefine types and macros such as `int4`, `CLK_GLOBAL_MEM_FENCE`, etc. Move these out of opencl-c.h into opencl-c-base.h such that the latter can be shared by -fdeclare-opencl-builtins and -finclude-default-header. This changes the behaviour of -finclude-default-header when -fdeclare-opencl-builtins is specified: instead of including the full header, it will include the header with only the base definitions. Differential revision: https://reviews.llvm.org/D63256 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363794 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert D60974 "[clang-ifs] Clang Interface Stubs, first version."Fangrui Song2019-06-181-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit rC363626. clangIndex depends on clangFrontend. r363626 adds a dependency from clangFrontend to clangIndex, which creates a circular dependency. This is disallowed by -DBUILD_SHARED_LIBS=on builds: CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle): "clangFrontend" of type SHARED_LIBRARY depends on "clangIndex" (weak) "clangIndex" of type SHARED_LIBRARY depends on "clangFrontend" (weak) At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries. Note, the dependency on clangIndex cannot be removed because libclangFrontend.so is linked with -Wl,-z,defs: a shared object must have its full direct dependencies specified on the linker command line. In -DBUILD_SHARED_LIBS=off builds, this appears to work when linking `bin/clang-9`. However, it can cause trouble to downstream clang library users. The llvm build system links libraries this way: clang main_program_object_file ... lib/libclangIndex.a ... lib/libclangFrontend.a -o exe libclangIndex.a etc are not wrapped in --start-group. If the downstream application depends on libclangFrontend.a but not any other clang libraries that depend on libclangIndex.a, this can cause undefined reference errors when the linker is ld.bfd or gold. The proper fix is to not include clangIndex files in clangFrontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363649 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-ifs] Clang Interface Stubs, first version.Puyan Lotfi2019-06-171-0/+21
| | | | | | | | | | | | | | | | | | | | | | Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Differential Revision: https://reviews.llvm.org/D60974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363626 91177308-0d34-0410-b5e6-96231b3b80d8
* [Remarks] Extend -fsave-optimization-record to specify the formatFrancis Visoiu Mistrih2019-06-171-0/+5
| | | | | | | | | Use -fsave-optimization-record=<format> to specify a different format than the default, which is YAML. For now, only YAML is supported. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363573 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Harmonize Split DWARF options with llcAaron Puchert2019-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: With Split DWARF the resulting object file (then called skeleton CU) contains the file name of another ("DWO") file with the debug info. This can be a problem for remote compilation, as it will contain the name of the file on the compilation server, not on the client. To use Split DWARF with remote compilation, one needs to either * make sure only relative paths are used, and mirror the build directory structure of the client on the server, * inject the desired file name on the client directly. Since llc already supports the latter solution, we're just copying that over. We allow setting the actual output filename separately from the value of the DW_AT_[GNU_]dwo_name attribute in the skeleton CU. Fixes PR40276. Reviewers: dblaikie, echristo, tejohnson Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D59673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363496 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang] Rename -split-dwarf-file to -split-dwarf-outputAaron Puchert2019-06-151-1/+1
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363494 91177308-0d34-0410-b5e6-96231b3b80d8
* Add --print-supported-cpus flag for clang.Ziang Wan2019-06-141-0/+1
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363464 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add werror flag for analyzer warningsKeno Fischer2019-06-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: We're using the clang static analyzer together with a number of custom analyses in our CI system to ensure that certain invariants are statiesfied for by the code every commit. Unfortunately, there currently doesn't seem to be a good way to determine whether any analyzer warnings were emitted, other than parsing clang's output (or using scan-build, which then in turn parses clang's output). As a simpler mechanism, simply add a `-analyzer-werror` flag to CC1 that causes the analyzer to emit its warnings as errors instead. I briefly tried to have this be `Werror=analyzer` and make it go through that machinery instead, but that seemed more trouble than it was worth in terms of conflicting with options to the actual build and special cases that would be required to circumvent the analyzers usual attempts to quiet non-analyzer warnings. This is simple and it works well. Reviewed-By: NoQ, Szelethusw Differential Revision: https://reviews.llvm.org/D62885 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362855 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver, IRGen: Set partitions on GlobalValues according to ↵Peter Collingbourne2019-06-071-0/+2
| | | | | | | | -fsymbol-partition flag. Differential Revision: https://reviews.llvm.org/D62636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362829 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for vectorization using MASSV (IBM MASS vector library)Nemanja Ivanovic2019-06-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Part 2 (the Clang portion) of D59881. This patch (first of two patches) enables the vectorizer to recognize the IBM MASS vector library routines. This patch specifically adds support for recognizing the -vector-library=MASSV option, and defines mappings from IEEE standard scalar math functions to generic PowerPC MASS vector counterparts. For instance, the generic PowerPC MASS vector entry for double-precision cbrt function is __cbrtd2_massv. The second patch will further lower the generic PowerPC vector entries to PowerPC subtarget-specific entries. For instance, the PowerPC generic entry cbrtd2_massv is lowered to cbrtd2_P9 for Power9 subtarget. The overall support for MASS vector library is presented as such in two patches for ease of review. Patch by Jeeva Paudel. Differential revision: https://reviews.llvm.org/D59881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362571 91177308-0d34-0410-b5e6-96231b3b80d8
* Add clang source minimizer that reduces source to directivesAlex Lorenz2019-06-031-0/+5
| | | | | | | | | | | | | | | | | | | | | that might affect the dependency list for a compilation This commit introduces a dependency directives source minimizer to clang that minimizes header and source files to the minimum necessary preprocessor directives for evaluating includes. It reduces the source down to #define, #include, The source minimizer works by lexing the input with a custom fast lexer that recognizes the preprocessor directives it cares about, and emitting those directives in the minimized source. It ignores source code, comments, and normalizes whitespace. It gives up and fails if seems any directives that it doesn't recognize as valid (e.g. #define 0). In addition to the source minimizer this patch adds a -print-dependency-directives-minimized-source CC1 option that allows you to invoke the minimizer from clang directly. Differential Revision: https://reviews.llvm.org/D55463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362459 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Declare builtin functions using TableGenSven van Haastregt2019-06-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch adds a `-fdeclare-opencl-builtins` command line option to the clang frontend. This enables clang to verify OpenCL C builtin function declarations using a fast StringMatcher lookup, instead of including the opencl-c.h file with the `-finclude-default-header` option. This avoids the large parse time penalty of the header file. This commit only adds the basic infrastructure and some of the OpenCL builtins. It does not cover all builtins defined by the various OpenCL specifications. As such, it is not a replacement for `-finclude-default-header` yet. RFC: http://lists.llvm.org/pipermail/cfe-dev/2018-November/060041.html Co-authored-by: Pierre Gondois Co-authored-by: Joey Gouly Co-authored-by: Sven van Haastregt Differential Revision: https://reviews.llvm.org/D60763 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362371 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] List checker/plugin options in 3 categories: released, alpha, ↵Kristof Umann2019-05-231-0/+4
| | | | | | | | | | | | developer Same patch as D62093, but for checker/plugin options, the only difference being that options for alpha checkers are implicitly marked as alpha. Differential Revision: https://reviews.llvm.org/D62093 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361566 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Hide developer-only checker/package options by defaultKristof Umann2019-05-231-0/+2
| | | | | | | | | These options are now only visible under -analyzer-checker-option-help-developer. Differential Revision: https://reviews.llvm.org/D61839 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361561 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] List checkers in 3 categories: released, alpha, developerKristof Umann2019-05-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the only way to display the list of available checkers was to invoke the analyzer with -analyzer-checker-help frontend flag. This however wasn't really great from a maintainer standpoint: users came across checkers meant strictly for development purposes that weren't to be tinkered with, or those that were still in development. This patch creates a clearer division in between these categories. From now on, we'll have 3 flags to display the list checkers. These lists are mutually exclusive and can be used in any combination (for example to display both stable and alpha checkers). -analyzer-checker-help: Displays the list for stable, production ready checkers. -analyzer-checker-help-alpha: Displays the list for in development checkers. Enabling is discouraged for non-development purposes. -analyzer-checker-help-developer: Modeling and debug checkers. Modeling checkers shouldn't be enabled/disabled by hand, and debug checkers shouldn't be touched by users. Differential Revision: https://reviews.llvm.org/D62093 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361558 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add a new frontend flag to display all checker optionsKristof Umann2019-05-231-0/+1
| | | | | | | | | Add the new frontend flag -analyzer-checker-option-help to display all checker/package options. Differential Revision: https://reviews.llvm.org/D57858 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361552 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM][CMSE] Add commandline option and feature macroJaved Absar2019-05-211-0/+1
| | | | | | | | | | | | | Defines macro ARM_FEATURE_CMSE to 1 for v8-M targets and introduces -mcmse option which for v8-M targets sets ARM_FEATURE_CMSE to 3. A diagnostic is produced when the option is given on architectures without support for Security Extensions. Reviewed By: dmgreen, snidertm Differential Revision: https://reviews.llvm.org/D59879 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361261 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360703 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new language mode for C2x; enable [[attribute]] support by default in C2x.Aaron Ballman2019-05-141-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360667 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce the ability to dump the AST to JSON.Aaron Ballman2019-05-131-2/+18
| | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360622 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360403 91177308-0d34-0410-b5e6-96231b3b80d8
* [SPIR] Simplified target checking.Anastasia Stulova2019-05-091-3/+1
| | | | | | | | | | | | Switched to Triple::isSPIR() helper to simplify code. Patch by kpet (Kevin Petit)! Differential revision: https://reviews.llvm.org/D61639 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360325 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Don't display implementation checkers under ↵Kristof Umann2019-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | -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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359720 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer][NFC] Reimplement checker optionsKristof Umann2019-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TL;DR: * Add checker and package options to the TableGen files * Added a new class called CmdLineOption, and both Package and Checker recieved a list<CmdLineOption> field. * Added every existing checker and package option to Checkers.td. * The CheckerRegistry class * Received some comments to most of it's inline classes * Received the CmdLineOption and PackageInfo inline classes, a list of CmdLineOption was added to CheckerInfo and PackageInfo * Added addCheckerOption and addPackageOption * Added a new field called Packages, used in addPackageOptions, filled up in addPackage Detailed description: In the last couple months, a lot of effort was put into tightening the analyzer's command line interface. The main issue is that it's spectacularly easy to mess up a lenghty enough invocation of the analyzer, and the user was given no warnings or errors at all in that case. We can divide the effort of resolving this into several chapters: * Non-checker analyzer configurations: Gather every analyzer configuration into a dedicated file. Emit errors for non-existent configurations or incorrect values. Be able to list these configurations. Tighten AnalyzerOptions interface to disallow making such a mistake in the future. * Fix the "Checker Naming Bug" by reimplementing checker dependencies: When cplusplus.InnerPointer was enabled, it implicitly registered unix.Malloc, which implicitly registered some sort of a modeling checker from the CStringChecker family. This resulted in all of these checker objects recieving the name "cplusplus.InnerPointer", making AnalyzerOptions asking for the wrong checker options from the command line: cplusplus.InnerPointer:Optimisic istead of unix.Malloc:Optimistic. This was resolved by making CheckerRegistry responsible for checker dependency handling, instead of checkers themselves. * Checker options: (this patch included!) Same as the first item, but for checkers. (+ minor fixes here and there, and everything else that is yet to come) There were several issues regarding checker options, that non-checker configurations didn't suffer from: checker plugins are loaded runtime, and they could add new checkers and new options, meaning that unlike for non-checker configurations, we can't collect every checker option purely by generating code. Also, as seen from the "Checker Naming Bug" issue raised above, they are very rarely used in practice, and all sorts of skeletons fell out of the closet while working on this project. They were extremely problematic for users as well, purely because of how long they were. Consider the following monster of a checker option: alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=false While we were able to verify whether the checker itself (the part before the colon) existed, any errors past that point were unreported, easily resulting in 7+ hours of analyses going to waste. This patch, similarly to how dependencies were reimplemented, uses TableGen to register checker options into Checkers.td, so that Checkers.inc now contains entries for both checker and package options. Using the preprocessor, Checkers.inc is converted into code in CheckerRegistry, adding every builtin (checkers and packages that have an entry in the Checkers.td file) checker and package option to the registry. The new addPackageOption and addCheckerOption functions expose the same functionality to statically-linked non-builtin and plugin checkers and packages as well. Emitting errors for incorrect user input, being able to list these options, and some other functionalies will land in later patches. Differential Revision: https://reviews.llvm.org/D57855 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358752 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++20] Implement context-sensitive header-name lexing and pp-import parsing ↵Richard Smith2019-04-111-2/+7
| | | | | | in the preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358231 91177308-0d34-0410-b5e6-96231b3b80d8
* Range-style std::find{,_if} -> llvm::find{,_if}. NFCFangrui Song2019-03-311-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357359 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds `-ftime-trace` option to clang that produces Chrome `chrome://tracing` ↵Anton Afanasyev2019-03-301-0/+1
| | | | | | | | | | | | | | compatible JSON profiling output dumps. This change adds hierarchical "time trace" profiling blocks that can be visualized in Chrome, in a "flame chart" style. Each profiling block can have a "detail" string that for example indicates the file being processed, template name being instantiated, function being optimized etc. This is taken from GitHub PR: https://github.com/aras-p/llvm-project-20170507/pull/2 Patch by Aras Pranckevičius. Differential Revision: https://reviews.llvm.org/D58675 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357340 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 Original llvm-svn: 355964 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355984 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-121-5/+0
| | | | | | This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355976 91177308-0d34-0410-b5e6-96231b3b80d8
* [Remarks] Add -foptimization-record-passes to filter remark emissionFrancis Visoiu Mistrih2019-03-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355964 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Clang part of change for context-sensitive PGO (part1)Rong Xu2019-03-041-3/+7
| | | | | | | | | | | | Part 1 of CSPGO change in Clang. This includes changes in clang options and calls to llvm PassManager. Tests will be committed in part2. This change needs the PassManager change in llvm. Differential Revision: https://reviews.llvm.org/D54176 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355331 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-03-011-1/+1
| | | | | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot. Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355190 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r354873 as this breaks lldb builds.Pierre Gousseau2019-02-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354875 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-02-261-1/+1
| | | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354873 91177308-0d34-0410-b5e6-96231b3b80d8
* [SYCL] Add clang front-end option to enable SYCL device compilation flow.Alexey Bader2019-02-251-0/+2
| | | | | | Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354773 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable coroutines under -std=c++2a.Richard Smith2019-02-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354736 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP][NVPTX]Use faster teams reduction algorithm.Alexey Bataev2019-02-201-0/+3
| | | | | | | A faster way to reduce the values in teams reductions was found, the codegen is updated to use this faster algorithm and new runtime functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354479 91177308-0d34-0410-b5e6-96231b3b80d8