summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Make more friendly with unions. Reviewed as https://reviews.llvm.org/D61858Marshall Clow2019-05-132-1/+23
| | | | llvm-svn: 360614
* [clang][ASTContext] Call setAttached for comments attached to a declarationJan Korous2019-05-131-0/+2
| | | | | | | | | | | This is a bug affecting performance when compiling with -Wdocumentation. In Sema::ActOnDocumentable we're checking whether there are any comments unattached to declaration at the end of comment list whenever we encounter new documentable declaration. Since this property of RawComment was never set we were trying to find comments every time and that involves at least a couple expensive SourceLocation decompositions. Differential Revision: https://reviews.llvm.org/D61538 llvm-svn: 360607
* Revert r360559 "[c++20] P1064R0: Allow virtual function calls in constant ↵Hans Wennborg2019-05-1314-414/+52
| | | | | | | | | expression evaluation." This caused Chromium builds to hit the new "can't handle virtual calls with virtual bases" assert. Reduced repro coming up. llvm-svn: 360580
* [ASTImporter] Separate unittest filesGabor Marton2019-05-136-1065/+1189
| | | | | | | | | | | | | | | | Summary: Move generic redecl chain tests and visibility tests into their own separate test files. Reviewers: a_sidorin, a.sidorin, shafik Subscribers: mgorny, rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61786 llvm-svn: 360572
* PR41845: Detect and reject mismatched inner/outer pack expansion sizesRichard Smith2019-05-137-13/+41
| | | | | | in fold expressions rather than crashing. llvm-svn: 360563
* PR41854: Don't assert when constant-evaluating a member function call on an ↵Richard Smith2019-05-132-0/+11
| | | | | | invalid designator. llvm-svn: 360560
* [c++20] P1064R0: Allow virtual function calls in constant expressionRichard Smith2019-05-1314-52/+414
| | | | | | evaluation. llvm-svn: 360559
* Fix test to use -cc1.Leonard Chan2019-05-121-1/+2
| | | | llvm-svn: 360548
* [clang] Regenerate AST matcher docs 📖Stephane Moore2019-05-121-24/+24
| | | | | | | | | | | | | | | | | | | Summary: The documentation seems to have been manually edited in https://reviews.llvm.org/rGa282bde69e375985edd4c371b79864f617380ad5. This commit regenerates the documentation and commits the resulting diff. Reviewers: benhamilton, mwyman Reviewed By: mwyman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61769 llvm-svn: 360545
* Fix for P41852 where builtin attributes were being caught by ↵Leonard Chan2019-05-122-2/+15
| | | | | | FindLocsWithCommonFileID(). llvm-svn: 360544
* make -ftime-trace also print template argumentsLubos Lunak2019-05-123-4/+17
| | | | | | | | | Without this, I get e.g. 'PerformPendingInstantiations' -> 'std::fill', now I get 'std::fill<unsigned long *, int>'. Differential Revision: https://reviews.llvm.org/D61822 llvm-svn: 360539
* Reject attempts to call non-static member functions on objects outsideRichard Smith2019-05-124-57/+202
| | | | | | | | | | | | | | | | their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. This reinstates r360499, reverted in r360531. llvm-svn: 360538
* Fix handling of objects under construction during constant expressionRichard Smith2019-05-126-96/+223
| | | | | | | | | | | | | evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. This reinstates r360464 (reverted in r360531) with a workaround for an MSVC bug that previously caused the Windows bots to fail. llvm-svn: 360537
* Revert rL360499 and rL360464 from cfe/trunk:Simon Pilgrim2019-05-117-410/+145
| | | | | | | | | | | | | | | | | | | | | | | | Reject attempts to call non-static member functions on objects outside their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. ........ Fix handling of objects under construction during constant expression evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. ........ Fixes windows buildbots llvm-svn: 360531
* ConstantLValueEmitter::tryEmitAbsolute - remove unused variable. NFCI.Simon Pilgrim2019-05-111-3/+1
| | | | | | Duplicate getOffset() call. llvm-svn: 360515
* Reject attempts to call non-static member functions on objects outsideRichard Smith2019-05-114-57/+202
| | | | | | | | | | | | | | their lifetime in constant expressions. This is undefined behavior per [class.cdtor]p2. We continue to allow this for objects whose values are not visible within the constant evaluation, because there's no way we can tell whether the access is defined or not, existing code relies on the ability to make such calls, and every other compiler allows such calls. llvm-svn: 360499
* [cc1as] Change -compress-debug-sections= to use --Fangrui Song2019-05-115-17/+15
| | | | | | The double dash form is documented by GNU as, used by gcc, and accepted by llvm-mc. llvm-svn: 360495
* [Darwin] Introduce a new flag, -fapple-link-rtlib that forces linking of the ↵Amara Emerson2019-05-104-11/+37
| | | | | | | | | | | | | | | builtins library. This driver flag is useful when users want to link against the compiler's builtins, but nothing else, and so use flags like -nostdlib. Darwin can't use -nolibc & nostdlib++ like other platforms on because we disable all runtime lib linking with -static, which we still want to have an option to link with the builtins. Differential Revision: https://reviews.llvm.org/D58320 llvm-svn: 360483
* [CodeGen][ObjC] Emit invoke instead of call to call `objc_release` whenAkira Hatanaka2019-05-102-1/+12
| | | | | | | | | | | | | | | | | | necessary. Prior to r349952, clang used to call objc_msgSend when sending a release messages, emitting an invoke instruction instead of a call instruction when it was necessary to catch an exception. That changed in r349952 because runtime function objc_release is called as a nounwind function, which broke programs that were overriding the dealloc method and throwing an exception from it. This patch restores the behavior prior to r349952. rdar://problem/50253394 Differential Revision: https://reviews.llvm.org/D61803 llvm-svn: 360474
* [ThinLTO] Clang test changes for new CanAutoHide flagTeresa Johnson2019-05-102-2/+2
| | | | llvm-svn: 360468
* Fixed tests where grep was not matching the linefeedAlexandre Ganea2019-05-104-6/+12
| | | | | | | | When files are synchronized locally as CRLF on Windows, grep didn't match the newline. Switched to FileCheck instead. Differential Revision: https://reviews.llvm.org/D61496 llvm-svn: 360467
* Add target triple to test.Leonard Chan2019-05-101-1/+1
| | | | llvm-svn: 360465
* Fix handling of objects under construction during constant expressionRichard Smith2019-05-105-96/+216
| | | | | | | | | | evaluation. It's not enough to just track the LValueBase that we're evaluating, we need to also track the path to the objects whose constructors are running. llvm-svn: 360464
* Improve interface of APValuePathEntry.Richard Smith2019-05-104-52/+62
| | | | llvm-svn: 360463
* Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two waysPaul Robinson2019-05-101-1/+1
| | | | | | to say the same thing. llvm-svn: 360452
* Fix and test for assertion error in P41835.Leonard Chan2019-05-102-0/+12
| | | | llvm-svn: 360448
* Replace 'REQUIRES: not_?san' with 'UNSUPPORTED: ?san' as that betterPaul Robinson2019-05-104-4/+4
| | | | | | expresses the intent of the exclusion. llvm-svn: 360447
* [Sema] Mark array element destructors referenced during initializationErik Pilkington2019-05-107-60/+171
| | | | | | | | | | | | This fixes a crash where we would neglect to mark a destructor referenced for an __attribute__((no_destory)) array. The destructor is needed though, since if an exception is thrown we need to cleanup the elements. rdar://48462498 Differential revision: https://reviews.llvm.org/D61165 llvm-svn: 360446
* [libclang] Forward isInline for NamespaceDecl to libclangNikolai Kosjar2019-05-105-1/+26
| | | | llvm-svn: 360428
* Add name comments for bools passed to getObjCEncodingForTypeImpl()Nico Weber2019-05-101-52/+85
| | | | | | | | No behavior change. Medium term, probably want to use a bitmask instead of 8 distinct bool parameters, but let's make the call sites easier to read first. llvm-svn: 360427
* Replace lit feature keyword 'non-ms-sdk' with 'ms-sdk'; eliminatePaul Robinson2019-05-104-13/+9
| | | | | | 'non-ps4-sdk' and use just 'ps4'. llvm-svn: 360425
* Fix Wdocumentation warning. NFCI.Simon Pilgrim2019-05-101-2/+3
| | | | llvm-svn: 360419
* [Preamble] Stop circular inclusion of main file when building preambleNikolai Kosjar2019-05-103-1/+15
| | | | | | | | | | | | | | | If a header file was processed for the second time, we could end up with a wrong conditional stack and skipped ranges: In the particular example, if the header guard is evaluated the second time and it is decided to skip the conditional block, the corresponding "#endif" is never seen since the preamble does not include it and we end up in the Tok.is(tok::eof) case with a wrong conditional stack. Detect the circular inclusion, emit a diagnostic and stop processing the inclusion. llvm-svn: 360418
* Revert "Revert "[clang-format] Keep protobuf "package" statement on one line""Krasimir Georgiev2019-05-102-3/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: Top-level "package" and "import" statements should generally be kept on one line, for all languages. ---- This reverts commit rL356912. The regression from rL356835 was fixed via rC358275. Reviewers: krasimir, sammccall, MyDeveloperDay, xinz, dchai, klimek Reviewed By: krasimir, xinz, dchai Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60661 llvm-svn: 360411
* Delete write-only HasQualifiers after rC360370Fangrui Song2019-05-101-2/+0
| | | | llvm-svn: 360408
* Added an assert in `isConstantInitializer`: initializer lists must be in ↵Dmitri Gribenko2019-05-101-0/+1
| | | | | | | | | | | | semantic form Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61485 llvm-svn: 360406
* Assume `__cxa_allocate_exception` returns an under-aligned memory onAkira Hatanaka2019-05-109-18/+148
| | | | | | | | | | | | | | | | | | | | | Darwin if the version of libc++abi isn't new enough to include the fix in r319123 This patch resurrects r264998, which was committed to work around a bug in libc++abi that was causing _cxa_allocate_exception to return a memory that wasn't double-word aligned. http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160328/154332.html In addition, this patch makes clang issue a warning if the type of the thrown object requires an alignment that is larger than the minimum guaranteed by the target C++ runtime. rdar://problem/49864414 Differential Revision: https://reviews.llvm.org/D61667 llvm-svn: 360404
* Change -gz and -Wa,--compress-debug-sections to use gABI compression ↵Fangrui Song2019-05-103-5/+6
| | | | | | | | | | | | | | | | | | | | | | | (SHF_COMPRESSED) Since July 15, 2015 (binutils-gdb commit 19a7fe52ae3d0971e67a134bcb1648899e21ae1c, included in 2.26), gas --compress-debug-sections=zlib (gcc -gz) means zlib-gabi: SHF_COMPRESSED. Before that it meant zlib-gnu (.zdebug). clang's -gz was introduced in rC306115 (Jun 2017) to indicate zlib-gnu. It is 2019 now and it is not unreasonable to assume users of the new feature to have new linkers (ld.bfd/gold >= 2.26, lld >= rLLD273661). Change clang's default accordingly to improve standard conformance. zlib-gnu becomes out of fashion and gets poorer toolchain support. Its mangled names confuse tools and are more likely to cause problems. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D61689 llvm-svn: 360403
* Remember to decay arrays to pointers before checking whether theRichard Smith2019-05-092-3/+19
| | | | | | left-hand side of an -> operator is a pointer to class type. llvm-svn: 360387
* NFC, make XFAIL work on macOS correctly for ↵Alex Lorenz2019-05-091-1/+1
| | | | | | | | | | test/Driver/XRay/xray-instrument-os.c The test 'test/Driver/XRay/xray-instrument-os.c' is supposed to XFAIL on -darwin triples. However, LLVM can be configured to be built with a -macos triple instead, which is equivalent to -darwin. This commit updates the XFAIL condition to also XFAIL with a -macos host triple. llvm-svn: 360374
* DR1872: don't allow any calls to virtual functions in constantRichard Smith2019-05-098-19/+87
| | | | | | | | evaluation. Not even in cases where we would not actually perform virtual dispatch. llvm-svn: 360370
* Simplify tracking of end of consumed decl-specifier sequence.Richard Smith2019-05-091-11/+7
| | | | | | | | Patch by Tyker! Differential Revision: https://reviews.llvm.org/D60934 llvm-svn: 360369
* [OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).Alexey Bataev2019-05-099-16/+112
| | | | | | | | | If the combined directive has default(none) clause and has clauses for inner directive that reference some variables, for which data-sharing attributes are not specified, the error messages should be emitted for such variables. llvm-svn: 360365
* Specify target triple to fix the tests I committed in r360359 that areAkira Hatanaka2019-05-093-3/+3
| | | | | | still failing. llvm-svn: 360363
* [OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.Alexey Bataev2019-05-0941-69/+121
| | | | | | | | If the default(none) was specified for the construct, we might miss diagnostic for the globals without explicitly specified data-sharing attributes. Patch fixes this problem. llvm-svn: 360362
* Specify ObjC runtime to fix the tests I committed in r360359 that areAkira Hatanaka2019-05-093-3/+3
| | | | | | failing. llvm-svn: 360361
* [CodeGen][ObjC] Remove the leading `l_` from ObjC symbols and makeAkira Hatanaka2019-05-0924-214/+232
| | | | | | | | | | | | | | | private symbols in the __DATA segment internal. This prevents the linker from removing the symbol names. Keeping the symbols visible enables tools to collect various information about the symbols, for example, tools that discover whether or not a symbol gets dirtied. rdar://problem/48887111 Differential Revision: https://reviews.llvm.org/D61454 llvm-svn: 360359
* [OpenCL] Make global ctor init function a kernelAnastasia Stulova2019-05-095-200/+244
| | | | | | | | | | | | | | We need to be able to enqueue internal function that initializes global constructors on the host side. Therefore it has to be converted to a kernel. This change factors out common logic for adding kernel metadata and moves it from CodeGenFunction to CodeGenModule in order to make it accessible for the extra use case. Differential revision: https://reviews.llvm.org/D61488 llvm-svn: 360342
* Fix gcc compilation warning in an assert [NFC]Mikael Holmen2019-05-091-1/+1
| | | | | | | | | | | | | | Without this, gcc (7.4) complains with ../tools/clang/lib/Parse/ParseDecl.cpp:3937:63: error: suggest parentheses around '&&' within '||' [-Werror=parentheses] assert(!isAlreadyConsumed || RangeEnd != SourceLocation() && ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ "both or neither of isAlreadyConsumed and " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "RangeEnd needs to be set"); ~ llvm-svn: 360333
* [OpenCL] Switched CXX mode to be derived from C++17Anastasia Stulova2019-05-092-8/+3
| | | | | | Differential revision: https://reviews.llvm.org/D61506 llvm-svn: 360330
OpenPOWER on IntegriCloud