summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding UNSUPPORTED: system-windows at George's request until the problem can ↵Douglas Yung2018-03-301-0/+1
| | | | | | be debugged. llvm-svn: 328853
* Hoist MethodVFTableLocation out of MicrosoftVTableContext, NFCReid Kleckner2018-03-296-70/+62
| | | | | | | | | | | | | This allows forward declaring it so that we can add it to MicrosoftMangleContext::mangleVirtualMemPtrThunk without including VTableBuilder.h. That saves a hashtable lookup when emitting virtual member pointer functions. It also shortens a really long type name. This struct has "VFtable" in the name, so it seems pretty unlikely that someone will assume it is generally useful for non-MS C++ ABI stuff. llvm-svn: 328845
* [analyzer] Fix target triple for autorelease-write-checker testGeorge Karpenkov2018-03-291-1/+2
| | | | llvm-svn: 328837
* Set dso_local on cfi_slowpath.Rafael Espindola2018-03-292-4/+10
| | | | llvm-svn: 328836
* [analyzer] Better pretty-printing of regions in exploded graphGeorge Karpenkov2018-03-292-3/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D45010 llvm-svn: 328835
* [AArch64]: Add support for parsing rN registers.Manoj Gupta2018-03-292-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Allow rN registers to be simply parsed as correspoing xN registers. The "register ... asm("rN")" is an command to the compiler's register allocator, not an operand to any individual assembly instruction. GCC documents this syntax as "...the name of the register that should be used." This is needed to support the changes in Linux kernel (see https://lkml.org/lkml/2018/3/1/268 ) Note: This will add support only for the limited use case of register ... asm("rN"). Any other uses that make rN leak into assembly are not supported. Reviewers: kristof.beyls, rengolin, peter.smith, t.p.northover Reviewed By: peter.smith Subscribers: javed.absar, eraman, cfe-commits, srhines Differential Revision: https://reviews.llvm.org/D44815 llvm-svn: 328829
* [analyzer] Path-insensitive checker for writes into an auto-releasing pointerGeorge Karpenkov2018-03-294-0/+332
| | | | | | | | | | from the wrong auto-releasing pool, as such writes may crash. rdar://25301111 Differential Revision: https://reviews.llvm.org/D44722 llvm-svn: 328827
* [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).Eugene Zelenko2018-03-294-265/+249
| | | | llvm-svn: 328826
* Mark __cfi_check as dso_local.Rafael Espindola2018-03-292-0/+4
| | | | llvm-svn: 328825
* Generalize NRVO to cover C structs.Akira Hatanaka2018-03-2914-822/+481
| | | | | | | | | | | This commit generalizes NRVO to cover C structs (both trivial and non-trivial structs). rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D44968 llvm-svn: 328809
* [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.Volodymyr Sapsai2018-03-299-45/+309
| | | | | | | | | | | | | | | | | | Deprecation replacement can be any text but if it looks like a name of ObjC method and has the same number of arguments as original method, replace all slot names so after applying a fix-it you have valid code. rdar://problem/36660853 Reviewers: aaron.ballman, erik.pilkington, rsmith Reviewed By: erik.pilkington Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D44589 llvm-svn: 328807
* Set dso_local when clearing dllimport.Rafael Espindola2018-03-292-1/+5
| | | | llvm-svn: 328801
* Add a dllimport test.Rafael Espindola2018-03-291-0/+7
| | | | | | Thanks to rnk for the suggestion. llvm-svn: 328800
* [test] Fix an XRay test on FreeBSDZhihao Yuan2018-03-291-1/+1
| | | | | | | | | | | | Summary: Fixing clang-test on FreeBSD as a follow-up of https://reviews.llvm.org/D43378 to handle the revert happened in r325749. Reviewers: devnexen, krytarowski, dberris Subscribers: emaste, dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D45002 llvm-svn: 328797
* Set calling convention for CUDA kernelYaxun Liu2018-03-2913-17/+92
| | | | | | | | | | | This patch sets target specific calling convention for CUDA kernels in IR. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44747 llvm-svn: 328795
* Disable emitting static extern C aliases for amdgcn target for CUDAYaxun Liu2018-03-294-3/+19
| | | | | | | | | Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44987 llvm-svn: 328793
* Fix typoMatt Arsenault2018-03-292-9/+9
| | | | llvm-svn: 328791
* [Hexagon] Aid bit-reverse load intrinsics lowering with bitcodeKrzysztof Parzyszek2018-03-295-23/+174
| | | | | | | | | | | The conversion of operatios to bitcode helps to eliminate an additional store in certain cases. We used to lower these load intrinsics in DAG to DAG conversion by which time, the "Dead Store Elimination" pass is already run. There is an associated LLVM patch. Patch by Sumanth Gundapaneni. llvm-svn: 328776
* Rename clang link from clang-X.Y to clang-XSylvestre Ledru2018-03-292-4/+7
| | | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. So, instead, I propose the following: Instead of having clang-7.0 in bin/, we will have clang-7 Since also matches was gcc is doing. Reviewers: tstellar, dlj, dim, hans Reviewed By: dim, hans Subscribers: dim, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D41808 llvm-svn: 328769
* Refactor some code for a warning. NFC.Richard Trieu2018-03-291-65/+39
| | | | | | | | | Use range-based for-loops instead of iterators to walk over vectors. Switch the key of the DenseMap so a custom key handler is no longer needed. Remove unncessary adds to the DenseMap. Use unique_ptr instead of manual memory management. llvm-svn: 328763
* [astmatchers] Fix linking issueGeorge Karpenkov2018-03-291-0/+3
| | | | llvm-svn: 328754
* [analyzer] [testing] Be less verbose by default in integration testing.George Karpenkov2018-03-291-1/+1
| | | | llvm-svn: 328752
* [astmatchers] Move a matcher out of internal namespace: blind debugging of ↵George Karpenkov2018-03-291-9/+10
| | | | | | MSVC issues llvm-svn: 328750
* [ast] Do not auto-initialize Objective-C for-loop variables in Objective-C++ ↵George Karpenkov2018-03-296-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in templatized code under ARC The AST for the fragment ``` @interface I @end template <typename> void decode(I *p) { for (I *k in p) {} } void decode(I *p) { decode<int>(p); } ``` differs heavily when templatized and non-templatized: ``` |-FunctionTemplateDecl 0x7fbfe0863940 <line:4:1, line:7:1> line:5:6 decode | |-TemplateTypeParmDecl 0x7fbfe0863690 <line:4:11> col:11 typename depth 0 index 0 | |-FunctionDecl 0x7fbfe08638a0 <line:5:1, line:7:1> line:5:6 decode 'void (I *__strong)' | | |-ParmVarDecl 0x7fbfe08637a0 <col:13, col:16> col:16 referenced p 'I *__strong' | | `-CompoundStmt 0x7fbfe0863b88 <col:19, line:7:1> | |   `-ObjCForCollectionStmt 0x7fbfe0863b50 <line:6:3, col:20> | |     |-DeclStmt 0x7fbfe0863a50 <col:8, col:13> | |     | `-VarDecl 0x7fbfe08639f0 <col:8, col:11> col:11 k 'I *const __strong' | |     |-ImplicitCastExpr 0x7fbfe0863a90 <col:16> 'I *' <LValueToRValue> | |     | `-DeclRefExpr 0x7fbfe0863a68 <col:16> 'I *__strong' lvalue ParmVar 0x7fbfe08637a0 'p' 'I *__strong' | |     `-CompoundStmt 0x7fbfe0863b78 <col:19, col:20> | `-FunctionDecl 0x7fbfe0863f80 <line:5:1, line:7:1> line:5:6 used decode 'void (I *__strong)' |   |-TemplateArgument type 'int' |   |-ParmVarDecl 0x7fbfe0863ef8 <col:13, col:16> col:16 used p 'I *__strong' |   `-CompoundStmt 0x7fbfe0890cf0 <col:19, line:7:1> |     `-ObjCForCollectionStmt 0x7fbfe0890cc8 <line:6:3, col:20> |       |-DeclStmt 0x7fbfe0890c70 <col:8, col:13> |       | `-VarDecl 0x7fbfe0890c00 <col:8, col:11> col:11 k 'I *__strong' callinit |       |   `-ImplicitValueInitExpr 0x7fbfe0890c60 <<invalid sloc>> 'I *__strong' |       |-ImplicitCastExpr 0x7fbfe0890cb0 <col:16> 'I *' <LValueToRValue> |       | `-DeclRefExpr 0x7fbfe0890c88 <col:16> 'I *__strong' lvalue ParmVar 0x7fbfe0863ef8 'p' 'I *__strong' |       `-CompoundStmt 0x7fbfe0863b78 <col:19, col:20> ``` Note how in the instantiated version ImplicitValueInitExpr unexpectedly appears. While objects are auto-initialized under ARC, it does not make sense to have an initializer for a for-loop variable, and it makes even less sense to have such a different AST for instantiated and non-instantiated version. Digging deeper, I have found that there are two separate Sema* files for dealing with templates and for dealing with non-templatized code. In a non-templatized version, an initialization was performed only for variables which are not loop variables for an Objective-C loop and not variables for a C++ for-in loop: ```   if (FRI && (Tok.is(tok::colon) || isTokIdentifier_in())) {     bool IsForRangeLoop = false;     if (TryConsumeToken(tok::colon, FRI->ColonLoc)) {       IsForRangeLoop = true;       if (Tok.is(tok::l_brace))         FRI->RangeExpr = ParseBraceInitializer();       else         FRI->RangeExpr = ParseExpression();     }     Decl *ThisDecl = Actions.ActOnDeclarator(getCurScope(), D);     if (IsForRangeLoop)       Actions.ActOnCXXForRangeDecl(ThisDecl);     Actions.FinalizeDeclaration(ThisDecl);     D.complete(ThisDecl);     return Actions.FinalizeDeclaratorGroup(getCurScope(), DS, ThisDecl);   }   SmallVector<Decl *, 8> DeclsInGroup;   Decl *FirstDecl = ParseDeclarationAfterDeclaratorAndAttributes(       D, ParsedTemplateInfo(), FRI); ``` However the code in SemaTemplateInstantiateDecl was inconsistent, guarding only against C++ for-in loops. rdar://38391075 Differential Revision: https://reviews.llvm.org/D44989 llvm-svn: 328749
* [ASTMatchers] Introduce a matcher for matching any given Objective-C selectorGeorge Karpenkov2018-03-297-9/+80
| | | | | | | | Incudes a tiny related refactoring. Differential Revision: https://reviews.llvm.org/D44858 llvm-svn: 328747
* [ASTMatchers] Extend hasParameter and hasAnyParameter matches to handle ↵George Karpenkov2018-03-295-20/+104
| | | | | | | | Objective-C methods Differential Revision: https://reviews.llvm.org/D44707 llvm-svn: 328746
* [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-03-2811-178/+292
| | | | | | other minor fixes (NFC). llvm-svn: 328735
* [ObjC++] Make parameter passing and function return compatible with ObjCAkira Hatanaka2018-03-2827-142/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ObjC and ObjC++ pass non-trivial structs in a way that is incompatible with each other. For example: typedef struct { id f0; __weak id f1; } S; // this code is compiled in c++. extern "C" { void foo(S s); } void caller() { // the caller passes the parameter indirectly and destructs it. foo(S()); } // this function is compiled in c. // 'a' is passed directly and is destructed in the callee. void foo(S a) { } This patch fixes the incompatibility by passing and returning structs with __strong or weak fields using the C ABI in C++ mode. __strong and __weak fields in a struct do not cause the struct to be destructed in the caller and __strong fields do not cause the struct to be passed indirectly. Also, this patch fixes the microsoft ABI bug mentioned here: https://reviews.llvm.org/D41039?id=128767#inline-364710 rdar://problem/38887866 Differential Revision: https://reviews.llvm.org/D44908 llvm-svn: 328731
* [Hexagon] Add support for "new" circular buffer intrinsicsKrzysztof Parzyszek2018-03-283-0/+273
| | | | | | | | | | | | | These instructions have been around for a long time, but we haven't supported intrinsics for them. The "new" vesrions use the CSx register for the start of the buffer instead of the K field in the Mx register. There is a related llvm patch. Patch by Brendon Cahoon. llvm-svn: 328725
* [MS] Fix bug in method vfptr location codeReid Kleckner2018-03-282-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were assuming that vbtable indices were assigned in layout order in our comparison, which is not the case. When a virtual method, such as the destructor, appears in multiple vftables, the vftable that appears first in object layout order is the one that points to the main implementation of that method. The later vftables use thunks. In this layout, we adjusted "this" in the main implementation by the amount that is appropriate for 'B' instead of 'A', even though the main implementation is found in D's vftable for A: struct A { virtual ~A() {} }; struct B { virtual ~B() {} }; struct C : virtual B {}; struct D : virtual A, C {}; D's layout looks like: 0 D subobject (empty) 0 C base suboject 8 A base subobject 16 B base subobject With this fix, we correctly adjust by -8 in D's deleting destructor instead of -16. Fixes PR36921. llvm-svn: 328723
* Fix for LLVM header changesDavid Blaikie2018-03-281-0/+1
| | | | llvm-svn: 328718
* [Diag] Avoid emitting a redefinition note if no location is available.Matt Davis2018-03-282-1/+3
| | | | | | | | | | | | | | | | | Summary: The "previous definition is here" note is not helpful if there is no location information. The note will reference nothing in such a case. This patch first checks to see if there is location data, and if so the note diagnostic is emitted. This fixes PR15409. The issue in the first comment seems to already be resolved. This patch addresses the second example. Reviewers: bruno, rsmith Reviewed By: bruno Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44901 llvm-svn: 328712
* clang-cl: s/Enable/Disable/ in help text for /GX-Hans Wennborg2018-03-281-1/+1
| | | | llvm-svn: 328708
* [OPENMP] Codegen for ctor|dtor of declare target variables.Alexey Bataev2018-03-287-76/+326
| | | | | | | | When the declare target variables are emitted for the device, constructors|destructors for these variables must emitted and registered by the runtime in the offloading sections. llvm-svn: 328705
* [PATCH] [RISCV] Verify the input value of -march=Shiva Chen2018-03-282-6/+156
| | | | | | | | | | | | | | Summary: This patch doing more check and verify the -march= string and will issue an error if it's a invalid combination. Reviewers: asb, apazos Differential Revision: https://reviews.llvm.org/D44189 Patch by Kito Cheng. llvm-svn: 328690
* Fix some handling of AST nodes with diagnostics.Richard Trieu2018-03-2821-79/+79
| | | | | | | | | The diagnostic system for Clang can already handle many AST nodes. Instead of converting them to strings first, just hand the AST node directly to the diagnostic system and let it handle the output. Minor changes in some diagnostic output. llvm-svn: 328688
* [ObjC] Make C++ triviality type traits available to non-trivial CAkira Hatanaka2018-03-283-6/+43
| | | | | | | | | | | | | | | | | | | | | | structs. r326307 and r327870 made changes that allowed using non-trivial C structs with fields qualified with __strong or __weak. This commit makes the following C++ triviality type traits available to non-trivial C structs: __has_trivial_assign __has_trivial_move_assign __has_trivial_copy __has_trivial_move_constructor __has_trivial_constructor __has_trivial_destructor rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D44913 llvm-svn: 328680
* [Driver] Add fuzzer-no-link into the list of supported Fuchsia sanitizersPetr Hosek2018-03-271-0/+1
| | | | | | | | This is needed in addition to fuzzer in order to use libFuzzer. Differential Revision: https://reviews.llvm.org/D44947 llvm-svn: 328672
* [Sema] Emit -Winteger-overflow for arguments in function calls, ObjC messages.Volodymyr Sapsai2018-03-274-7/+59
| | | | | | | | | | | | | | rdar://problem/35539384 Reviewers: ahatanak, nicholas, rsmith, jkorous-apple Reviewed By: jkorous-apple Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D42938 llvm-svn: 328671
* [coroutines] Do not attempt to typo-correct when coroutine is looking for ↵Gor Nishanov2018-03-272-4/+30
| | | | | | | | | | required members When SemaCoroutine looks for await_resume, it means it. No need for helpful: "Did you mean await_ready?" messages. Fixes PR33477 and a couple of FIXMEs in test/SemaCXX/coroutines.cpp llvm-svn: 328663
* AMDGPU: Update datalayout for stack alignmentMatt Arsenault2018-03-273-7/+7
| | | | llvm-svn: 328657
* [Sema] Avoid crash for category implementation without interfaceShoaib Meenai2018-03-272-0/+12
| | | | | | | | | | | When we have a category implementation without a corresponding interface (which is an error by itself), semantic checks for property accesses will attempt to access a null interface declaration and then segfault. Error out in such cases instead. Differential Revision: https://reviews.llvm.org/D44916 llvm-svn: 328654
* Update test after r328635 in LLVMKrzysztof Parzyszek2018-03-271-3/+3
| | | | llvm-svn: 328641
* [clang] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-03-2737-99/+101
| | | | | | | | | | | r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. llvm-svn: 328636
* [clang-format] Refine ObjC guesser to handle child lines of child linesBen Hamilton2018-03-272-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes an issue brought up by djasper@ in his review of D44790. We handled top-level child lines, but if those child lines themselves had child lines, we didn't handle them. Rather than use recursion (which could blow out the stack), I use a DenseSet to hold the set of lines we haven't yet checked (since order doesn't matter), and update the set to add the children of each line as we check it. Test Plan: New tests added. Confirmed tests failed before fix and passed after fix. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44831 llvm-svn: 328628
* [clang-format] Do not insert space before closing brace in ObjC dict literalBen Hamilton2018-03-272-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, `clang-format` would sometimes insert a space before the closing brace in an Objective-C dictionary literal. Unlike array literals (which obey `Style.SpacesInContainerLiterals` to add a space after `[` and before `]`), Objective-C dictionary literals currently are not meant to insert a space after `{` and before `}`, regardless of `Style.SpacesInContainerLiterals`. However, some constructs like `@{foo : @(bar)}` caused `clang-format` to insert a space between `)` and `}`. This fixes the issue and adds tests. (I understand the behavior is not consistent between array literals and dictionary literals, but that's existing behavior that's a much larger change.) Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak, Wizard Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44816 llvm-svn: 328627
* Drop spurious break; NFCSven van Haastregt2018-03-271-1/+0
| | | | llvm-svn: 328626
* Move a ref-counted pointer instead of copying it. NFC.Alexander Kornienko2018-03-271-1/+1
| | | | llvm-svn: 328623
* Revert "[clang-format] Remove empty lines before }[;] // comment"Krasimir Georgiev2018-03-272-19/+3
| | | | | | | | | This reverts commit r327861. The empty line before namespaces is desired in some places. We need a better approach to handle this. llvm-svn: 328621
* [analyzer] LoopUnrolling: update the matched assignment operatorsPeter Szecsi2018-03-272-14/+100
| | | | | | | | | Extended the matched assignment operators when checking for bound changes in a body of the loop by using the freshly added isAssignmentOperator matcher. This covers all the (current) possible assignments, tests added as well. Differential Revision: https://reviews.llvm.org/D38921 llvm-svn: 328619
OpenPOWER on IntegriCloud