summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert Fix a build bot failure and multiple warnings instances for range ↵Gabor Horvath2019-08-092-13/+3
| | | | | | | | base for loops This reverts r368459 (git commit 2bf522aea62e4fb653cacb68072167d25149099e) llvm-svn: 368462
* Fix a build bot failure and multiple warnings instances for range base for loopsGabor Horvath2019-08-092-3/+13
| | | | llvm-svn: 368459
* Rename PCH/leakfiles test so it runs on bots.Sam McCall2019-08-091-0/+0
| | | | llvm-svn: 368455
* Even more warnings utilizing gsl::Owner/gsl::Pointer annotationsGabor Horvath2019-08-092-10/+79
| | | | | | Differential Revision: https://reviews.llvm.org/D65127 llvm-svn: 368454
* More warnings regarding gsl::Pointer and gsl::Owner attributesGabor Horvath2019-08-093-20/+74
| | | | | | Differential Revision: https://reviews.llvm.org/D65120 llvm-svn: 368446
* Add SVE opaque built-in typesRichard Sandiford2019-08-0935-6/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the SVE built-in types defined by the Procedure Call Standard for the Arm Architecture: https://developer.arm.com/docs/100986/0000 It handles the types in all relevant places that deal with built-in types. At the moment, some of these places bail out with an error, including: (1) trying to generate LLVM IR for the types (2) trying to generate debug info for the types (3) trying to mangle the types using the Microsoft C++ ABI (4) trying to @encode the types in Objective C (1) and (2) are fixed by follow-on patches but (unlike this patch) they deal mostly with target-specific LLVM details, so seemed like a logically separate change. There is currently no spec for (3) and (4), so reporting an error seems like the correct behaviour for now. The intention is that the types will become sizeless types: http://lists.llvm.org/pipermail/cfe-dev/2019-June/062523.html The main purpose of the sizeless type extension is to diagnose impossible or dangerous uses of the types, such as any that would require sizeof to have a meaningful defined value. Until then, the patch sets the alignments of the types to the values specified in the link above. It also sets the sizes of the types to zero, which is chosen to be consistently wrong and shouldn't affect correctly-written code (i.e. code that would compile even with the sizeless type extension). The patch adds the common subset of functionality needed to test the sizeless type extension on the one hand and to provide SVE intrinsic functions on the other. After this patch, the two pieces of work are essentially independent. The patch is based on one by Graham Hunter: https://reviews.llvm.org/D59245 Differential Revision: https://reviews.llvm.org/D62960 llvm-svn: 368413
* [AST] No longer visiting CXXMethodDecl bodies created by compiler when ↵Johan Vikstrom2019-08-093-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | method was default created. Summary: Clang generates function bodies and puts them in the AST for default methods if it is defaulted outside the class definition. ` struct A { A &operator=(A &&O); }; A &A::operator=(A &&O) = default; ` This will generate a function body for the `A &A::operator=(A &&O)` and put it in the AST. This body should not be visited if implicit code is not visited as it is implicit. This was causing SemanticHighlighting in clangd to generate duplicate tokens and putting them in weird places. Reviewers: hokein, ilya-biryukov, gribozavr Subscribers: mgorny, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65938 llvm-svn: 368402
* Use ASSERT_THAT_ERROR instead of logAllUnhandledErrors/exitDmitri Gribenko2019-08-092-43/+10
| | | | | | | | | | | | | | Summary: ASSERT_THAT_ERROR looks like the intended helper for use in tests. Reviewers: plotfi, jkorous, compnerd Subscribers: mgorny, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65853 llvm-svn: 368399
* [clang][NFC] Consolidating usage of "FinalPhase" in Driver::BuildActions.Puyan Lotfi2019-08-091-83/+100
| | | | | | | | | | | | | | I am working to remove this concept of the "FinalPhase" in the clang driver, but it is used in a lot of different places to do argument handling for different combinations of phase pipelines and arguments. I am trying to consolidate most of the uses of "FinalPhase" into its own separate scope. Eventually, in a subsequent patch I will move all of this stuff to a separate function, and have more of the complication phase list construction setup into types::getComplicationPhases. Differential Revision: https://reviews.llvm.org/D65969 llvm-svn: 368393
* [PowerPC] [Clang] Port SSE3, SSSE3 and SSE4 intrinsics to PowerPCQiu Chaofan2019-08-0911-47/+2093
| | | | | | | | | | | | | | | Port existing headers which include x86 intrinsics implementation to PowerPC platform (using Altivec), along with tests. Also, tests about including these intrinsic headers are combined. The headers are mainly developed by Steven Munroe, with contributions from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu. Reviewed By: Jinsong Ji Differential Revision: https://reviews.llvm.org/D65630 llvm-svn: 368392
* [analyzer] CastValueChecker: Model castAs(), getAs()Csaba Dabis2019-08-092-97/+273
| | | | | | | | | | Summary: Thanks to Kristóf Umann for the great idea! Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D65889 llvm-svn: 368383
* [analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPiecesCsaba Dabis2019-08-097-99/+140
| | | | | | | | | | | | | | | | Summary: A condition could be a multi-line expression where we create the highlight in separated chunks. PathDiagnosticPopUpPiece is not made for that purpose, it cannot be added to multiple lines because we have only one ending part which contains all the notes. So that it cannot have multiple endings and therefore this patch narrows down the ranges of the highlight to the given interesting variable of the condition. It prevents HTML-breaking injections. Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D65663 llvm-svn: 368382
* [clang-scan-deps] Add minimizer support for C++20 modules.Michael J. Spencer2019-08-093-3/+124
| | | | | | This only adds support to the minimizer, it doesn't actually capture the dependencies yet. llvm-svn: 368381
* Mark clang-scan-deps test as requiring thread supportReid Kleckner2019-08-081-0/+1
| | | | | | | Otherwise the test calls a pure virtual method and crashes. Perhaps this could be improved. llvm-svn: 368354
* Fix up fd limit diagnosis codeReid Kleckner2019-08-081-2/+3
| | | | | | | | | | | Apparently Windows returns the "invalid argument" error code when the path contains invalid characters such as '<'. The test/Preprocessor/include-likely-typo.c test does this, so it was failing after r368322. Also, the diagnostic requires two arguments, so add the filename. llvm-svn: 368348
* [analyzer] Fix scan-build's plist output in plist-html mode.Artem Dergachev2019-08-081-1/+1
| | | | | | | r366941 accidentally made it delete all plist files as soon as they're produced. llvm-svn: 368338
* [clang] add REQUIRES: linux to driver test caseBrian Cain2019-08-081-0/+1
| | | | | | | The test case explicitly leverages linux, so should include it as a test requirement. llvm-svn: 368334
* [clang] add REQUIRES to driver test caseBrian Cain2019-08-081-0/+3
| | | | | | | The test case explicitly leverages x86, so should include it as a test requirement. llvm-svn: 368332
* [clang] Add no-warn support for WaBrian Cain2019-08-087-0/+26
| | | | llvm-svn: 368328
* [llvm-mc] Add reportWarning() to MCContextBrian Cain2019-08-081-2/+2
| | | | | | | Adding reportWarning() to MCContext, so that it can be used from the Hexagon assembler backend. llvm-svn: 368327
* [clang][NFC] Move matcher ignoringElidableConstructorCall's tests to ↵Yitzhak Mandelbaum2019-08-082-85/+85
| | | | | | | | | | | | | | | | | | | appropriate file. Summary: `ignoringElidableConstructorCall` is a traversal matcher, but its tests are grouped with narrowing-matcher tests. This revision moves them to the correct file. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65963 llvm-svn: 368326
* Recommit Devirtualize destructor of final class.Hiroshi Yamauchi2019-08-082-3/+50
| | | | | | | Original patch commited as r364100, reverted as r364359, recommitted as r365509, reverted as r365850. llvm-svn: 368323
* clang: Diag running out of file handles while looking for filesNico Weber2019-08-081-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | clang would only print "file not found" when it's unable to find a header file. If the reason for that is a file handle leak, that's not a very useful error message. For errors that aren't in a small whitelist ("file not found", "file is directory"), print an error with the strerror() output. This changes behavior in corner cases: If clang was out of file handles while looking in one -I dir but then suddenly wasn't when looking in the next -I dir, and both directories contained a file with the desired name, previously we'd silently return the file from the second directory. For this reason, it's important to ignore "is a directory" for this new diag: if a file foo/foo exists and -I -Ifoo are passed, an include of "foo" should successfully open file "foo" in directory "foo/" instead of complaining that "./foo" is a directory. No test since we mostly hit this when there's a handle leak somewhere, and currently there isn't one. I manually tested this with the repro steps in comment 2 on the bug below. Fixes PR42524. Differential Revision: https://reviews.llvm.org/D65956 llvm-svn: 368322
* [clang] Update `ignoringElidableConstructorCall` matcher to ignore ↵Yitzhak Mandelbaum2019-08-083-23/+47
| | | | | | | | | | | | | | | | | | | `ExprWithCleanups`. Summary: The `ExprWithCleanups` node is added to the AST along with the elidable CXXConstructExpr. If it is the outermost node of the node being matched, ignore it as well. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65944 llvm-svn: 368319
* [FIX][NFC] Update clang sema testDiogo N. Sampaio2019-08-081-1/+1
| | | | | | | | Try to fix Sema test for default alignment for when compiling to ARM, but not to android, due r9427aa2d543b llvm-svn: 368301
* [OPENMP]Add support for analysis of linear variables and step.Alexey Bataev2019-08-0821-53/+252
| | | | | | | | | | | | | | | | | Summary: Added support for basic analysis of the linear variables and linear step expression. Linear loop iteration variables must be excluded from this analysis, only non-loop iteration variables must be analyzed. Reviewers: NoQ Subscribers: guansong, cfe-commits, caomhin, kkwli0 Tags: #clang Differential Revision: https://reviews.llvm.org/D65461 llvm-svn: 368295
* [ARM] Set default alignment to 64bitsDiogo N. Sampaio2019-08-083-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The maximum alignment used by ARM arch is 64bits, not 128. This could cause overaligned memory access for 128 bit neon vector that have unpredictable behaviour. This fixes: https://bugs.llvm.org/show_bug.cgi?id=42668 Reviewers: ostannard, dmgreen, srhines, danalbert, pirama, peter.smith Reviewed By: pirama, peter.smith Subscribers: phosek, thegameg, thakis, llvm-commits, carwil, peter.smith, javed.absar, kristof.beyls, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D65000 llvm-svn: 368288
* [clang-format] fix crash involving invalid preprocessor lineKrasimir Georgiev2019-08-082-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This (invalid) fragment is crashing clang-format: ``` #if 1 int x; #elif int y; #endif ``` The reason being that the parser expects a token after `#elif`, and the subsequent parsing of the next line does not check if `CurrentToken` is null. Reviewers: gribozavr Reviewed By: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65940 llvm-svn: 368280
* [Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCaseShaurya Gupta2019-08-082-1/+17
| | | | | | | | | | | | Reviewers: arphaman, sammccall Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65883 llvm-svn: 368267
* [diagtool] Use `operator<<(Colors)` to print out colored output.Rui Ueyama2019-08-081-36/+13
| | | | | | | | | | r368131 introduced this new API to print out messages in colors. If the colored output is disabled, `operator<<(Colors)` becomes nop. No functionality change intended. Differential Revision: https://reviews.llvm.org/D65854 llvm-svn: 368259
* [Driver] Delete XFAIL: windows-msvc after D65880/r368245Fangrui Song2019-08-081-1/+0
| | | | | | `-target %itanium_abi_triple` fixed the problem. llvm-svn: 368251
* [Driver] Move LIBRARY_PATH before user inputsFangrui Song2019-08-082-9/+10
| | | | | | | | | | | | | | | | Fixes PR16786 Currently, library paths specified by LIBRARY_PATH are placed after inputs: `inputs LIBRARY_PATH stdlib` In gcc, the order is: `LIBRARY_PATH inputs stdlib` if not cross compiling. (On Darwin targets, isCrossCompiling() always returns false.) This patch changes the behavior to match gcc. Reviewed By: hfinkel Differential Revision: https://reviews.llvm.org/D65880 llvm-svn: 368245
* Inline diagnostic text into .td file. NFC.Richard Trieu2019-08-082-10/+21
| | | | llvm-svn: 368244
* Update fix-it hints for std::move warnings.Richard Trieu2019-08-083-32/+76
| | | | | | | | | | | Fix -Wpessimizing-move and -Wredundant-move when warning on initializer lists. The new fix-it hints for removing the std::move call will now also suggest removing the braces for the initializer list so that the resulting code will still be compilable. This fixes PR42832 llvm-svn: 368237
* Add target requirements for those bots which don't handle x86.Bill Wendling2019-08-071-0/+1
| | | | llvm-svn: 368202
* [Tooling] Expose ExecutorConcurrency option.Diego Astiazaran2019-08-072-1/+2
| | | | | | | | D65628 requires a flag to specify the number of threads for a clang-doc step. It would be good to use ExecutorConcurrency after exposing it instead of creating a new one that has the same purpose. Differential Revision: https://reviews.llvm.org/D65833 llvm-svn: 368196
* [clang][NFC] Fix typo in matcher commentYitzhak Mandelbaum2019-08-072-2/+2
| | | | | | Also updates corresponding html doc. llvm-svn: 368188
* Remove LLVM mutexes from clang in favor of std::mutexBenjamin Kramer2019-08-075-11/+7
| | | | | | | None of those need to be recursive mutexes. No functionality change intended. llvm-svn: 368173
* [OPENMP]Set default version to OpenMP 4.5.Alexey Bataev2019-08-074-10/+13
| | | | | | | Since clang fully supports OpenMP 4.5, set the default version to 4.5 instead of 3.1. llvm-svn: 368172
* [OPENMP]Add standard macro value _OPENMP for OpenMP 5.0.Alexey Bataev2019-08-073-0/+7
| | | | | | | | | According to the OpenMP standard, compiler must define _OPENMP macro, which has value in format yyyymm, where yyyy is the year of the standard and mm is the month of the standard. For OpenMP 5.0 this value must be set to 201811. llvm-svn: 368170
* [ASTImporter] Do not import FunctionTemplateDecl in record twice.Balazs Keri2019-08-072-2/+58
| | | | | | | | | | | | | | | | | | | | | Summary: For functions there is a check to not duplicate the declaration if it is in a record (class). For function templates there was no similar check, if a template (in the same class) was imported multiple times the FunctionTemplateDecl was created multiple times with the same templated FunctionDecl. This can result in problems with the declaration chain. Reviewers: martong, a.sidorin, shafik, a_sidorin Reviewed By: a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65203 llvm-svn: 368163
* Replace non-recursive sys::Mutex users with std::mutexBenjamin Kramer2019-08-073-11/+9
| | | | | | | Also remove a use of sys::MutexImpl, that's just evil. No functionality change intended. llvm-svn: 368157
* [clang] Fix mismatched args constructing AddressSpaceAttr.Anton Bikineev2019-08-072-3/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D65589 llvm-svn: 368152
* Replace llvm::MutexGuard/UniqueLock with their standard equivalentsBenjamin Kramer2019-08-073-8/+8
| | | | | | | All supported platforms have <mutex> now, so we don't need our own copies any longer. No functionality change intended. llvm-svn: 368149
* gsl::Owner/gsl::Pointer: Add implicit annotations for some std typesMatthias Gehre2019-08-076-2/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Hard code gsl::Owner/gsl::Pointer for std types. The paper mentions some types explicitly. Generally, all containers and their iterators are covered. For iterators, we cover both the case that they are defined as an nested class or as an typedef/using. I have started to test this implementation against some real standard library implementations, namely libc++ 7.1.0, libc++ 8.0.1rc2, libstdc++ 4.6.4, libstdc++ 4.8.5, libstdc++ 4.9.4, libstdc++ 5.4.0, libstdc++ 6.5.0, libstdc++ 7.3.0, libstdc++ 8.3.0 and libstdc++ 9.1.0. The tests are currently here https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.sh https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.cpp I think due to their dependency on a standard library, they are not a good fit for clang/test/. Where else could I put them? Reviewers: gribozavr, xazax.hun Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64448 llvm-svn: 368147
* Remove inclusion of a private gmock header from a testDmitri Gribenko2019-08-071-1/+0
| | | | llvm-svn: 368132
* Re-submit r367649: Improve raw_ostream so that you can "write" colors using ↵Rui Ueyama2019-08-071-1/+2
| | | | | | | | | operator<< The original patch broke buildbots, perhaps because it changed the default setting whether colors are enabled or not. llvm-svn: 368131
* [RISCV] Remove duplicated logic when determining the target ABIRoger Ferrer Ibanez2019-08-072-13/+9
| | | | | | | | We were calculating twice ilp32/lp64. Do this in one place instead. Differential Revision: https://reviews.llvm.org/D48357 llvm-svn: 368128
* [clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in createPuyan Lotfi2019-08-064-62/+110
| | | | | | | | | | | | | | I also have replaced all the instances of "auto DW = DirectoryWatcher::create" with llvm::Expected<std::unique_ptr<DirectoryWatcher>> DW = DirectoryWatcher::create to make it more clear that DirectoryWatcher::create is returning an Expected. I've also allowed for logAllUnhandledErrors to consume errors in the case were DirectoryWatcher::create produces them. Differential Revision: https://reviews.llvm.org/D65829 llvm-svn: 368108
* Delay diagnosing asm constraints that require immediates until after inliningBill Wendling2019-08-066-62/+35
| | | | | | | | | | | | | | | | Summary: An inline asm call may result in an immediate input value after inlining. Therefore, don't emit a diagnostic here if the input isn't an immediate. Reviewers: joerg, eli.friedman, rsmith Subscribers: asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, s.egerton, krytarowski, mgorny, riccibruno, eraman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60943 llvm-svn: 368104
OpenPOWER on IntegriCloud