summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [Hexagon] driver uses out-of-date option name and binary nameKrzysztof Parzyszek2019-06-281-2/+2
| | | | | | | | Patch by A. Skrobov (t.yomitch). Differential Revision: https://reviews.llvm.org/D62127 llvm-svn: 364648
* [OPENMP]Fix checks for DSA in simd constructs.Alexey Bataev2019-06-281-2/+2
| | | | | | | | The errors for incorrectly specified data-sharing attributes for simd constructs must be emitted only for the explicitly provided clauses, not the predetermined ones. llvm-svn: 364647
* [CTU] Add missing statisticsGabor Marton2019-06-281-2/+6
| | | | | | | | | | | | Reviewers: xazax.hun Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63878 llvm-svn: 364630
* [analyzer] Fix clang-tidy crash on GCCAsmStmtNathan Huckleberry2019-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | Summary: Added entry in switch statement to recognize GCCAsmStmt as a possible block terminator. Handling to build CFG using GCCAsmStmt was already implemented. Reviewers: nickdesaulniers, george.karpenkov, NoQ Reviewed By: nickdesaulniers, NoQ Subscribers: xbolva00, tmroeder, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63533 llvm-svn: 364605
* [OPENMP]Generate correctly implicit flags for mapped data.Alexey Bataev2019-06-271-7/+19
| | | | | | | Implicit flag must not be emitted for explicitly specified firstprivate variables, but for implicitly captured sizes of the VLAs. llvm-svn: 364575
* [clang] Add DISuprogram and DIE for a func declDjordje Todorovic2019-06-273-6/+56
| | | | | | | | | | | | | | | Attach a unique DISubprogram to a function declaration that will be used for call site debug info. ([7/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/D60714 llvm-svn: 364502
* [NFC] Return early for types with size zeroVitaly Buka2019-06-271-3/+4
| | | | llvm-svn: 364495
* [NFC] Remove unneeded local variablesVitaly Buka2019-06-271-9/+5
| | | | llvm-svn: 364492
* [ObjC] Improve error message for a malformed objc-type-nameErik Pilkington2019-06-261-1/+1
| | | | | | | | | | | | If the type didn't exist, we used to emit a really bad error: t.m:3:12: error: expected ')' -(nullable NoSuchType)foo3; ^ rdar://50925632 llvm-svn: 364489
* Fix formatting after r364479Aaron Puchert2019-06-261-4/+2
| | | | | | | The reflowing obscurs the functional changes, so here is a separate commit. llvm-svn: 364480
* [Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarfAaron Puchert2019-06-264-38/+6
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 364479
* Revert r363191 "[MS] Pretend constexpr variable template specializations are ↵Reid Kleckner2019-06-261-19/+4
| | | | | | | | | inline" The next Visual Studio update will fix this issue, and it doesn't make sense to implement this non-conforming behavior going forward. llvm-svn: 364476
* [clang-scan-deps] Introduce the DependencyScanning library with theAlex Lorenz2019-06-264-1/+178
| | | | | | | | | | | | | thread worker code and better error handling This commit extracts out the code that will powers the fast scanning worker into a new file in a new DependencyScanning library. The error and output handling is improved so that the clients can gather errors/results from the worker directly. Differential Revision: https://reviews.llvm.org/D63681 llvm-svn: 364474
* [WebAssembly] Implement Address Sanitizer for EmscriptenGuanzhong Chen2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: This diff enables address sanitizer on Emscripten. On Emscripten, real memory starts at the value passed to --global-base. All memory before this is used as shadow memory, and thus the shadow mapping function is simply dividing by 8. Reviewers: tlively, aheejin, sbc100 Reviewed By: sbc100 Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63742 llvm-svn: 364468
* BitStream reader: propagate errorsJF Bastien2019-06-2611-279/+875
| | | | | | | | | | | | | | | | | | | | | | The bitstream reader handles errors poorly. This has two effects: * Bugs in file handling (especially modules) manifest as an "unexpected end of file" crash * Users of clang as a library end up aborting because the code unconditionally calls `report_fatal_error` The bitstream reader should be more resilient and return Expected / Error as soon as an error is encountered, not way late like it does now. This patch starts doing so and adopting the error handling where I think it makes sense. There's plenty more to do: this patch propagates errors to be minimally useful, and follow-ups will propagate them further and improve diagnostics. https://bugs.llvm.org/show_bug.cgi?id=42311 <rdar://problem/33159405> Differential Revision: https://reviews.llvm.org/D63518 llvm-svn: 364464
* Make AddLastArg() variadic and use it more. No behavior change.Nico Weber2019-06-261-27/+15
| | | | llvm-svn: 364453
* Make CodeGen depend on ASTMatchersMichael Liao2019-06-261-0/+1
| | | | | | - Shared library builds are broken due to the missing dependency. llvm-svn: 364428
* [clang/DIVar] Emit the flag for params that have unmodified valueDjordje Todorovic2019-06-262-0/+43
| | | | | | | | | | | | | | | Emit the debug info flag that indicates that a parameter has unchanged value throughout a function. ([5/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/D58035 llvm-svn: 364424
* [OpenCL] Improve diagnostic for placement newSven van Haastregt2019-06-261-1/+5
| | | | | | | | | | | | | Without an explicit declaration for placement new, clang would reject uses of placement new with "'default new' is not supported in OpenCL C++". This may mislead users into thinking that placement new is not supported, see e.g. PR42060. Clarify that placement new requires an explicit declaration. Differential Revision: https://reviews.llvm.org/D63561 llvm-svn: 364423
* [CC1Option] Add the option to enable the debug entry valuesDjordje Todorovic2019-06-263-1/+12
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 364399
* [clang][Tooling] Infer target and mode from argv[0] when using ↵Kadir Cetinkaya2019-06-263-1/+63
| | | | | | | | | | | | | | | | | | | | | JSONCompilationDatabase Summary: Wraps JSON compilation database with a target and mode adding database wrapper. So that driver can correctly figure out which toolchain to use. Note that clients that wants to make use of this target discovery mechanism needs to link in TargetsInfos and initialize them at startup. Reviewers: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63755 llvm-svn: 364386
* [HIP] Support attribute hip_pinned_shadowYaxun Liu2019-06-264-9/+32
| | | | | | | | | | | | | | | This patch introduces support of hip_pinned_shadow variable for HIP. A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow. It has external linkage on device side and has no initializer. It has internal linkage on host side and has initializer or static constructor. It can be accessed in both device code and host code. This allows HIP runtime to implement support of HIP texture reference. Differential Revision: https://reviews.llvm.org/D62738 llvm-svn: 364381
* Fix build failure due to missing breakYaxun Liu2019-06-261-0/+2
| | | | llvm-svn: 364380
* print-supported-cpus quality of life patch.Ziang Wan2019-06-251-3/+9
| | | | | | | Claim all input files so that clang does not give a warning. Add two short-cut aliases: -mcpu=? and -mtune=?. llvm-svn: 364362
* Revert Devirtualize destructor of final class.Rumeet Dhindsa2019-06-251-27/+3
| | | | | | This reverts r364100 (git commit 405c2b16225fc6eaf5eb8ba3ce584699a3b159ef) llvm-svn: 364359
* android: enable double-word CAS on x64Saleem Abdulrasool2019-06-251-0/+1
| | | | | | | | | | | The android target assumes that for the x86_64 target, the CPU supports SSE4.2 and popcnt. This implies that the CPU is Nehalem or newer. This should be sufficiently new to provide the double word compare and exchange instruction. This allows us to directly lower `__sync_val_compare_and_swap_16` to a `cmpxchg16b`. It appears that the libatomic in android's NDK does not provide the implementation for lowering calls to the library function. llvm-svn: 364352
* Remove redundant expression evaluation context when substituting into aRichard Smith2019-06-251-7/+5
| | | | | | | | template argument. We do need one of these but we don't need two. llvm-svn: 364347
* [ARM] Support inline assembler constraints for MVE.Simon Tatham2019-06-251-0/+11
| | | | | | | | | | | | | | | | | | | | | "To" selects an odd-numbered GPR, and "Te" an even one. There are some 8.1-M instructions that have one too few bits in their register fields and require registers of particular parity, without necessarily using a consecutive even/odd pair. Also, the constraint letter "t" should select an MVE q-register, when MVE is present. This didn't need any source changes, but some extra tests have been added. Reviewers: dmgreen, samparker, SjoerdMeijer Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60709 llvm-svn: 364331
* [OPENMP]Fix PR41966: type mismatch in runtime functions.Alexey Bataev2019-06-252-54/+71
| | | | | | | Target-based runtime functions use int64_t type for sizes, while the compiler uses size_t type. It leads to miscompilation in 32 bit mode. llvm-svn: 364327
* [clangd] Narrow rename to local symbols.Haojian Wu2019-06-251-0/+2
| | | | | | | | | | | | | | | | | | | Summary: Previously, we performed rename for all kinds of symbols (local, global). This patch narrows the scope by only renaming symbols not being used outside of the main file (with index asisitance). Renaming global symbols is not supported at the moment (return an error). Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63426 llvm-svn: 364283
* [ASTImporter] Store import errors for DeclsGabor Marton2019-06-251-18/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We add a new member which is a mapping from the already-imported declarations in the "from" context to the error status of the import of that declaration. This map contains only the declarations that were not correctly imported. The same declaration may or may not be included in ImportedDecls. This map is updated continuously during imports and never cleared (like ImportedDecls). In Import(Decl*) we use this mapping, so if there was a previous failed import we return with the existing error. We add/remove from the Lookuptable in consistency with ImportedFromDecls. When we map a decl in the 'to' context to something in the 'from' context then and only then we add it to the lookup table. When we remove a mapping then and only then we remove it from the lookup table. This patch is the first in a series of patches whose aim is to further strengthen the error handling in ASTImporter. Reviewers: a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62373 llvm-svn: 364279
* [analyzer] print() JSONify: Create pointersCsaba Dabis2019-06-252-6/+7
| | | | | | | | | | | | | | | | | Summary: - Reviewers: NoQ Reviewed By: NoQ Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63726 llvm-svn: 364271
* [analyzer] Add more timers for performance profiling.Artem Dergachev2019-06-252-13/+34
| | | | | | | | | | | | | The -analyzer-stats flag now allows you to find out how much time was spent on AST-based analysis and on path-sensitive analysis and, separately, on bug visitors, as they're occasionally a performance problem on their own. The total timer wasn't useful because there's anyway a total time printed out. Remove it. Differential Revision: https://reviews.llvm.org/D63227 llvm-svn: 364266
* [cxx2a] P1236R1: the validity of a left shift does not depend on theRichard Smith2019-06-254-11/+19
| | | | | | value of the LHS operand. llvm-svn: 364265
* [analyzer] ExprEngine: Escape pointers in bitwise operationsCsaba Dabis2019-06-251-0/+4
| | | | | | | | | | | | | | | | | | Summary: After evaluation it would be an Unknown value and tracking would be lost. Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus Reviewed By: NoQ Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63720 llvm-svn: 364259
* [Syntax] Do not glue multiple empty PP expansions to a single mappingIlya Biryukov2019-06-241-53/+130
| | | | | | | | | | | | | | | | | | | | | Summary: This change makes sure we have a single mapping for each macro expansion, even if the result of expansion was empty. To achieve that, we take information from PPCallbacks::MacroExpands into account. Previously we relied only on source locations of expanded tokens. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62953 llvm-svn: 364236
* Augment location information when dumping the AST to JSON.Aaron Ballman2019-06-241-33/+44
| | | | | | Rather than create JSON objects for source locations and ranges, we instead stream them out directly. This allows us to elide duplicate information (without JSON field reordering causing an issue) like file names and line numbers, similar to the text dump. This also adds token length information when dumping the source location. llvm-svn: 364226
* [analyzer] print() JSONify: ProgramPoint revisionCsaba Dabis2019-06-241-1/+2
| | | | | | | | | | | | | | | | | Summary: Now we also print out the filename with its path. Reviewers: NoQ Reviewed By: NoQ Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63438 llvm-svn: 364197
* [analyzer] Fix JSON dumps for ExplodedNodesCsaba Dabis2019-06-241-6/+2
| | | | | | | | | | | | | | | | | | | Summary: - Now we could see the `has_report` property in `trim-egraph` mode. - This patch also removes the trailing comma after each node. Reviewers: NoQ Reviewed By: NoQ Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63436 llvm-svn: 364193
* [CUDA][HIP] Don't set comdat attribute for CUDA device stub ↵Konstantin Pyzhov2019-06-241-0/+5
| | | | | | functions.\nDifferential Revision: https://reviews.llvm.org/D63277 llvm-svn: 364183
* [OpenCL] Restore ATOMIC_VAR_INITSven van Haastregt2019-06-241-1/+6
| | | | | | | | | We accidentally lost the ATOMIC_VAR_INIT and ATOMIC_FLAG_INIT macros in r363794. Also put the `memory_order` typedef back inside a `>= CL2.0` guard. llvm-svn: 364174
* [OpenCL] Remove more duplicates from opencl-c.hSven van Haastregt2019-06-241-29/+0
| | | | | | | | Identified the duplicate declarations using sort lib/Headers/opencl-c.h | uniq -c | grep ' 2' llvm-svn: 364173
* PR42362: Fix auto deduction of template parameter packs fromRichard Smith2019-06-241-1/+4
| | | | | | | | | type-dependent argument packs. We need to strip off the PackExpansionExpr to get the real (dependent) type rather than an opaque DependentTy. llvm-svn: 364165
* Fix TBAA representation for zero-sized fields and unnamed bit-fields.Richard Smith2019-06-221-0/+4
| | | | | | | | | | | | | | | Unnamed bit-fields should not be represented in the TBAA metadata because they do not represent storage fields (they only affect layout). Zero-sized fields should not be represented in the TBAA metadata because by definition they have no associated storage (so we will never emit a load or store through them), and they might not appear in declaration order within the struct layout. Fixes a verifier failure when emitting a TBAA-enabled load through a class type containing a zero-sized field. llvm-svn: 364140
* Remove reliance on toCharUnitsFromBits rounding down.Richard Smith2019-06-221-1/+2
| | | | llvm-svn: 364139
* AMDGPU: Fix target builtins for gfx10Matt Arsenault2019-06-221-0/+2
| | | | | | This wasn't setting some of the features from older generations. llvm-svn: 364123
* [ODRHash] Skip some typedef types.Richard Trieu2019-06-221-0/+45
| | | | | | | | | | | | | | | In some cases, a typedef only strips aways a keyword for a type, keeping the same name as the root record type. This causes some confusion when the type is defined in one modules but only forward declared in another. Skipping the typedef and going straight to the record will avoid this issue. typedef struct S {} S; S* s; // S is TypedefType here struct S; S* s; // S is RecordType here llvm-svn: 364119
* Ensure Target Features always_inline error happens in C++ cases.Erich Keane2019-06-214-13/+20
| | | | | | | | A handful of C++ cases as reported in PR42352 didn't actually give an error when always_inlining with a different target feature list. This resulted in broken IR. llvm-svn: 364109
* clang-format a block; NFCGeorge Burgess IV2019-06-211-6/+7
| | | | | | | The indentation of the return here was off, and confusing as a result. Cleaned up a bit extra while I was in the area. llvm-svn: 364104
* PR42301: Abort cleanly if we encounter a huge source file rather thanRichard Smith2019-06-211-0/+25
| | | | | | | | | | crashing. Ideally we wouldn't care about the size of a file so long as it fits in memory, but in practice we have lots of hardocded assumptions that unsigned can be used to index files, string literals, and so on. llvm-svn: 364103
OpenPOWER on IntegriCloud