summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[DWARF5]Addition of alignment atrribute in typedef DIE."Sam McCall2019-11-182-22/+5
| | | | | This reverts commit 423f541c1a322963cf482683fe9777ef0692082d, which breaks llvm-c ABI.
* Remove useless param tag to fix Wdocumentation warning. NFCI.Simon Pilgrim2019-11-181-3/+0
|
* Fix "not all control paths return a value" warning. NFCI.Simon Pilgrim2019-11-181-2/+3
|
* [RISCV] Set triple based on -march flagSimon Cook2019-11-183-1/+25
| | | | | | | | | For RISC-V the value provided to -march should determine whether to compile for 32- or 64-bit RISC-V irrespective of the target provided to the Clang driver. This adds a test for this flag for RISC-V and sets the Target architecture correctly in these cases. Differential Revision: https://reviews.llvm.org/D54214
* [ARM,MVE] Add intrinsics for vector comparisons.Simon Tatham2019-11-184-0/+3220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the `vcmp` family of ACLE MVE intrinsics: vector/vector, vector/scalar, and the predicated forms of both. All are represented using standard existing IR: vector/scalar comparisons are represented by making a vector out of the scalar first, and predicated forms are represented by taking the bitwise AND of the input predicate and the output of the comparison. Existing LLVM-side tests demonstrate that ISel will pattern-match all of that back down to single MVE VCMPs. The idiom of handling a vector/scalar operation by generating IR to expand the scalar into a second vector is going to be needed for a lot of MVE intrinsics, so to make that easy, I've provided a helper function that automatically works out the element count. The comparison intrinsics are the first ones that have to //return// a predicate, in the user-facing `mve_pred16_t` format. This means we have to use the `arm_mve_pred_v2i` low-level intrinsic to convert it back from the logical `<n x i1>` form used in IR. I've done that explicitly in the code gen specification for the builtins, because it happens much more rarely in the ACLE API than passing a Predicate as input, so it didn't seem worth automating in MveEmitter. Reviewers: ostannard, MarkMurrayARM, dmgreen Reviewed By: dmgreen Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D70297
* [AST] Attach comment in `/** doc */ typedef struct A {} B` to B as well as A.Sam McCall2019-11-183-5/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: Semantically they're the same thing, and it's important when the underlying struct is anonymous. There doesn't seem to be a problem attaching the same comment to multiple things as it already happens with `/** doc */ int a, b;` This affects an Index test but the results look better (name present, USR points to the typedef). Fixes https://github.com/clangd/clangd/issues/189 Reviewers: kadircet, lh123 Subscribers: ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70203
* [ARM] Allocatable Global Register Variables for ARMAnna Welker2019-11-1812-7/+164
| | | | | | | | | | | | Provides support for using r6-r11 as globally scoped register variables. This requires a -ffixed-rN flag in order to reserve rN against general allocation. If for a given GRV declaration the corresponding flag is not found, or the the register in question is the target's FP, we fail with a diagnostic. Differential Revision: https://reviews.llvm.org/D68862
* Revert "[NFC] Refactor representation of materialized temporaries"Nico Weber2019-11-1741-326/+170
| | | | | | This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, see comments on https://reviews.llvm.org/D69360
* [NFC] Refactor representation of materialized temporariesTyker2019-11-1641-170/+326
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* [DWARF5]Addition of alignment atrribute in typedef DIE.Sourabh Singh Tomar2019-11-162-5/+22
| | | | | | | | | | | | 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-format] fix regression in middle pointer alignmentmydeveloperday2019-11-162-1/+23
| | | | | | | | | | | | | | | | | | Summary: a75f8d98d7ac introduced a regression with Middle pointer alignment, which this patch fixes. Reviewers: MyDeveloperDay, klimek, sammccall Reviewed By: MyDeveloperDay, sammccall Subscribers: cfe-commits, merge_guards_bot Patch by: Typz Tags: #clang Differential Revision: https://reviews.llvm.org/D70305
* Remove +x permission on some filesSylvestre Ledru2019-11-163-0/+0
|
* Remove +x permission on clang/lib/Format/Format.cppSylvestre Ledru2019-11-161-0/+0
|
* [clang-format] Add SpaceBeforeBracketsmydeveloperday2019-11-165-7/+76
| | | | | | | | | | | | | | | | Summary: Adds a new option SpaceBeforeBrackets to add spaces before brackets (i.e. int a[23]; -> int a [23];) This is present as an option in the Visual Studio C++ code formatting settings, but there was no matching setting in clang-format. Reviewers: djasper, MyDeveloperDay, mitchell-stellar Reviewed By: MyDeveloperDay Subscribers: llvm-commits, cfe-commits, klimek Patch by: Anteru Tags: #clang, #clang-format, #llvm Differential Revision: https://reviews.llvm.org/D6920
* Add support of the next Ubuntu (Ubuntu 20.04 - Focal Fossa)Sylvestre Ledru2019-11-162-1/+3
|
* Avoid including Builtins.h in Preprocessor.hReid Kleckner2019-11-1510-9/+19
| | | | | | Builtins are rarely if ever accessed via the Preprocessor. They are typically found on the ASTContext, so there should be no performance penalty to using a pointer indirection to store the builtin context.
* Don't add optnone or noinline if the function is already marked asAkira Hatanaka2019-11-152-5/+27
| | | | | | | | | | | | always_inline. The assertion in SetLLVMFunctionAttributesForDefinition used to fail when there was attribute OptimizeNone on the AST function and attribute always_inline on the IR function. This happens because base destructors are annotated with always_inline when the code is compiled with -fapple-kext (see r124757). rdar://problem/57169694
* Don't use end-of-line comments for the DebugInfoKind enum, NFCReid Kleckner2019-11-151-18/+24
| | | | These are long comments, and I find the new structure easier to read.
* Remove Support/Options.h, it is unusedReid Kleckner2019-11-151-1/+1
| | | | | | | | | | | | | | | | | It was added in 2014 in 732e0aa9fb84f1 with one use in Scalarizer.cpp. That one use was then removed when porting to the new pass manager in 2018 in b6f76002d9158628e78. While the RFC and the desire to get off of static initializers for cl::opt all still stand, this code is now dead, and I think we should delete this code until someone is ready to do the migration. There were many clients of CommandLine.h that were it transitively through LLVMContext.h, so I cleaned that up in 4c1a1d3cf97e1ede466. Reviewers: beanz Differential Revision: https://reviews.llvm.org/D70280
* Revert "re-land [DebugInfo] Add debug location to stubs generated by ↵Alexandre Ganea2019-11-157-75/+20
| | | | | | CGDeclCXX and mark them as artificial" This reverts commit 9c1baa23526c6d7d06eafefbf82d73bfe9bb3aaf.
* re-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and ↵Alexandre Ganea2019-11-157-20/+75
| | | | | | mark them as artificial Differential Revision: https://reviews.llvm.org/D66328
* Add a missing triple in ast-dump-decl-json.mAlex Richardson2019-11-151-197/+197
| | | | | Since there was no triple argument this test started failing on macOS bots, where the mangled names are prefixed with an underscore.
* [OpenMP 5.0] - Extend defaultmap, by Chi Chun Chen.cchen2019-11-1517-478/+3151
| | | | | | | | | | | | | | | | | Summary: For the extended defaultmap, most of the work is inside sema. The only difference for codegen is to set different initial maptype for different implicit-behavior. Reviewers: jdoerfert, ABataev Reviewed By: ABataev Subscribers: dreachem, sandoval, cfe-commits Tags: #clang, #openmp Differential Revision: https://reviews.llvm.org/D69204
* [AST] Let DeclarationNameInfo printing use PrintingPolicy, and fix ↵Sam McCall2019-11-154-20/+21
| | | | const-correctness
* [clang-format] Flexible line endingsCameron Desrochers2019-11-153-3/+112
| | | | | | | | | Line ending detection is now set with the `DeriveLineEnding` option. CRLF can now be used as the default line ending by setting `UseCRLF`. When line ending detection is disabled, all line endings are converted according to the `UseCRLF` option. Differential Revision: https://reviews.llvm.org/D19031
* Implement target(branch-protection) attribute for AArch64Momchil Velikov2019-11-1514-64/+210
| | | | | | | | | This patch implements `__attribute__((target("branch-protection=...")))` in a manner, compatible with the analogous GCC feature: https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes Differential Revision: https://reviews.llvm.org/D68711
* clang: enable unwind tables on FreeBSD !amd64Ed Maste2019-11-153-0/+7
| | | | | | | | | | | | | | | | | | | There doesn't seem to be much sense in defaulting "on" unwind tables on amd64 and not on other arches. It causes surprising differences between platforms, such as the PR below[1]. Prior to this change, FreeBSD inherited the default implementation of the method from the Gnu.h Generic_Elf => Generic_GCC parent class, which returned true only for amd64 targets. Override that and opt on always, similar to, e.g., NetBSD's driver. [1] https://bugs.freebsd.org/241562 Patch by cem (Conrad Meyer). Reviewed By: dim Differential Revision: https://reviews.llvm.org/D70110
* [RISCV] Match GCC `-march`/`-mabi` driver defaultsSam Elliott2019-11-156-29/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang/LLVM is a cross-compiler, and so we don't have to make a choice about `-march`/`-mabi` at build-time, but we may have to compute a default `-march`/`-mabi` when compiling a program. Until now, each place that has needed a default `-march` has calculated one itself. This patch adds a single place where a default `-march` is calculated, in order to avoid calculating different defaults in different places. This patch adds a new function `riscv::getRISCVArch` which encapsulates this logic based on GCC's for computing a default `-march` value when none is provided. This patch also updates the logic in `riscv::getRISCVABI` to match the logic in GCC's build system for computing a default `-mabi`. This patch also updates anywhere that `-march` is used to now use the new function which can compute a default. In particular, we now explicitly pass a `-march` value down to the gnu assembler. GCC has convoluted logic in its build system to choose a default `-march`/`-mabi` based on build options, which would be good to match. This patch is based on the logic in GCC 9.2.0. This commit's logic is different to GCC's only for baremetal targets, where we default to rv32imac/ilp32 or rv64imac/lp64 depending on the target triple. Tests have been updated to match the new logic. Reviewers: asb, luismarques, rogfer01, kito-cheng, khchen Reviewed By: asb, luismarques Subscribers: sameer.abuasal, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69383
* [CodeComplete] Constructor overload candidates report as vector(int) instead ↵Sam McCall2019-11-152-1/+12
| | | | | | | | | | | | | | | | | | | of vector<string>(int) Summary: This is shorter, shouldn't be confusing (is consistent with how they're declared), and avoids messy cases that are printed as myclass<type-param-0-0>(int) in the case of partial specialization. Fixes part of https://github.com/clangd/clangd/issues/76 Reviewers: hokein, lh123 Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70307
* [Clang][ASTImporter] Added visibility check for ClassTemplateDecl.Balázs Kéri2019-11-152-1/+33
| | | | | | | | | | | | | | | | Summary: ASTImporter makes now difference between class templates with same name in different translation units if these are not visible outside. Reviewers: martong, a.sidorin, shafik Reviewed By: martong Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67543
* Move floating point related entities to namespace levelSerge Pavlov2019-11-151-20/+13
| | | | | | | | | | | | | | Enumerations that describe rounding mode and exception behavior were defined inside ConstrainedFPIntrinsic. It makes sense to use the same definitions to represent the same properties in other cases, not only in constrained intrinsics. It was however inconvenient as required to include constrained intrinsics definitions even if they were not needed. Also using long scope prefix reduced readability. This change moves these definitioins to the namespace llvm::fp. No functional changes. Differential Revision: https://reviews.llvm.org/D69552
* Include the mangled name in -ast-dump=jsonAlex Richardson2019-11-1517-4/+285
| | | | | | | | | | | | | | | | | | | | I am planning to use this feature to make update_cc_test_checks.py less fragile by obtaining the mangled names directly from -ast-dump=json. Currently, it uses c-index-test which ignores the -triple=, etc. arguments that are in the RUN: line and therefore does not generate checks for some targets. The AST dump tests were updated using the following command: `python $LLVM_BINDIR/gen_ast_dump_json_test.py --update --source $LLVM_SRC/clang/test/AST/*-json.*` Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: rsmith, MaskRay, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69564
* [NFC] Regenerate ast-dump-json testsAlex Richardson2019-11-152-5579/+5579
| | | | | | | This was done by running `python $LLVM_BINDIR/gen_ast_dump_json_test.py --update --source $LLVM_SRC/clang/test/AST/*-json.*` Only changes are whitespace and line endings. Differential Revision: https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Allow updating multiple files in one goAlex Richardson2019-11-151-26/+34
| | | | | | | | With this change it is possible to update all JSON dump tests using the following command: python $LLVM_BINDIR/gen_ast_dump_json_test.py --update --source $LLVM_SRC/clang/test/AST/*-json.* See https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Copy to binary directory to omit --clang argumentAlex Richardson2019-11-152-2/+14
| | | | | | | | | | The script will now check if a clang binary exists in the same directory and default to that instead of requiring a --clang argument. The script is copied to the clang build directory using CMake configure_file() with COPYONLY. This ensures that the version in the build directory is updated any time the source version changes. See https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Skip manual tests when using --updateAlex Richardson2019-11-151-3/+8
| | | | See https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Infer --filters flags when using --updateAlex Richardson2019-11-151-10/+27
| | | | See https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Parse RUN: lines with --updateAlex Richardson2019-11-151-8/+33
| | | | See https://reviews.llvm.org/D70119
* [gen_ast_dump_json_test.py] Add a --update flagAlex Richardson2019-11-151-12/+21
| | | | | | | | | This will allow updating the JSON tests for new format changes. Instead of simply appending the JSON to the input file, the script will now make a copy of the input file up to the "CHECK lines have been autogenerated" disclaimer and then append the new JSON. See https://reviews.llvm.org/D70119
* Revert "[clang] Remove the DIFlagArgumentNotModified debug info flag"Djordje Todorovic2019-11-153-0/+71
| | | | This reverts commit rG1643734741d2 due to LLDB test failure.
* [clang] Remove the DIFlagArgumentNotModified debug info flagDjordje Todorovic2019-11-153-71/+0
| | | | | | | | | | It turns out that the ExprMutationAnalyzer can be very slow when AST gets huge in some cases. The idea is to move this analysis to the LLVM back-end level (more precisely, in the LiveDebugValues pass). The new approach will remove the performance regression, simplify the implementation and give us front-end independent implementation. Differential Revision: https://reviews.llvm.org/D68206
* [ARM,MVE] Add intrinsics for vector get/set lane.Simon Tatham2019-11-1514-23/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the `vgetq_lane` and `vsetq_lane` families, to copy between a scalar and a specified lane of a vector. One of the new `vgetq_lane` intrinsics returns a `float16_t`, which causes a compile error if `%clang_cc1` doesn't get the option `-fallow-half-arguments-and-returns`. The driver passes that option to cc1 already, but I've had to edit all the explicit cc1 command lines in the existing MVE intrinsics tests. A couple of fixes are included for the code I wrote up front in MveEmitter to support lane-index immediates (and which nothing has tested until now): the type was wrong (`uint32_t` instead of `int`) and the range was off by one. I've also added a method of bypassing the default promotion to `i32` that is done by the MveEmitter code generation: it's sensible to promote short scalars like `i16` to `i32` if they're going to be passed to custom IR intrinsics representing a machine instruction operating on GPRs, but not if they're going to be passed to standard IR operations like `insertelement` which expect the exact type. Reviewers: ostannard, MarkMurrayARM, dmgreen Reviewed By: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70188
* [ARM,MVE] Add intrinsics for 'administrative' vector operations.Simon Tatham2019-11-154-17/+1661
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This batch of intrinsics includes lots of things that move vector data around or change its type without really affecting its value very much. It includes the `vreinterpretq` family (cast one vector type to another); `vuninitializedq` (create a vector of a given type with don't-care contents); and `vcreateq` (make a 128-bit vector out of two `uint64_t` halves). These are all implemented using completely standard IR that's already tested in existing LLVM unit tests, so I've just written a clang test to check the IR is correct, and left it at that. I've also added some richer infrastructure to the MveEmitter Tablegen backend, to make it specify the exact integer type of integer arguments passed to IR construction functions, and wrap those arguments in a `static_cast` in the autogenerated C++. That was necessary to prevent an overloading ambiguity when passing the integer literal `0` to `IRBuilder::CreateInsertElement`, because otherwise, it could mean either a null pointer `llvm::Value *` or a zero `uint64_t`. Reviewers: ostannard, MarkMurrayARM, dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70133
* [AST] Use written names instead of `type-param-0-0` in more cases when ↵Sam McCall2019-11-153-41/+32
| | | | | | | | | | | | | | | | | | | printing types and decls. Summary: This doesn't cover decls in diagnostics, which use NamedDecl::getNameForDiagnostic(). (That should also be fixed later I think). This covers some cases of https://github.com/clangd/clangd/issues/76 (hover, but not outline or sighelp) Reviewers: hokein Subscribers: ilya-biryukov, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70236
* Unbreak the clang test suite when hexagon-link is not availableDavid Zarzycki2019-11-151-1/+1
| | | | | All of the other tests are of the form {{hexagon-link|ld}} so this probably should be too.
* Add a test to cover structural match for recursive data typesBruno Cardoso Lopes2019-11-145-0/+27
| | | | | | | This didn't use to work prior to r370639, now that this is supported add a testcase to prevent regressions. rdar://problem/53602368
* Add missing includes needed to prune LLVMContext.h include, NFCReid Kleckner2019-11-142-0/+2
| | | | | These are a pre-requisite to removing #include "llvm/Support/Options.h" from LLVMContext.h: https://reviews.llvm.org/D70280
* [BPF] Restrict preserve_access_index attribute to C onlyYonghong Song2019-11-143-31/+22
| | | | | | | | | | | | This patch is a follow-up for commit 4e2ce228ae79 [BPF] Add preserve_access_index attribute for record definition to restrict attribute for C only. A new test case is added to check for this restriction. Additional code polishing is done based on Aaron Ballman's suggestion in https://reviews.llvm.org/D69759/new/. Differential Revision: https://reviews.llvm.org/D70257
* [X86] Fix the implementation of __readcr3/__writecr3 to work in 64-bit modeCraig Topper2019-11-142-13/+16
| | | | | | | | | | | | We need to use a 64-bit type in 64-bit mode so a 64-bit register will get used in the generated assembly. I've also changed the constraints to just use "r" intead of "q". "q" forces to a only an a/b/c/d register in 32-bit mode, but I see no reason that would matter here. Fixes Nico's note in PR19301 over 4 years ago. Differential Revision: https://reviews.llvm.org/D70101
* [Hexagon] Fix clang driver to parse -mcpu/-mvXX and -march properly.Sumanth Gundapaneni2019-11-142-1/+14
| | | | | | Before this patch if we pass "-mcpu=hexagonv65 -march=hexagon" in this order, the driver fails to figure out the correct cpu version. This patch fixed this issue.
OpenPOWER on IntegriCloud