summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Correcting the offsets within the test to fix the bots.Aaron Ballman2019-12-031-15/+15
|
* Differentiate between the presumed and actual file when dumping the AST to JSONAaron Ballman2019-12-034-5/+323
| | | | | | | | | | Currently, when dumping the AST to JSON, the presumed file is what is included when dumping a source location. This patch changes the behavior to instead dump the actual file, and only dump a presumed file name when it differs from the actual file. This also corrects an issue with the test script generator that would prevent it from working on Windows due to file permissions issues.
* [clang-format] Add new option to add spaces around conditionsMitchell Balan2019-12-035-1/+51
| | | | | | | | | | | | | | | Summary: This diff adds a new option SpacesAroundConditions that inserts spaces inside the braces for conditional statements. Reviewers: klimek, owenpan, mitchell-stellar, MyDeveloperDay Patch by: timwoj Subscribers: rsmmr, cfe-commits Tags: clang, clang-format Differential Revision: https://reviews.llvm.org/D68346
* Reland [clangd] Rethink how SelectionTree deals with macros and #includes.Sam McCall2019-12-033-0/+36
| | | | | | This reverts commit 905b002c139f039a32ab9bf1fad63d745d12423f. Avoid tricky (and invalid) comparator for std::set.
* [SYCL] Add sycl_kernel attribute for accelerated code outliningMariya Podchishchaeva2019-12-036-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SYCL is single source offload programming model relying on compiler to separate device code (i.e. offloaded to an accelerator) from the code executed on the host. Here is code example of the SYCL program to demonstrate compiler outlining work: ``` int foo(int x) { return ++x; } int bar(int x) { throw std::exception("CPU code only!"); } ... using namespace cl::sycl; queue Q; buffer<int, 1> a(range<1>{1024}); Q.submit([&](handler& cgh) { auto A = a.get_access<access::mode::write>(cgh); cgh.parallel_for<init_a>(range<1>{1024}, [=](id<1> index) { A[index] = index[0] + foo(42); }); } ... ``` SYCL device compiler must compile lambda expression passed to cl::sycl::handler::parallel_for method and function foo called from this lambda expression for an "accelerator". SYCL device compiler also must ignore bar function as it's not required for offloaded code execution. This patch adds the sycl_kernel attribute, which is used to mark code passed to cl::sycl::handler::parallel_for as "accelerated code". Attribute must be applied to function templates which parameters include at least "kernel name" and "kernel function object". These parameters will be used to establish an ABI between the host application and offloaded part. Reviewers: jlebar, keryell, Naghasan, ABataev, Anastasia, bader, aaron.ballman, rjmccall, rsmith Reviewed By: keryell, bader Subscribers: mgorny, OlegM, ArturGainullin, agozillon, aaron.ballman, ebevhan, Anastasia, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60455 Signed-off-by: Alexey Bader <alexey.bader@intel.com>
* [OpenCL] Use generic addr space for lambda call operatorAnastasia Stulova2019-12-036-14/+58
| | | | | | | | | | | | | | | Since lambdas are represented by callable objects, we add generic addr space for implicit object parameter in call operator. Any lambda variable declared in __constant addr space (which is not convertible to generic) fails to compile with a diagnostic. To support constant addr space we need to add a way to qualify the lambda call operators. Tags: #clang Differential Revision: https://reviews.llvm.org/D69938
* Add FunctionDecl::getParameterSourceRange()Nicolas Manichon2019-12-037-5/+163
| | | | | This source range covers the list of parameters of the function declaration, including the ellipsis for a variadic function.
* [Support] Add ProcName to TimeTraceProfilerRussell Gallop2019-12-032-2/+2
| | | | | | | | | | This was hard-coded to "clang". This change allows it to to be used on processes other than clang (such as lld). This gets reported as clang-10 on Linux and clang.exe on Windows so adapted test to accommodate this. Differential Revision: https://reviews.llvm.org/D70950
* [OpenCL] Fix mangling of single-overload builtinsSven van Haastregt2019-12-032-1/+9
| | | | | | Commit 9a8d477a0e0 ("[OpenCL] Add builtin function attribute handling", 2019-11-05) stopped Clang from mangling single-overload builtins, which is incorrect.
* [clang][CodeGen] Make use of cc1 instead of clang in the testsKadir Cetinkaya2019-12-031-1/+4
|
* Recommit "[DWARF5]Addition of alignment atrribute in typedef DIE."Sourabh Singh Tomar2019-12-032-1/+16
| | | | | | | | | | | | | | | | This revision is revised to update Go-bindings and Release Notes. The original commit message follows. This patch, adds support for DW_AT_alignment[DWARF5] attribute, to be emitted with typdef DIE. When explicit alignment is specified. Patch by Awanish Pandey <Awanish.Pandey@amd.com> Reviewers: aprantl, dblaikie, jini.susan.george, SouraVX, alok, deadalinx Differential Revision: https://reviews.llvm.org/D70111
* [clang-scan-deps] do not skip empty #if/#elif in the minimizer to avoid ↵Alex Lorenz2019-12-024-9/+66
| | | | | | | | | | missing `__has_include` dependencies This patch makes the minimizer more conservative to avoid missing dependency files that are brought in by __has_include PP expressions that occur in a condition of an #if/#elif that was previously skipped. The __has_include PP expressions can be used in an #if/#elif either directly, or through macro expansion, so we can't detect them at the time of minimization. Differential Revision: https://reviews.llvm.org/D70936
* FileCheck IR output for blockaddress in new testReid Kleckner2019-12-021-2/+6
| | | | Minor improvement to a test added in 1ac700cdef787383ad49a
* [clang test] Do not assume default targetThomas Preud'homme2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: clang test Driver/darwin-opt-record.c assumes the default target is x86_64 by its uses of the -arch x86_64 and -arch x86_64h and thus fail on systems where it is not the case. Adding a target x86_64-apple-darwin10 reveals another problem: the driver refuses 2 -arch for an assembly output so this commit also changes the output to be an object file. Reviewers: thegameg Reviewed By: thegameg Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70748
* Fix comment to more accurately describe C++ language requirements around ↵Richard Smith2019-12-021-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | tail padding. Summary: As of C++ core issue 43 (http://wg21.link/cwg43), which was voted into the C++ working draft in 1999, it is not permissible to memcpy a base class subobject, even if it's of POD type, so there is no problem with reusing the tail padding of a base class. That issue was voted into the standard in DR status, so it applies retroactively to C++98 (and is in any case part of C++03). So stop suggesting that AlwaysUseTailPadding mode is non-conforming. Reviewers: rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70923
* [WebAssembly] Find wasm-opt with GetProgramPathDan Gohman2019-12-021-4/+4
| | | | | | | Instead of just searching for wasm-opt in PATH, use GetProgramPath, which checks the `COMPILER_PATH` environment variable, -B paths, and `PATH`. Differential Revision: https://reviews.llvm.org/D70780
* [AArch64] Attempt to fixup test line. NFCDavid Green2019-12-021-1/+3
| | | | | | The test is complaining on some of the builders. This attempts to adjust the run line to be more line the others in the same folder, using clang_cc1 as opposed to the driver.
* [OPENMP]Use cast instead dyn_cast, NFC.Alexey Bataev2019-12-021-1/+1
| | | | Here the expression is always a DeclRefExpr, no need to use dyn_cast.
* [OPENMP]Fix PR44133: Emit definitions of used constructors/functions.Alexey Bataev2019-12-022-81/+48
| | | | | Need to fully rebuild the initializer/combiner when instatiating the declare reduction constrcut to properly emit used functions.
* [clang][modules] Add support for merging lifetime-extended temporariesTyker2019-12-0210-1/+84
| | | | | | | | | | | | | | Summary: Add support for merging lifetime-extended temporaries Reviewers: rsmith Reviewed By: rsmith Subscribers: xbolva00, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70190
* Add AIX assembler supportstevewan2019-12-026-5/+147
| | | | | | | | | | | | | | | | Summary: A skeleton of AIX toolchain and system linker support has been introduced in D68340, and this is a follow on patch to it. This patch adds support to system assembler invocation to the AIX toolchain. Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L, dlj Reviewed By: daltenty, hubert.reinterpretcast Subscribers: wuzish, nemanjai, kbarton, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69620
* [ARM,MVE] Add intrinsics to deal with predicates.Simon Tatham2019-12-023-7/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit adds the `vpselq` intrinsics which take an MVE predicate word and select lanes from two vectors; the `vctp` intrinsics which create a tail predicate word suitable for processing the first m elements of a vector (e.g. in the last iteration of a loop); and `vpnot`, which simply complements a predicate word and is just syntactic sugar for the `~` operator. The `vctp` ACLE intrinsics are lowered to the IR intrinsics we've already added (and which D70592 just reorganized). I've filled in the missing isel rule for VCTP64, and added another set of rules to generate the predicated forms. I needed one small tweak in MveEmitter to allow the `unpromoted` type modifier to apply to predicates as well as integers, so that `vpnot` doesn't pointlessly convert its input integer to an `<n x i1>` before complementing it. Reviewers: ostannard, MarkMurrayARM, dmgreen Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70485
* [ARM][AArch64] Complex addition Neon intrinsics for Armv8.3-AVictor Campos2019-12-027-1/+155
| | | | | | | | | | | | | | | | | | | Summary: Add support for vcadd_* family of intrinsics. This set of intrinsics is available in Armv8.3-A. The fp16 versions require the FP16 extension, which has been available (opt-in) since Armv8.2-A. Reviewers: t.p.northover Reviewed By: t.p.northover Subscribers: t.p.northover, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70862
* [OpenCL] Fix address space for implicit conversion (PR43145)Sven van Haastregt2019-12-022-3/+31
| | | | | | | | | | Clang was creating a DerivedToBase ImplicitCastExpr that was also casting between address spaces as part of the second step in the standard conversion sequence. Defer the address space conversion to the third step in the sequence instead, such that we get a separate ImplicitCastExpr for the address space conversion. Differential Revision: https://reviews.llvm.org/D70605
* [ARM][MVE][Intrinsics] Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics.Mark Murray2019-12-026-0/+369
| | | | | | | | | | Summary: Add VMINQ/VMAXQ/VMINNMQ/VMAXNMQ intrinsics and their predicated versions. Add unit tests. Subscribers: kristof.beyls, hiraditya, dmgreen, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70829
* Revert "[clang][modules] Add support for merging lifetime-extended temporaries"Tyker2019-12-0110-84/+1
| | | | This reverts commit a3cbe1a202df6ec8e23bd55e14db254e4bc33021.
* [clang][modules] Add support for merging lifetime-extended temporariesTyker2019-12-0110-1/+84
| | | | | | | | | | | | | | Summary: Add support for merging lifetime-extended temporaries Reviewers: rsmith Reviewed By: rsmith Subscribers: xbolva00, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70190
* Revert "[clang][modules] Add support for merging lifetime-extended temporaries"Tyker2019-12-0110-84/+1
| | | | This reverts commit 85c74384778909789389b9012a75cfcca7964a28.
* [clang][modules] Add support for merging lifetime-extended temporariesTyker2019-11-3010-1/+84
| | | | | | | | | | | | | | Summary: Add support for merging lifetime-extended temporaries Reviewers: rsmith Reviewed By: rsmith Subscribers: xbolva00, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70190
* [Format] Add format check for coroutine keywords with negative numbersBrian Gesiak2019-11-302-1/+5
| | | | | | | | | | | | | | | | | | Summary: As a followup to D69144, this diff fixes the coroutine keyword spacing for co_yield / co_returning negative numbers. Reviewers: modocache, sammccall, Quuxplusone Reviewed By: modocache Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69180 Patch by Jonathan Thomas (jonathoma)!
* Revert "[clang][modules] Add support for merging lifetime-extended temporaries"Tyker2019-11-3010-88/+1
| | | | This reverts commit 3c7f6b439699a9cbbc0ac8d288cc70aff357446b.
* [clang][modules] Add support for merging lifetime-extended temporariesTyker2019-11-3010-1/+88
| | | | | | | | | | | | | | Summary: Add support for merging lifetime-extended temporaries Reviewers: rsmith Reviewed By: rsmith Subscribers: xbolva00, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70190
* Revert "[clangd] Rethink how SelectionTree deals with macros and #includes."Sam McCall2019-11-293-36/+0
| | | | | | | | This reverts commit 19daa21f841ad45290c923689ee3d25198651a4c. It causes a bunch of failures on a bot that I've been unable to reproduce so far: http://45.33.8.238/mac/3308/step_7.txt
* Revert "[ARM] Allocatable Global Register Variables for ARM"Carey Williams2019-11-2912-164/+7
| | | | This reverts commit 2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77.
* On Windows, fix fuse-ld.c test when lld is provided explictly in -DCMAKE_LINKERAlexandre Ganea2019-11-291-2/+2
|
* [CIndex] Fix annotate-deep-statements test when using a Debug buildAlexandre Ganea2019-11-292-4/+8
| | | | Differential Revision: https://reviews.llvm.org/D70149
* [clangd] Rethink how SelectionTree deals with macros and #includes.Sam McCall2019-11-293-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The exclusive-claim model is successful at resolving conflicts over tokens between parent/child or siblings. However claims at the spelled-token level do the wrong thing for macro expansions, where siblings can be equally associated with the macro invocation. Moreover, any model that only uses the endpoints in a range can fail when a macro invocation occurs inside the node. To address this, we use the existing TokenBuffer in more depth. Claims are expressed in terms of expanded tokens, so there is no need to worry about macros, includes etc. Once we know which expanded tokens were claimed, they are mapped onto spelled tokens for hit-testing. This mapping is fairly flexible, currently the handling of macros is pretty simple (map macro args onto spellings, other macro expansions onto the macro name token). This mapping is in principle token-by-token for correctness (though there's some batching for performance). The aggregation of the selection enum is now more principled as we need to be able to aggregate several hit-test results together. For simplicity i removed the ability to determine selectedness of TUDecl. (That was originally implemented in 90a5bf92ff97b1, but doesn't seem to be very important or worth the complexity any longer). The expandedTokens(SourceLocation) helper could be added locally, but seems to make sense on TokenBuffer. Fixes https://github.com/clangd/clangd/issues/202 Fixes https://github.com/clangd/clangd/issues/126 Reviewers: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D70512
* [Syntax] Build SimpleDeclaration node that groups multiple declaratorsIlya Biryukov2019-11-294-78/+270
| | | | | | | | | | | | | | | | | | | | Summary: Also remove the temporary TopLevelDeclaration node and add UnknownDeclaration to represent other unknown nodes. See the follow-up change for building more top-level declarations. Adding declarators is also pretty involved and will be done in another follow-up patch. Reviewers: gribozavr2 Reviewed By: gribozavr2 Subscribers: merge_guards_bot, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70787
* [AST] Remove unused and undefined `TypeLoc::IgnoreMacroDefinitions` ↵Ilya Biryukov2019-11-291-3/+0
| | | | | | function. NFC Looks like an accidental leftover from the older version of the code.
* [clangd] Log cc1 args at verbose level.Sam McCall2019-11-292-3/+10
| | | | | | | | | | | | Summary: This will help debugging driver issues. Reviewers: kbobyrev Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70832
* [Syntax] Add a comment explaining the pointer keys in std::map<Token*, ...>. NFCIlya Biryukov2019-11-291-0/+2
|
* [Syntax] Remove unused parameter from `TreeBuilder::markChildToken`. NFCIlya Biryukov2019-11-291-20/+15
|
* [Clang] Bypass distro detection on non-Linux hostsAlexandre Ganea2019-11-286-19/+95
| | | | | | Skip distro detection when we're not running on Linux, or when the target triple is not Linux. This saves a few OS calls for each invocation of clang.exe. Differential Revision: https://reviews.llvm.org/D70467
* [mips] Check that features required by built-ins are enabledSimon Atanasyan2019-11-297-4/+83
| | | | | | | | | | | | Now Clang does not check that features required by built-in functions are enabled. That causes errors in the backend reported in PR44018. This patch fixes this bug by checking that required features are enabled. This should fix PR44018. Differential Revision: https://reviews.llvm.org/D70808
* [OpenMP][test] Fix test on MIPS-based buildbotsMiloš Stojanović2019-11-281-1/+1
| | | | | | On MIPS `zeroext` or `signext` can appear in the output. Differential Revision: https://reviews.llvm.org/D70820
* Properly disambiguate between array declarators and array subscript expressions.Richard Smith2019-11-272-1/+35
|
* [CodeGen] Fix clang crash on aggregate initialization of array of labelsJohannes Altmanninger2019-11-284-4/+10
| | | | | | | | | | | | | | | Summary: Fix PR43700 The ConstantEmitter in AggExprEmitter::EmitArrayInit was initialized with the CodeGenFunction set to null, which caused the crash. Also simplify another call, and make the CGF member a const pointer since it is public but only assigned in the constructor. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70302
* Try to reenable -Wdeprecated-copy under -WextraDávid Bolvanský2019-11-272-0/+2
|
* [ConstExprPreter] Removed the flag forcing the use of the interpreterNandor Licker2019-11-279-146/+74
| | | | | | | | | | | | | | | | | | | Summary: Removed the ```-fforce-experimental-new-constant-interpreter flag```, leaving only the ```-fexperimental-new-constant-interpreter``` one. The interpreter now always emits an error on an unsupported feature. Allowing the interpreter to bail out would require a mapping from APValue to interpreter memory, which will not be necessary in the final version. It is more sensible to always emit an error if the interpreter fails. Reviewers: jfb, Bigcheese, rsmith, dexonsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70071
* [clang][CodeGen] Implicit Conversion Sanitizer: handle increment/decrement ↵Roman Lebedev2019-11-2712-5/+1615
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (PR44054)(take 2) Summary: Implicit Conversion Sanitizer is *almost* feature complete. There aren't *that* much unsanitized things left, two major ones are increment/decrement (this patch) and bit fields. As it was discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=39519 | PR39519 ]], unlike `CompoundAssignOperator` (which is promoted internally), or `BinaryOperator` (for which we always have promotion/demotion in AST) or parts of `UnaryOperator` (we have promotion/demotion but only for certain operations), for inc/dec, clang omits promotion/demotion altogether, under as-if rule. This is technically correct: https://rise4fun.com/Alive/zPgD As it can be seen in `InstCombineCasts.cpp` `canEvaluateTruncated()`, `add`/`sub`/`mul`/`and`/`or`/`xor` operators can all arbitrarily be extended or truncated: https://github.com/llvm/llvm-project/blob/901cd3b3f62d0c700e5d2c3f97eff97d634bec5e/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp#L1320-L1334 But that has serious implications: 1. Since we no longer model implicit casts, do we pessimise their AST representation and everything that uses it? 2. There is no demotion, so lossy demotion sanitizer does not trigger :] Now, i'm not going to argue about the first problem here, but the second one **needs** to be addressed. As it was stated in the report, this is done intentionally, so changing this in all modes would be considered a penalization/regression. Which means, the sanitization-less codegen must not be altered. It was also suggested to not change the sanitized codegen to the one with demotion, but i quite strongly believe that will not be the wise choice here: 1. One will need to re-engineer the check that the inc/dec was lossy in terms of `@llvm.{u,s}{add,sub}.with.overflow` builtins 2. We will still need to compute the result we would lossily demote. (i.e. the result of wide `add`ition/`sub`traction) 3. I suspect it would need to be done right here, in sanitization. Which kinda defeats the point of using `@llvm.{u,s}{add,sub}.with.overflow` builtins: we'd have two `add`s with basically the same arguments, one of which is used for check+error-less codepath and other one for the error reporting. That seems worse than a single wide op+check. 4. OR, we would need to do that in the compiler-rt handler. Which means we'll need a whole new handler. But then what about the `CompoundAssignOperator`, it would also be applicable for it. So this also doesn't really seem like the right path to me. 5. At least X86 (but likely others) pessimizes all sub-`i32` operations (due to partial register stalls), so even if we avoid promotion+demotion, the computations will //likely// be performed in `i32` anyways. So i'm not really seeing much benefit of not doing the straight-forward thing. While looking into this, i have noticed a few more LLVM middle-end missed canonicalizations, and filed [[ https://bugs.llvm.org/show_bug.cgi?id=44100 | PR44100 ]], [[ https://bugs.llvm.org/show_bug.cgi?id=44102 | PR44102 ]]. Those are not specific to inc/dec, we also have them for `CompoundAssignOperator`, and it can happen for normal arithmetics, too. But if we take some other path in the patch, it will not be applicable here, and we will have most likely played ourselves. TLDR: front-end should emit canonical, easy-to-optimize yet un-optimized code. It is middle-end's job to make it optimal. I'm really hoping reviewers agree with my personal assessment of the path this patch should take.. This originally landed in 9872ea4ed1de4c49300430e4f1f4dfc110a79ab9 but got immediately reverted in cbfa237892e55b7129a1178c9b03f26683d643af because the assertion was faulty. That fault ended up being caused by the enum - while there will be promotion, both types are unsigned, with same width. So we still don't need to sanitize non-signed cases. So far. Maybe the assert will tell us this isn't so. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44054 | PR44054 ]]. Refs. https://github.com/google/sanitizers/issues/940 Reviewers: rjmccall, erichkeane, rsmith, vsk Reviewed By: erichkeane Subscribers: mehdi_amini, dexonsmith, cfe-commits, #sanitizers, llvm-commits, aaron.ballman, t.p.northover, efriedma, regehr Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D70539
OpenPOWER on IntegriCloud