summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Add generic AS to 'this' pointerMikael Nilsson2018-12-1240-143/+390
| | | | | | | | | | | Address spaces are cast into generic before invoking the constructor. Added support for a trailing Qualifiers object in FunctionProtoType. Differential Revision: https://reviews.llvm.org/D54862 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348927 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Remove import of definition from GetAlreadyImportedOrNullGabor Marton2018-12-122-11/+9
| | | | | | | | | | | | Summary: a_sidorin Reviewers: a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53755 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348923 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Fix for TBAA information of pointer after addresspacecastAndrew Savonichev2018-12-122-2/+23
| | | | | | | | | | | | | | Summary: When addresspacecast is generated resulting pointer should preserve TBAA information from original value. Reviewers: rjmccall, yaxunl, Anastasia Reviewed By: rjmccall Subscribers: asavonic, kosarev, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55262 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348919 91177308-0d34-0410-b5e6-96231b3b80d8
* Add explicit dependency on clangSerialization for a bunch of components to ↵Fangrui Song2018-12-1222-0/+22
| | | | | | | | | | | | | | | fix -DBUILD_SHARED_LIBS=on build This is a more thorough fix of rC348911. The story about -DBUILD_SHARED_LIBS=on build after rC348907 (Move PCHContainerOperations from Frontend to Serialization) is: 1. libclangSerialization.so defines PCHContainerReader dtor, ... 2. clangFrontend and clangTooling define classes inheriting from PCHContainerReader, thus their DSOs have undefined references on PCHContainerReader dtor 3. Components depending on either clangFrontend or clangTooling cannot be linked unless they have explicit dependency on clangSerialization due to the default linker option -z defs. The explicit dependency could be avoided if libclang{Frontend,Tooling}.so had these undefined references. This patch adds the explicit dependency on clangSerialization to make them build. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348915 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Fix -DBUILD_SHARED_LIBS=on build after rC348907Fangrui Song2018-12-121-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348911 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PCHContainerOperations from Frontend to SerializationRichard Trieu2018-12-1211-114/+126
| | | | | | | | Fix a layering violation. Frontend depends on Serialization, so anything used by both should be in Serialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348907 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace Const-Member checking with non-recursive version.Erich Keane2018-12-113-27/+79
| | | | | | | | | | | | | | | As reported in PR39946, these two implementations cause stack overflows to occur when a type recursively contains itself. While this only happens when an incomplete version of itself is used by membership (and thus an otherwise invalid program), the crashes might be surprising. The solution here is to replace the recursive implementation with one that uses a std::vector as a queue. Old values are kept around to prevent re-checking already checked types. Change-Id: I582bb27147104763d7daefcfee39d91f408b9fa8 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348899 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r348889; it fails some tests.Aaron Ballman2018-12-113-61/+4
| | | | | | http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/40784 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348892 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop stripping comments from AST matcher example code.Aaron Ballman2018-12-113-73/+72
| | | | | | The AST matcher documentation dumping script was being a bit over-zealous about stripping comment markers, which ended up causing comments in example code to stop being comments. Fix that by only stripping comments at the start of a line, rather than removing any forward slash (which also impacts prose text). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348891 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit -Wformat properly for bit-field promotions.Aaron Ballman2018-12-113-4/+61
| | | | | | Only explicitly look through integer and floating-point promotion where the result type is actually a promotion, which is not always the case for bit-fields in C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348889 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer][CStringChecker] evaluate explicit_bzeroDavid Carlier2018-12-112-6/+110
| | | | | | | | | | | | | | | - explicit_bzero has limited scope/usage only for security/crypto purposes but is non-optimisable version of memset/0 and bzero. - explicit_memset has similar signature and semantics as memset but is also a non-optimisable version. Reviewers: NoQ Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D54592 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348884 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CGDebugInfo::getOrCreateFile() and use TheCU->getFile() directly.Adrian Prantl2018-12-112-26/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348866 91177308-0d34-0410-b5e6-96231b3b80d8
* Reuse code from CGDebugInfo::getOrCreateFile() when creating the fileAdrian Prantl2018-12-114-12/+22
| | | | | | | | | | | | | for the DICompileUnit. This addresses post-commit feedback for D55085. Without this patch, a main source file with an absolute paths may appear in different DIFiles, once with the absolute path and once with the common prefix between the absolute path and the current working directory. Differential Revision: https://reviews.llvm.org/D55519 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348865 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass PartialOverloading argument to the correct corresponding parameterEric Fiselier2018-12-112-5/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348864 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Minor documentation fix: clarify static linking limitation.Max Moroz2018-12-111-1/+1
| | | | | | | | | | | | | | | | Summary: ASan does not support statically linked binaries, but ASan runtime itself can be statically linked into a target binary executable. Reviewers: eugenis, kcc Reviewed By: eugenis Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D55066 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348863 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-12-111-0/+510
| | | | | | This adds tests for expressions in C++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348860 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[PowerPC] Make no-PIC default to match GCC - CLANG"Stefan Pintilie2018-12-113-41/+5
| | | | | | This reverts commit rL348299. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348858 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Fix a minor typo.Gabor Horvath2018-12-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348848 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland r348741 "[Sema] Further improvements to to static_assert diagnostics."Clement Courbet2018-12-117-44/+63
| | | | | | Fix a dangling reference to temporary, never return nullptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348834 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r348830 "[Sema]improve static_assert(!expr)"Clement Courbet2018-12-112-18/+0
| | | | | | Submitted the wrong change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348831 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema]improve static_assert(!expr)Clement Courbet2018-12-112-0/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348830 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CodeGenOptions from Frontend to BasicRichard Trieu2018-12-1133-43/+33
| | | | | | | Basic uses CodeGenOptions and should not depend on Frontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348827 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Remove memoization from RunLoopAutoreleaseLeakCheckerGeorge Karpenkov2018-12-111-26/+8
| | | | | | | | | | | | | Memoization dose not seem to be necessary, as other statement visitors run just fine without it, and in fact seems to be causing memory corruptions. Just removing it instead of investigating the root cause. rdar://45945002 Differential Revision: https://reviews.llvm.org/D54921 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348822 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Hack for backwards compatibility for options for RetainCountChecker.George Karpenkov2018-12-112-1/+14
| | | | | | To be removed once the clients update. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348821 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Display a diagnostics when an inlined function violates its ↵George Karpenkov2018-12-112-13/+120
| | | | | | | | | | | | | os_consumed summary This is currently a diagnostics, but might be upgraded to an error in the future, especially if we introduce os_return_on_success attributes. rdar://46359592 Differential Revision: https://reviews.llvm.org/D55530 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348820 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Resolve another bug where the name of the leaked object was not ↵George Karpenkov2018-12-112-5/+5
| | | | | | | | printed properly Differential Revision: https://reviews.llvm.org/D55528 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348819 91177308-0d34-0410-b5e6-96231b3b80d8
* Update test for instcombine changeMatt Arsenault2018-12-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348809 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Change InitListExpr dump to label and pointer"Stephen Kelly2018-12-102-7/+7
| | | | | | This reverts commit r348794. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348799 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix nitsStephen Kelly2018-12-101-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348798 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-order content of template parameter dumpsStephen Kelly2018-12-102-20/+29
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55393 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348797 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-order content in OMPDeclareReductionDecl dumpStephen Kelly2018-12-102-6/+10
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55395 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348795 91177308-0d34-0410-b5e6-96231b3b80d8
* Change InitListExpr dump to label and pointerStephen Kelly2018-12-102-7/+7
| | | | | | | | | | | | Summary: Don't add a child just for the label. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55495 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348794 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an explicit triple to this test to fix failing test bots.Aaron Ballman2018-12-101-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348790 91177308-0d34-0410-b5e6-96231b3b80d8
* [constexpr][c++2a] Try-catch blocks in constexpr functionsBruno Cardoso Lopes2018-12-107-23/+112
| | | | | | | | | | | | | | | | | | | | | | Implement support for try-catch blocks in constexpr functions, as proposed in http://wg21.link/P1002 and voted in San Diego for c++20. The idea is that we can still never throw inside constexpr, so the catch block is never entered. A try-catch block like this: try { f(); } catch (...) { } is then morally equivalent to just { f(); } Same idea should apply for function/constructor try blocks. rdar://problem/45530773 Differential Revision: https://reviews.llvm.org/D55097 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348789 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-12-101-0/+339
| | | | | | This adds tests for expressions in C. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348786 91177308-0d34-0410-b5e6-96231b3b80d8
* ComputeLineNumbers: delete SSE2 vectorizationFangrui Song2018-12-101-56/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: SSE2 vectorization was added in 2012, but it is 2018 now and I can't observe any performance boost (testing clang -E [all Sema/* CodeGen/* with proper -I options]) with the existing _mm_movemask_epi8+countTrailingZeros or the following SSE4.2 (compiling with -msse4.2): __m128i C = _mm_setr_epi8('\r','\n',0,0,0,0,0,0,0,0,0,0,0,0,0,0); _mm_cmpestri(C, 2, Chunk, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_POSITIVE_POLARITY | _SIDD_LEAST_SIGNIFICANT) Delete the vectorization to simplify the code. Also simplify the code a bit and don't check the line ending sequence \n\r Reviewers: bkramer, #clang Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348777 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Revert removal of tidy plugin support from libclang introduced in ↵Ivan Donchevskii2018-12-102-0/+22
| | | | | | | | r347496 Differential Revision: https://reviews.llvm.org/D55415 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348764 91177308-0d34-0410-b5e6-96231b3b80d8
* Use zip_longest for iterator range comparisons. NFC.Michael Kruse2018-12-102-20/+28
| | | | | | | | | | | | | | | | | | | Use zip_longest in two locations that compare iterator ranges. zip_longest allows the iteration using a range-based for-loop and to be symmetric over both ranges instead of prioritizing one over the other. In that latter case code have to handle the case that the first is longer than the second, the second is longer than the first, and both are of the same length, which must partially be checked after the loop. With zip_longest, this becomes an element comparison within the loop like the comparison of the elements themselves. The symmetry makes it clearer that neither the first and second iterators are handled differently. The iterators are not event used directly anymore, just the ranges. Differential Revision: https://reviews.llvm.org/D55468 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348762 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc typos fixes in ./lib folderRaphael Isemann2018-12-1052-81/+81
| | | | | | | | | | | | | | Summary: Found via `codespell -q 3 -I ../clang-whitelist.txt -L uint,importd,crasher,gonna,cant,ue,ons,orign,ned` Reviewers: teemperor Reviewed By: teemperor Subscribers: teemperor, jholewinski, jvesely, nhaehnle, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348755 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL][CodeGen] Fix replacing memcpy with addrspacecastAndrew Savonichev2018-12-102-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a function argument is byval and RV is located in default or alloca address space an optimization of creating addrspacecast instead of memcpy is performed. That is not correct for OpenCL, where that can lead to a situation of address space casting from __private * to __global *. See an example below: ``` typedef struct { int x; } MyStruct; void foo(MyStruct val) {} kernel void KernelOneMember(__global MyStruct* x) { foo (*x); } ``` for this code clang generated following IR: ... %0 = load %struct.MyStruct addrspace(1)*, %struct.MyStruct addrspace(1)** %x.addr, align 4 %1 = addrspacecast %struct.MyStruct addrspace(1)* %0 to %struct.MyStruct* ... So the optimization was disallowed for OpenCL if RV is located in an address space different than that of the argument (0). Reviewers: yaxunl, Anastasia Reviewed By: Anastasia Subscribers: cfe-commits, asavonic Differential Revision: https://reviews.llvm.org/D54947 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348752 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r348741 "[Sema] Further improvements to to static_assert diagnostics."Clement Courbet2018-12-107-65/+48
| | | | | | Seems to break build bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348742 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Further improvements to to static_assert diagnostics.Clement Courbet2018-12-107-48/+65
| | | | | | | | | | | | | | Summary: We're now handling cases like `static_assert(!expr)` and static_assert(!(expr))`. Reviewers: aaron.ballman, Quuxplusone Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55270 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348741 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove the addcarry builtins. Leaving only the addcarryx builtins ↵Craig Topper2018-12-106-24/+14
| | | | | | | | | | since that matches gcc. The addcarry and addcarryx builtins do the same thing. The only difference is that addcarryx previously required adx feature. This commit removes the adx feature check from addcarryx and removes the addcarry builtin. This matches the builtins that gcc has. We don't guarantee compatibility in builtins, but we generally try to be consistent if its not a burden. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348738 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the make_const_ptr trait into STLExtras; use add_pointer where ↵Aaron Ballman2018-12-094-34/+26
| | | | | | possible; NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348730 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Rename TemplateDecl dump utilitiesStephen Kelly2018-12-091-18/+17
| | | | | | | | | | There is a clang::TemplateDecl AST type, so a method called VisitTemplateDecl looks like it should 'override' the method from the base visitor, but it does not because of the extra parameters it takes. In reality, these methods are utilities, so name them like utilities. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348720 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Move dump of individual comment nodes to NodeDumperStephen Kelly2018-12-093-156/+183
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55190 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348719 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Introduce optional labels to dumpStmt"Stephen Kelly2018-12-091-15/+6
| | | | | | This reverts commit 933402caa09963792058198578522a95f013c69c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348718 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce optional labels to dumpStmtStephen Kelly2018-12-091-6/+15
| | | | | | | | If the label is present, it is added as a child, with the statement a child of the label. This preserves behavior of the InitListExpr dump output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348717 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline hasNodes into only callerStephen Kelly2018-12-091-13/+8
| | | | | | It is easier to refactor with fewer utility methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348716 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline dumpFullComment into callersStephen Kelly2018-12-091-10/+7
| | | | | | | It causes confusion over whether it or dumpComment is the more important. It is easier to refactor with fewer utility methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348715 91177308-0d34-0410-b5e6-96231b3b80d8