summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove outdated FIXME.Richard Smith2019-09-201-4/+0
| | | | llvm-svn: 372438
* Fix assertion failure when constant evaluation of a switch jumps over anRichard Smith2019-09-202-0/+40
| | | | | | uninitialized variable in an init-statement of a 'for' or 'if'. llvm-svn: 372437
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-2011-7/+18
| | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. llvm-svn: 372436
* Ensure AtomicExpr goes through SEMA checking after TreeTransformErich Keane2019-09-204-55/+81
| | | | | | | | | | | RebuildAtomicExpr was skipping doing semantic analysis which broke in the cases where the expressions were not dependent. This resulted in the ImplicitCastExpr from an array to a pointer being lost, causing a crash in IR CodeGen. Differential Revision: https://reviews.llvm.org/D67854 llvm-svn: 372422
* Fix a documentation errorKristof Umann2019-09-201-1/+1
| | | | llvm-svn: 372419
* [www] Turn 'Clang 9' boxes green in C++ status pages now Clang 9 isRichard Smith2019-09-203-30/+27
| | | | | | released. llvm-svn: 372415
* Reland '[analyzer][MallocChecker][NFC] Document and reorganize some functions'Kristof Umann2019-09-201-463/+720
| | | | | | Differential Revision: https://reviews.llvm.org/D54823 llvm-svn: 372414
* [libTooling] Add `ifBound`, `elseBranch` RangeSelector combinators.Yitzhak Mandelbaum2019-09-203-0/+87
| | | | | | | | | | | | | | | | | | Summary: Adds two new combinators and corresponding tests to the RangeSelector library. * `ifBound` -- conditional evaluation of range-selectors, based on whether a given node id is bound in the match. * `elseBranch` -- selects the source range of the else and its statement. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67621 llvm-svn: 372410
* [CUDA][HIP] Fix hostness of defaulted constructorYaxun Liu2019-09-202-12/+70
| | | | | | | | | | | Clang does not respect the explicit device host attributes of defaulted special members. Also clang does not respect the hostness of special members determined by their first declarations. Clang also adds duplicate implicit device or host attributes in certain cases. This patch fixes that. Differential Revision: https://reviews.llvm.org/D67509 llvm-svn: 372394
* [SystemZ] Add SystemZ as supporting target in help text for -mfentry.Jonas Paulsson2019-09-202-2/+2
| | | | | | | => "Insert calls to fentry at function entry (x86/SystemZ only)" Review: Ulrich Weigand llvm-svn: 372387
* [StaticAnalyzer] Use llvm::StringLiteral instead of StringRef in few placesBenjamin Kramer2019-09-201-6/+7
| | | | | | | | StringRef's constexpr constructor seems to be extremely slow in MSVC 2017, so don't use it for generated tables. Should make PR43369 a bit better, no functionality change. llvm-svn: 372386
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-202-11/+20
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). llvm-svn: 372368
* [NFCI] Always initialize const members of AttributeCommonInfoAlex Langford2019-09-201-2/+2
| | | | | | | | Some compilers require that const fields of an object must be explicitly initialized by the constructor. I ran into this issue building with clang 3.8 on Ubuntu 16.04. llvm-svn: 372363
* [Consumed] Treat by-value class arguments as consuming by default, like ↵Nicholas Allegra2019-09-192-3/+30
| | | | | | | | rvalue refs. Differential Revision: https://reviews.llvm.org/D67743 llvm-svn: 372361
* Fix for stringized function-macro args continued across linesAlex Lorenz2019-09-192-10/+23
| | | | | | | | | | | In case of certain #define'd macros, there's a space just before line continuation that the minimized-source lexer was missing to include, resulting in invalid stringize. Patch by: kousikk (Kousik Kumar) Differential Revision: https://reviews.llvm.org/D67635 llvm-svn: 372360
* Model converted constant expressions as full-expressions.Richard Smith2019-09-194-44/+66
| | | | | | | | | | This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No functionality change intended. llvm-svn: 372359
* [CUDA][HIP] Re-apply part of r372318.Michael Liao2019-09-193-4/+25
| | | | | | | | | | - r372318 causes violation of `use-of-uninitialized-value` detected by MemorySanitizer. Once `Viable` field is set to false, `FailureKind` needs setting as well as it will be checked during destruction if `Viable` is not true. - Revert the part trying to skip `std::vector` erasing. llvm-svn: 372356
* Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"Mitch Phillips2019-09-193-30/+9
| | | | | | | | Broke the msan buildbots (see comments on rL372318 for more details). This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02. llvm-svn: 372353
* Revert r372325 - Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-193-6/+3
| | | | | | This corrects the testing issues. llvm-svn: 372334
* Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-192-1/+4
| | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/17919 llvm-svn: 372325
* Remove an unsafe member variable that wasn't needed; NFC.Aaron Ballman2019-09-192-4/+1
| | | | | | People use the AST dumping interface while debugging, so it's not safe to assume that a declaration will be dumped before a constant expression is dumped. This means the Context member may not get set properly and problems would happen. Rather than rely on the interface that requires the ASTContext, call the generic dump() interface instead; this allows us to remove the Context member variable. llvm-svn: 372323
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-194-23/+217
| | | | | | | | | | | | | | | | | | | Allow setting a MinVersion, stating from which OpenCL version a builtin function is available, and a MaxVersion, stating from which OpenCL version a builtin function should not be available anymore. Guard some definitions of the "work-item" builtin functions according to the OpenCL versions from which they are available. Add the "vector data load and store" builtin functions (e.g. vload/vstore), whose signatures differ before and after OpenCL 2.0 in the pointer argument address spaces. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63504 llvm-svn: 372321
* Clean out unused diagnostics. NFC.Benjamin Kramer2019-09-195-21/+0
| | | | llvm-svn: 372319
* [CUDA][HIP] Fix typo in `BestViableFunction`Michael Liao2019-09-193-9/+30
| | | | | | | | | | | | | | | | | | | Summary: - Should consider viable ones only when checking SameSide candidates. - Replace erasing with clearing viable flag to reduce data moving/copying. - Add one and revise another one as the diagnostic message are more relevant compared to previous one. Reviewers: tra Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D67730 llvm-svn: 372318
* [TestCommit] Trivial change to test commit access.Mark Murray2019-09-191-1/+1
| | | | llvm-svn: 372307
* [TestCommit] Trivial change to test commit access.Mark Murray2019-09-191-1/+1
| | | | llvm-svn: 372306
* [Builtins] Delete setjmp_syscall and qsetjmpFangrui Song2019-09-191-2/+0
| | | | | | | | Similar to the resolution of gcc PR71876. Nobody uses them or needs the [-Wincomplete-setjmp-declaration] diagnostic. llvm-svn: 372299
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-195-7/+40
| | | | | | | | | | | | | | | | | | | | | | | The clang intrinsic __builtin_preserve_access_index() currently has signature: const void * __builtin_preserve_access_index(const void * ptr) This may cause compiler warning when: - parameter type is "volatile void *" or "const volatile void *", or - the assign-to type of the intrinsic does not have "const" qualifier. Further, this signature does not allow dereference of the builtin result pointer as it is a "const void *" type, which adds extra step for the user to do type casting. Let us change the signature to: PointerT __builtin_preserve_access_index(PointerT ptr) such that the result and argument types are the same. With this, directly dereferencing the builtin return value becomes possible. Differential Revision: https://reviews.llvm.org/D67734 llvm-svn: 372294
* Initialize all fields in ABIArgInfo.Serge Guelton2019-09-191-6/+4
| | | | | | | | | | | Due to usage of an uninitialized fields, we end up with a Conditional jump or move depends on uninitialised value Fixes https://bugs.llvm.org/show_bug.cgi?id=40547 Commited on behalf of Martin Liska <mliska@suse.cz> llvm-svn: 372281
* [analyzer] PR43102: Fix an assertion and an out-of-bounds error for ↵Kristof Umann2019-09-183-8/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic location construction Summary: https://bugs.llvm.org/show_bug.cgi?id=43102 In today's edition of "Is this any better now that it isn't crashing?", I'd like to show you a very interesting test case with loop widening. Looking at the included test case, it's immediately obvious that this is not only a false positive, but also a very bad bug report in general. We can see how the analyzer mistakenly invalidated `b`, instead of its pointee, resulting in it reporting a null pointer dereference error. Not only that, the point at which this change of value is noted at is at the loop, rather then at the method call. It turns out that `FindLastStoreVisitor` works correctly, rather the supplied explodedgraph is faulty, because `BlockEdge` really is the `ProgramPoint` where this happens. {F9855739} So it's fair to say that this needs improving on multiple fronts. In any case, at least the crash is gone. Full ExplodedGraph: {F9855743} Reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, TWeaver Subscribers: JesperAntonsson, uabelho, Ka-Ka, bjope, whisperity, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66716 llvm-svn: 372269
* fix build, adjust test also for Windows path separatorLubos Lunak2019-09-182-2/+2
| | | | | | Introduced in 1e9c1d2b7bfc. llvm-svn: 372263
* On PowerPC, Secure-PLT by default for FreeBSD 13 and higherDimitry Andric2019-09-181-1/+2
| | | | | | | | | | | | | | | | | | | Summary: In https://svnweb.freebsd.org/changeset/base/349351, FreeBSD 13 and higher transitioned to Secure-PLT for PowerPC. This part contains the changes in clang's PPC architecture defaults. Reviewers: emaste, jhibbits, hfinkel Reviewed By: jhibbits Subscribers: wuzish, nemanjai, krytarowski, kbarton, MaskRay, jsji, shchenz, steven.zhang, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67119 llvm-svn: 372261
* [OPENMP]Fix for PR43349: Crash for privatized loop bound.Alexey Bataev2019-09-182-2/+20
| | | | | | | | If the variable, used in the loop boundaries, is not captured in the construct, this variable must be considered as undefined if it was privatized. llvm-svn: 372252
* actually also compile output in tests for -frewrite-includesLubos Lunak2019-09-1811-61/+74
| | | | | | | | | Checking that the created output matches something is nice, but this should also check whether the output makes sense. Differential Revision: https://reviews.llvm.org/D63979 llvm-svn: 372250
* [clang-format][PR41899] PointerAlignment: Left leads to useless space in ↵Paul Hoad2019-09-182-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lambda intializer expression Summary: https://bugs.llvm.org/show_bug.cgi?id=41899 ```auto lambda = [&a = a]() { a = 2; };``` is formatted as ```auto lambda = [& a = a]() { a = 2; };``` With an extra space if PointerAlignment is set to Left > The space "& a" looks strange when there is no type in the lambda's intializer expression. This can be worked around with by setting "PointerAlignment: Right", but ideally "PointerAlignment: Left" would not add a space in this case. Reviewers: klimek, owenpan, krasimir, timwoj Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67718 llvm-svn: 372249
* make -frewrite-includes also rewrite conditions in #if/#elifLubos Lunak2019-09-184-129/+207
| | | | | | | | | | | | | | | Those conditions may use __has_include, which needs to be rewritten. The existing code has already tried to rewrite just __has_include, but it didn't work with macro expansion, so e.g. Qt's "#define QT_HAS_INCLUDE(x) __has_include(x)" didn't get handled properly. Since the preprocessor run knows what each condition evaluates to, just rewrite the entire condition. This of course requires that the -frewrite-include pass has the same setup as the following compilation, but that has always been the requirement. Differential Revision: https://reviews.llvm.org/D63508 llvm-svn: 372248
* [Sema] Suppress -Wformat diagnostics for bool types when printed using %hhdErik Pilkington2019-09-184-0/+67
| | | | | | | | | | | Also, add a diagnostic under -Wformat for printing a boolean value as a character. rdar://54579473 Differential revision: https://reviews.llvm.org/D66856 llvm-svn: 372247
* [clang-format][PR41964] Fix crash with SIGFPE when TabWidth is set to 0 and ↵Paul Hoad2019-09-184-17/+99
| | | | | | | | | | | | | | | | | | | | | | | | | line starts with tab Summary: clang-format 8.0 crashes with SIGFPE (floating point exception) when formatting following file: app.cpp: void a() { //line starts with '\t' } $ clang-format -style='{TabWidth: 0}' app.cpp Reviewers: owenpan, klimek, russellmcc, timwoj Reviewed By: klimek Subscribers: cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D67670 llvm-svn: 372246
* [c++20] P1331R2: Allow transient use of uninitialized objects inRichard Smith2019-09-1814-192/+446
| | | | | | constant evaluation. llvm-svn: 372237
* [OPENMP5.0]Allow multiple context selectors in the context selectorAlexey Bataev2019-09-189-125/+172
| | | | | | | | | sets. According to OpenMP 5.0, context selector set might include several context selectors, separated with commas. Patch fixes this problem. llvm-svn: 372235
* Recommit -r372180Erich Keane2019-09-181-30/+179
| | | | | | | | | | | | | | | | | | Commit message below, original caused the sphinx build bot to fail, this one should fix it. Create UsersManual section entitled 'Controlling Floating Point Behavior' Create a new section for documenting the floating point options. Move all the floating point options into this section, and add new entries for the floating point options that exist but weren't previously described in the UsersManual. Patch By: mibintc Differential Revision: https://reviews.llvm.org/D67517 llvm-svn: 372229
* Revert r372082 "[Clang] Pragma vectorize_width() implies vectorize(enable)"Hans Wennborg2019-09-183-38/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This broke the Chromium build. Consider the following code: float ScaleSumSamples_C(const float* src, float* dst, float scale, int width) { float fsum = 0.f; int i; #if defined(__clang__) #pragma clang loop vectorize_width(4) #endif for (i = 0; i < width; ++i) { float v = *src++; fsum += v * v; *dst++ = v * scale; } return fsum; } Compiling at -Oz, Clang now warns: $ clang++ -target x86_64 -Oz -c /tmp/a.cc /tmp/a.cc:1:7: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] this suggests it's not actually enabling vectorization hard enough. At -Os it asserts instead: $ build.release/bin/clang++ -target x86_64 -Os -c /tmp/a.cc clang-10: /work/llvm.monorepo/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2734: void llvm::InnerLoopVectorizer::emitMemRuntimeChecks(llvm::Loop*, llvm::BasicBlock*): Assertion ` !BB->getParent()->hasOptSize() && "Cannot emit memory checks when optimizing for size"' failed. Of course neither of these are what the developer expected from the pragma. > Specifying the vectorization width was supposed to implicitly enable > vectorization, except that it wasn't really doing this. It was only > setting the vectorize.width metadata, but not vectorize.enable. > > This should fix PR27643. > > Differential Revision: https://reviews.llvm.org/D66290 llvm-svn: 372225
* [mips] Pass "xgot" flag as a subtarget featureSimon Atanasyan2019-09-184-9/+19
| | | | | | | | | We need "xgot" flag in the MipsAsmParser to implement correct expansion of some pseudo instructions in case of using 32-bit GOT (XGOT). MipsAsmParser does not have reference to MipsSubtarget but has a reference to "feature bit set". llvm-svn: 372220
* [AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling.Simon Pilgrim2019-09-182-7/+3
| | | | | | The static analyzer noticed that we were dereferencing it even when the default null value was being used. Further investigation showed that we never explicitly set the parameter so I've just removed it entirely. llvm-svn: 372217
* [lldb] Print better diagnostics for user expressions and modulesRaphael Isemann2019-09-182-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently our expression evaluators only prints very basic errors that are not very useful when writing complex expressions. For example, in the expression below the user made a type error, but it's not clear from the diagnostic what went wrong: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: invalid operands to binary expression ('int' and 'double') ``` This patch enables full Clang diagnostics in our expression evaluator. After this patch the diagnostics for the expression look like this: ``` (lldb) expr printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) error: <user expression 1>:1:54: invalid operands to binary expression ('int' and 'float') printf("Modulos are:", foobar%mo1, foobar%mo2, foobar%mo3) ~~~~~~^~~~ ``` To make this possible, we now emulate a user expression file within our diagnostics. This prevents that the user is exposed to our internal wrapper code we inject. Note that the diagnostics that refer to declarations from the debug information (e.g. 'note' diagnostics pointing to a called function) will not be improved by this as they don't have any source locations associated with them, so caret or line printing isn't possible. We instead just suppress these diagnostics as we already do with warnings as they would otherwise just be a context message without any context (and the original diagnostic in the user expression should be enough to explain the issue). Fixes rdar://24306342 Reviewers: JDevlieghere, aprantl, shafik, #lldb Reviewed By: JDevlieghere, #lldb Subscribers: usaxena95, davide, jingham, aprantl, arphaman, kadircet, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D65646 llvm-svn: 372203
* [X86] Prevent assertion when calling a function that returns double with ↵Craig Topper2019-09-181-0/+20
| | | | | | | | -mno-sse2 on x86-64. As seen in the most recent updates to PR10498 llvm-svn: 372197
* [Timers] Fix printing some `-ftime-report` sections twice. Fixes PR40328.Volodymyr Sapsai2019-09-183-0/+3
| | | | | | | | | | | | | | | | | | | | Starting from r324788 timer groups aren't cleared automatically when printed out. As a result some timer groups were printed one more time. For example, "Pass execution timing report" was printed again in `ManagedStatic<PassTimingInfo>` destructor, "DWARF Emission" in `ManagedStatic<Name2PairMap> NamedGroupedTimers` destructor. Fix by clearing timer groups manually. Reviewers: thegameg, george.karpenkov Reviewed By: thegameg Subscribers: aprantl, jkorous, dexonsmith, ributzka, aras-p, cfe-commits Differential Revision: https://reviews.llvm.org/D67683 llvm-svn: 372191
* [ARM] Update clang for removal of vfp2d16 and vfp2d16spEli Friedman2019-09-174-27/+26
| | | | | | | | Matching fix for https://reviews.llvm.org/D67375 (r372186). Differential Revision: https://reviews.llvm.org/D67467 llvm-svn: 372187
* Revert "Create UsersManual section entitled 'Controlling Floating Point"Erich Keane2019-09-171-159/+30
| | | | | | This reverts commit a08d5a4b0ebd44dc64f41049ed4e97a3c6d31498. llvm-svn: 372185
* [Sema] Split of versions of -Wimplicit-{float,int}-conversion for ↵Erik Pilkington2019-09-176-32/+156
| | | | | | | | | | | | | Objective-C BOOL Also, add a diagnostic group, -Wobjc-signed-char-bool, to control all these related diagnostics. rdar://51954400 Differential revision: https://reviews.llvm.org/D67559 llvm-svn: 372183
OpenPOWER on IntegriCloud