summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP50]Fix possible conflict when emitting an alias for the functionsAlexey Bataev2019-12-122-1/+50
| | | | | | | in declare variant. If the types of the fnction are not equal, but match, at the codegen thei may have different types. This may lead to compiler crash.
* [LTO] Support for embedding bitcode section during LTOTeresa Johnson2019-12-122-119/+78
| | | | | | | | | | | | | | | | | | | Summary: This adds support for embedding bitcode in a binary during LTO. The libLTO gains supports the `-lto-embed-bitcode` flag. The option allows users of the LTO library to embed a bitcode section. For example, LLD can pass the option via `ld.lld -mllvm=-lto-embed-bitcode`. This feature allows doing something comparable to `clang -c -fembed-bitcode`, but on the (LTO) linker level. Having bitcode alongside native code has many use-cases. To give an example, the MacOS linker can create a `-bitcode_bundle` section containing bitcode. Also, having this feature built into LLVM is an alternative to 3rd party tools such as [[ https://github.com/travitch/whole-program-llvm | wllvm ]] or [[ https://github.com/SRI-CSL/gllvm | gllvm ]]. As with these tools, this feature simplifies creating "whole-program" llvm bitcode files, but in contrast to wllvm/gllvm it does not rely on a specific llvm frontend/driver. Patch by Josef Eisl <josef.eisl@oracle.com> Reviewers: #llvm, #clang, rsmith, pcc, alexshap, tejohnson Reviewed By: tejohnson Subscribers: tejohnson, mehdi_amini, inglorion, hiraditya, aheejin, steven_wu, dexonsmith, dang, cfe-commits, llvm-commits, #llvm, #clang Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68213
* [OPENMP50]Improve checks for declare variant functions compatibility.Alexey Bataev2019-12-125-19/+69
| | | | | Added check for functions compatibility in C and removed restriction for functions with no prototypes in declare variant constrcut.
* Suppress -Wwarn-unused-variables when we don't know the constructorErich Keane2019-12-122-0/+21
| | | | | | | | | | | | | | This warning is supposed to be suppressed when the constructor/destructor are non-trivial, since it might be a RAII type. However, if the type has a trivial destructor and the constructor hasn't been resolved (since it is called with dependent arguments), we were still warning. This patch suppresses the warning if the type could possibly have a be a non-trivial constructor call. Note that this does not take the arity of the constructors into consideration, so it might suppress the warning in cases where it isn't possible to call a non-trivial constructor.
* [PS4] Predefine the __SCE__ macro for the x86_64-scei-ps4 tripleWarren Ristow2019-12-122-0/+2
|
* Default to -fuse-init-arrayFangrui Song2019-12-1222-69/+61
| | | | | | | | | | | | | | | | | | | Very few ELF platforms still use .ctors/.dtors now. Linux (glibc: 1999-07), DragonFlyBSD, FreeBSD (2012-03) and Solaris have supported .init_array for many years. Some architectures like AArch64/RISC-V default to .init_array . GNU ld and gold can even convert .ctors to .init_array . It makes more sense to flip the CC1 default, and only uses -fno-use-init-array on platforms that don't support .init_array . For example, OpenBSD did not support DT_INIT_ARRAY before Aug 2016 (https://github.com/openbsd/src/commit/86fa57a2792c6374b0849dd7b818a11e676e60ba) I may miss some ELF platforms that still use .ctors, but their maintainers can easily diagnose such problems. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71393
* [ASTImporter] Support functions with placeholder return types ...Gabor Marton2019-12-125-15/+274
| | | | | | | | | | | | | | | Summary: Support functions with placeholder return types even in cases when the type is declared in the body of the function. Example: auto f() { struct X{}; return X(); } Reviewers: balazske, a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70819
* [clang] Turn -fno-builtin flag into an IR AttributeGuillaume Chatelet2019-12-123-41/+45
| | | | | | | | | | | | | | Summary: This is a follow up on https://reviews.llvm.org/D61634#1742154 to turn the clang driver -fno-builtin flag into an IR attribute. I also investigated pushing the attribute earlier on (in Sema) but it looks like this patch is simple and will cover all function calls. Reviewers: aaron.ballman, courbet Subscribers: cfe-commits, tejohnson Tags: #clang Differential Revision: https://reviews.llvm.org/D71193
* [Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilderGuillaume Chatelet2019-12-121-9/+9
| | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71420
* [ARM][CMSE] Add CMSE header and builtinsMomchil Velikov2019-12-128-0/+409
| | | | | | | | | | | | This is patch C2 as mentioned in RFC http://lists.llvm.org/pipermail/cfe-dev/2019-March/061834.html This adds CMSE builtin functions, and introduces arm_cmse.h header which has useful macros, functions, and data types for end-users of CMSE. Patch by Javed Absar. Diferential Revision: https://reviews.llvm.org/D70817
* [OpenMP][Test] Add check for aux-triple predefined macrosAlexey Bader2019-12-121-0/+5
| | | | | | | | | | | | | | Summary: Make sure that auxiliary target specific macros are defined in OpenMP mode. Reviewers: ABataev, jdoerfert Subscribers: guansong, ebevhan, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71413
* [Diagnsotics] Small Improvement on -Wmisleading-indentationTyker2019-12-122-5/+26
| | | | | | | | | | Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: xbolva00 Differential Revision: https://reviews.llvm.org/D71083
* [Analyzer][Docs][NFC] Add CodeChecker to the command line toolsGabor Marton2019-12-123-3/+143
| | | | | | | | We add a new common html file that documents the available command line tools. Also a new html is added for a brief description of CodeChecker, this way complementing scan-build. Differential Revision: https://reviews.llvm.org/D70439
* [Tooling/Syntax] Helpers to find spelled tokens touching a location.Sam McCall2019-12-124-0/+88
| | | | | | | | | | | | Summary: Useful when positions are used to target nodes, with before/after ambiguity. Reviewers: ilya-biryukov, kbobyrev Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71356
* [NFC] - Partially revert 9c48c2f9c477007234cGabor Buella2019-12-121-1/+1
|
* Temporarily Revert "[DataLayout] Fix occurrences that size and range of ↵Nicola Zaghen2019-12-121-2/+2
| | | | | | | | | pointers are assumed to be the same." This reverts commit 5f6208778ff92567c57d7c1e2e740c284d7e69a5. This caused failures in Transforms/PhaseOrdering/scev-custom-dl.ll const: Assertion `getBitWidth() == CR.getBitWidth() && "ConstantRange types don't agree!"' failed.
* [NFC] - Typo fix in test/CodeGenCXX/runtime-dllstorage.cppGabor Buella2019-12-121-5/+5
| | | | | | Reviewed By: Jim Differential Revision: https://reviews.llvm.org/D48921
* [DataLayout] Fix occurrences that size and range of pointers are assumed to ↵Nicola Zaghen2019-12-121-2/+2
| | | | | | | | | | | | be the same. GEP index size can be specified in the DataLayout, introduced in D42123. However, there were still places in which getIndexSizeInBits was used interchangeably with getPointerSizeInBits. This notably caused issues with Instcombine's visitPtrToInt; but the unit tests was incorrect, so this remained undiscovered. Differential Revision: https://reviews.llvm.org/D68328 Patch by Joseph Faulls!
* [Tooling] Move raw string literal out of a macro call. NFCIlya Biryukov2019-12-121-4/+7
| | | | Should fix buildbots with some older gcc versions.
* Fix an error in the block ABI documentation sample codeAkira Hatanaka2019-12-111-1/+1
| | | | rdar://problem/38663011
* [Syntax] Build nodes for simple cases of top level declarationsIlya Biryukov2019-12-124-4/+380
| | | | | | | | | | | | | | | | Summary: More complicated nodes (e.g. template declarations) will be implemented in the follow-up patches. Reviewers: gribozavr2 Reviewed By: gribozavr2 Subscribers: merge_guards_bot, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70856
* [OpenMP][Docs] Mark 5.0 features worked on and list 5.1 featuresJohannes Doerfert2019-12-121-2/+17
|
* [IR] Split out target specific intrinsic enums into separate headersReid Kleckner2019-12-114-2/+16
| | | | | | | | | | | | | | | | | | | | This has two main effects: - Optimizes debug info size by saving 221.86 MB of obj file size in a Windows optimized+debug build of 'all'. This is 3.03% of 7,332.7MB of object file size. - Incremental step towards decoupling target intrinsics. The enums are still compact, so adding and removing a single target-specific intrinsic will trigger a rebuild of all of LLVM. Assigning distinct target id spaces is potential future work. Part of PR34259 Reviewers: efriedma, echristo, MaskRay Reviewed By: echristo, MaskRay Differential Revision: https://reviews.llvm.org/D71320
* [Remarks][Driver] Ask for line tables when remarks are enabledFrancis Visoiu Mistrih2019-12-112-0/+11
| | | | | | | | | | | | | | | | Serialized remarks contain debug locations for each remark, by storing a file path, a line, and a column. Also, remarks support being embedded in a .dSYM bundle using a separate section in object files, that is found by `dsymutil` through the debug map. In order for tools to map addresses to source and display remarks in the source, we need line tables, and in order for `dsymutil` to find the object files containing the remark section, we need to keep the debug map around. Differential Revision: https://reviews.llvm.org/D71325
* [analyzer] Do not cache out on some shared implicit AST nodesGabor Horvath2019-12-118-18/+64
| | | | | | | | | | | Some AST nodes which stands for implicit initialization is shared. The analyzer will do the same evaluation on the same nodes resulting in the same state. The analyzer will "cache out", i.e. it thinks that it visited an already existing node in the exploded graph. This is not true in this case and we lose coverage. Since these nodes do not really require any processing from the analyzer we just omit them from the CFG. Differential Revision: https://reviews.llvm.org/D71371
* Revert "[clang][clang-scan-deps] Aggregate the full dependency information."Michael Spencer2019-12-118-648/+155
| | | | | | This reverts commit f978ea498309adaebab8fbf1cd6e520e7e0e11f1. It broke clang-ppc64be-linux, but not sure why yet.
* [OpenMP] Use the OpenMP-IR-BuilderJohannes Doerfert2019-12-1111-4/+73
| | | | | | | | | | | | | | | This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D69922
* [clang][clang-scan-deps] Aggregate the full dependency information.Michael Spencer2019-12-118-155/+648
| | | | Differential Revision: https://reviews.llvm.org/D70268
* Suppress false-positive -Wuninitialized warnings in the constructor of aRichard Smith2019-12-112-1/+10
| | | | templated but non-template class.
* Fix detection of __attribute__((may_alias)) to properly look throughRichard Smith2019-12-112-8/+34
| | | | | | | type sugar. We previously missed the attribute in a lot of cases in C++, because there's often other type sugar there (eg, ElaboratedType).
* [OPENMP50]Add if clause in teams distribute parallel for simd directive.Alexey Bataev2019-12-115-18/+50
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [WebAssembly] Add new `export_name` clang attribute for controlling wasm ↵Sam Clegg2019-12-116-0/+66
| | | | | | | | | | | | | | | | | | | | export names This is equivalent to the existing `import_name` and `import_module` attributes which control the import names in the final wasm binary produced by lld. This maps the existing This attribute currently requires a string rather than using the symbol name for a couple of reasons: 1. Avoid confusion with static and dynamic linking which is based on symbol name. Exporting a function from a wasm module using this directive is orthogonal to both static and dynamic linking. 2. Avoids name mangling. Differential Revision: https://reviews.llvm.org/D70520
* [analyzer] Escape symbols conjured into specific regions during a ↵Gabor Horvath2019-12-1111-50/+155
| | | | | | | | | | conservative EvalCall This patch introduced additional PointerEscape callbacks after conservative calls for output parameters. This should not really affect the current checkers but the upcoming FuchsiaHandleChecker relies on this heavily. Differential Revision: https://reviews.llvm.org/D71224
* [analyzer] LocalizationChecker: Fix a crash on synthesized accessor stubs.Artem Dergachev2019-12-112-1/+12
| | | | | | The checker was trying to analyze the body of every method in Objective-C @implementation clause but the sythesized accessor stubs that were introduced into it by 2073dd2d have no bodies.
* [analyzer] CStringChecker: Fix overly eager assumption that memcmp args overlap.Artem Dergachev2019-12-113-14/+43
| | | | | | | | | | | | | | | | | While analyzing code `memcmp(a, NULL, n);', where `a' has an unconstrained symbolic value, the analyzer was emitting a warning about the *first* argument being a null pointer, even though we'd rather have it warn about the *second* argument. This happens because CStringChecker first checks whether the two argument buffers are in fact the same buffer, in order to take the fast path. This boils down to assuming `a == NULL' to true. Then the subsequent check for null pointer argument "discovers" that `a' is null. Don't take the fast path unless we are *sure* that the buffers are the same. Otherwise proceed as normal. Differential Revision: https://reviews.llvm.org/D71322
* [analyzer] CStringChecker: Improve warning messages.Artem Dergachev2019-12-117-50/+55
| | | | Differential Revision: https://reviews.llvm.org/D71321
* [OPENMP50]Fix capturing of if condition in target parallel for simdAlexey Bataev2019-12-112-5/+9
| | | | | | | | directive. Fixed capturing of the if condition if no modifer was specified in this condition. Previously could capture it only in outer region and it could lead to a compiler crash.
* [OPENMP50]Add if clause in teams distribute simd directive.Alexey Bataev2019-12-116-21/+186
| | | | | | According to OpenMP 5.0, if clause can be used in for simd directive. If condition in the if clause if false, the non-vectorized version of the loop must be executed.
* [Support] Add TimeTraceScope constructor without detail argRussell Gallop2019-12-116-11/+10
| | | | | | | This simplifies code where no extra details are required Also don't write out detail when it is empty. Differential Revision: https://reviews.llvm.org/D71347
* [Analyzer] Iterator Checkers: Replace `UnknownVal` in comparison result by a ↵Adam Balogh2019-12-113-8/+17
| | | | | | | | | | | | | conjured value Sometimes the return value of a comparison operator call is `UnkownVal`. Since no assumptions can be made on `UnknownVal`, this leeds to keeping impossible execution paths in the exploded graph resulting in poor performance and false positives. To overcome this we replace unknown results of iterator comparisons by conjured symbols. Differential Revision: https://reviews.llvm.org/D70244
* Removing an unused selection field from a diagnostic; NFC.Aaron Ballman2019-12-111-1/+1
|
* [Analyzer] Iterator Modeling: Print Container Data and Iterator Positions ↵Adam Balogh2019-12-112-0/+84
| | | | | | | | | | | | when printing the Program State Debugging the Iterator Modeling checker or any of the iterator checkers is difficult without being able to see the relations between the iterator variables and their abstract positions, as well as the abstract symbols denoting the begin and the end of the container. This patch adds the checker-specific part of the Program State printing to the Iterator Modeling checker.
* [SYCL] Add support for auxiliary triple specification to FrontendAlexey Bader2019-12-113-3/+10
| | | | | | | | | | | | | | | | | Summary: Add host predefined macros to compilation for SYCL device, which is required for pre-processing host specific includes (e.g. system headers). Reviewers: ABataev, jdoerfert Subscribers: ebevhan, Anastasia, cfe-commits, keryell, Naghasan, Fznamznon Tags: #clang Differential Revision: https://reviews.llvm.org/D71286 Signed-off-by: Alexey Bader <alexey.bader@intel.com>
* CodeGen: Allow annotations on globals in non-zero address spaceNicolai Hähnle2019-12-112-5/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: Attribute annotations are recorded in a special global composite variable that points to annotation strings and the annotated objects. As a restriction of the LLVM IR type system, those pointers are all pointers to address space 0, so let's insert an addrspacecast when the annotated global is in a non-0 address space. Since this addrspacecast is only reachable from the global annotations object, this should allow us to represent annotations on all globals regardless of which addrspacecasts are usually legal for the target. Reviewers: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71208
* [ARM][MVE] Factor out an IntrinsicMX multiclass.Simon Tatham2019-12-112-27/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The ACLE intrinsics for MVE contain a lot of pairs of functions with `_m` and `_x` in the name, wrapping a predicated MVE instruction which only partially overwrites its output register. They have the common pattern that the `_m` variant takes an initial argument called 'inactive', of the same type as the return value, supplying the input value of the output register, so that lanes disabled by the predication will be taken from that parameter; the `_x` variant omits that initial argument, and simply sets it to undef. That common pattern is simple enough to wrap into a multiclass, which should save a lot of effort in setting up all the rest of the `_x` variants. In this commit I introduce `multiclass IntrinsicMX` in `arm_mve_defs.td`, and convert existing generation of m/x pairs to use it. This allows me to remove the `PredicatedImmediateVectorShift` multiclass (from D71065) completely, because the new multiclass makes it so much simpler that it's not worth bothering to define it at all. Reviewers: MarkMurrayARM, miyuki Reviewed By: MarkMurrayARM, miyuki Subscribers: kristof.beyls, dmgreen, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71335
* [Analyzer][NFC] Iterator Checkers - Separate iterator modeling and the ↵Adam Balogh2019-12-118-1131/+1429
| | | | | | | | | | actual checkers A monolithic checker class is hard to maintain. This patch splits it up into a modeling part, the three checkers and a debug checker. The common functions are moved into a library. Differential Revision: https://reviews.llvm.org/D70320
* [Clang] Pragma vectorize_width() implies vectorize(enable)Sjoerd Meijer2019-12-113-17/+70
| | | | | | | | | | | | | | | | | | | | | | Let's try this again; this has been reverted/recommited a few times. Last time this got reverted because for this loop: void a() { #pragma clang loop vectorize(disable) for (;;) ; } vectorisation was incorrectly enabled and the vectorize.enable metadata was set due to a logic error. But with this fixed, we now imply vectorisation when: 1) vectorisation is enabled, which means: VectorizeWidth > 1, 2) and don't want to add it when it is disabled or enabled, otherwise we would be incorrectly setting it or duplicating the metadata, respectively. This should fix PR27643. Differential Revision: https://reviews.llvm.org/D69628
* [ARM][MVE] Add intrinsics for immediate shifts. (reland)Simon Tatham2019-12-115-34/+836
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the family of `vshlq_n` and `vshrq_n` ACLE intrinsics, which shift every lane of a vector left or right by a compile-time immediate. They mostly work by expanding to the IR `shl`, `lshr` and `ashr` operations, with their second operand being a vector splat of the immediate. There's a fiddly special case, though. ACLE specifies that the immediate in `vshrq_n` can take values up to //and including// the bit size of the vector lane. But LLVM IR thinks that shifting right by the full size of the lane is UB, and feels free to replace the `lshr` with an `undef` half way through the optimization pipeline. Hence, to keep this legal in source code, I have to detect it at codegen time. Logical (unsigned) right shifts by the element size are handled by simply emitting the zero vector; arithmetic ones are converted into a shift of one bit less, which will always give the same output. In order to do that check, I also had to enhance the tablegen MveEmitter so that it can cope with converting a builtin function's operand into a bare integer to pass to a code-generating subfunction. Previously the only bare integers it knew how to handle were flags generated from within `arm_mve.td`. Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard Reviewed By: dmgreen, MarkMurrayARM Subscribers: echristo, hokein, rdhindsa, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71065
* [DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.Alexey Lapshin2019-12-112-2/+5
| | | | | | | | | The -fsplit-dwarf-inlining option does not conform to DWARF5 standard. It creates children for Skeleton compilation unit. We need default behavior to be DWARF5 compatible. Thus set default state for -fsplit-dwarf-inlining into "false". Differential Revision: https://reviews.llvm.org/D71304
* [CodeComplete] Fix a crash in preferred type and signature helpIlya Biryukov2019-12-112-3/+14
| | | | | | | | | | | | | | Summary: Null type pointers could be dereferenced in some cases. Reviewers: kadircet, sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71329
OpenPOWER on IntegriCloud