summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [attributes] Add a family of OS_CONSUMED, OS_RETURNS and OS_RETURNS_RETAINED ↵George Karpenkov2018-11-308-76/+279
| | | | | | | | | | | | | | | | | | | | | attributes The addition adds three attributes for communicating ownership, analogous to existing NS_ and CF_ attributes. The attributes are meant to be used for communicating ownership of all objects in XNU (Darwin kernel) and all of the kernel modules. The ownership model there is very similar, but still different from the Foundation model, so we think that introducing a new family of attributes is appropriate. The addition required a sizeable refactoring of the existing code for CF_ and NS_ ownership attributes, due to tight coupling and the fact that differentiating between the types was previously done using a boolean. Differential Revision: https://reviews.llvm.org/D54912 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347947 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] [NFC] Minor refactoring of RetainCountDiagnosticsGeorge Karpenkov2018-11-305-224/+263
| | | | | | | | | Move visitors to the implementation file, move a complicated logic into a function. Differential Revision: https://reviews.llvm.org/D55036 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347946 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] For OSObject, trust that functions starting with GetGeorge Karpenkov2018-11-302-1/+14
| | | | | | | | (uppercase) are also getters. Differential Revision: https://reviews.llvm.org/D55035 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347945 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Print a fully qualified name for functions in RetainCountChecker ↵George Karpenkov2018-11-302-12/+26
| | | | | | | | | | | diagnostics Attempt to get a fully qualified name from AST if an SVal corresponding to the object is not available. Differential Revision: https://reviews.llvm.org/D55034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347944 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add the type of the leaked object to the diagnostic messageGeorge Karpenkov2018-11-308-24/+45
| | | | | | | | | | | | If the object is a temporary, and there is no variable it binds to, let's at least print out the object name in order to help differentiate it from other temporaries. rdar://45175098 Differential Revision: https://reviews.llvm.org/D55033 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347943 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Reference leaked object by name, even if it was created in an ↵George Karpenkov2018-11-304-21/+43
| | | | | | | | | | inlined function. rdar://45532181 Differential Revision: https://reviews.llvm.org/D54973 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347942 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] [NFC] Test dumping trimmed graphGeorge Karpenkov2018-11-301-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D54972 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347941 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] [NFC] Some miscellaneous clean ups and documentation fixes.George Karpenkov2018-11-302-89/+92
| | | | | | Differential Revision: https://reviews.llvm.org/D54971 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347940 91177308-0d34-0410-b5e6-96231b3b80d8
* [-gmodules] Honor -fdebug-prefix-map in the debug info inside PCMs.Adrian Prantl2018-11-293-0/+31
| | | | | | | | | | | | This patch passes -fdebug-prefix-map (a feature for renaming source paths in the debug info) through to the per-module codegen options and adds the debug prefix map to the module hash. <rdar://problem/46045865> Differential Revision: https://reviews.llvm.org/D55037 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347926 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP][NVPTX]Call get __kmpc_global_thread_num in worker afterAlexey Bataev2018-11-292-1/+5
| | | | | | | | | initialization. Function __kmpc_global_thread_num should be called only after initialization, not earlier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347919 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Add a new version of the SPMD deinit kernel functionGheorghe-Teodor Bercea2018-11-299-27/+31
| | | | | | | | | | | | | | Summary: This patch adds a new runtime for the SPMD deinit kernel function which replaces the previous function. The new function takes as argument the flag which signals whether the runtime is required or not. This enables the compiler to optimize out the part of the deinit function which are not needed. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D54970 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347915 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "NFC: Fix case of CommentVisitor::Visit methods"Stephen Kelly2018-11-292-27/+27
| | | | | | This reverts commit 0859c80137ac5fb3c86e7802cb8c5ef56f921cce. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347905 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Fix case of CommentVisitor::Visit methodsStephen Kelly2018-11-292-27/+27
| | | | | | | This difference is very visible because it is used with other Visitor classes together. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347901 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Move ColorScope to global scopeStephen Kelly2018-11-291-56/+58
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347900 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: Constify ShowColorsStephen Kelly2018-11-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347899 91177308-0d34-0410-b5e6-96231b3b80d8
* set default max-page-size to 4KB in lld for Android Aarch64Zhizhou Yang2018-11-292-0/+13
| | | | | | | | | | | | | | | | | | | | Summary: This patch passes an option '-z max-page-size=4096' to lld through clang driver. This is for Android on Aarch64 target. The lld default page size is too large for Aarch64, which produces larger .so files and images for arm64 device targets. In this patch we set default page size to 4KB for Android Aarch64 targets instead. Reviewers: srhines, danalbert, ruiu, chh, peter.smith Reviewed By: srhines Subscribers: javed.absar, kristof.beyls, cfe-commits, george.burgess.iv, llozano Differential Revision: https://reviews.llvm.org/D55029 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347897 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the __builtin_constant_p test that was used to catch rC347417 failureFangrui Song2018-11-291-5/+2
| | | | | | | | | | | | Reviewers: rsmith, void, shafik Reviewed By: void Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D54964 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347895 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing REQUIRES to new testTeresa Johnson2018-11-291-0/+2
| | | | | | Test added in r347887 requires an x86 target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347892 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer][PlistMacroExpansion] Part 4.: Support for __VA_ARGS__Kristof Umann2018-11-293-103/+303
| | | | | | | Differential Revision: https://reviews.llvm.org/D52986 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347888 91177308-0d34-0410-b5e6-96231b3b80d8
* [ThinLTO] Allow importing of multiple symbols with same GUIDTeresa Johnson2018-11-294-9/+68
| | | | | | | | | | | | | | | | | | | Summary: The is the clang side of the fix in D55047, to handle the case where two different modules have local variables with the same GUID because they had the same source file name at compilation time. Allow multiple symbols with the same GUID to be imported, and test that this case works with the distributed backend path. Depends on D55047. Reviewers: evgeny777 Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D55048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347887 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark __builtin_shufflevector as using custom type checkingMatt Arsenault2018-11-291-1/+1
| | | | | | | | The custom handling seems to all be implemented already. This avoids regressions in a future patch when float vectors are ordinarily promoted to double vectors in variadic calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347873 91177308-0d34-0410-b5e6-96231b3b80d8
* inhereit LLVM_ENABLE_LIBXML2David Callahan2018-11-291-7/+10
| | | | | | | | | | | | | | Summary: When building in an LLVM context, we should respect its LLVM_ENABLE_LIBXML2 option. Reviewers: vitalybuka, mspertus, modocache Reviewed By: modocache Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D53212 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347870 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Improve diags for addr spaces in templatesAnastasia Stulova2018-11-295-24/+43
| | | | | | | | | | | | | Fix ICEs on template instantiations that were leading to the creation of invalid code patterns with address spaces. Incorrect cases are now diagnosed properly. Differential Revision: https://reviews.llvm.org/D54858 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347865 91177308-0d34-0410-b5e6-96231b3b80d8
* Set MustBuildLookupTable on PrimaryContext in ExternalASTMergerRaphael Isemann2018-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: `MustBuildLookupTable` must always be called on a primary context as we otherwise trigger an assert, but we don't ensure that this will always happen in our code right now. This patch explicitly requests the primary context when doing this call as this shouldn't break anything (as calling `getPrimaryContext` on a context which is its own primary context is a no-op) but will catch these rare cases where we somehow operate on a declaration context that is not its own primary context. See also D54863. Reviewers: martong, a.sidorin, shafik Reviewed By: martong Subscribers: davide, rnkovacs, cfe-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D54898 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347863 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Hurd target to Clang driver (2/2)Kristina Brooks2018-11-2916-2/+324
| | | | | | | | | | | | | | | | | This adds Hurd toolchain support to Clang's driver in addition to handling translating the triple from Hurd-compatible form to the actual triple registered in LLVM. (Phabricator was stripping the empty files from the patch so I manually created them) Patch by sthibaul (Samuel Thibault) Differential Revision: https://reviews.llvm.org/D54379 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347833 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow cpu-dispatch forward declarations.Erich Keane2018-11-283-13/+15
| | | | | | | | | As a followup to r347805, allow forward declarations of cpu-dispatch and cpu-specific for the same reasons. Change-Id: Ic1bde9be369b1f8f1d47d58e6fbdc2f9dfcdd785 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347812 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure sanitizer check function calls have a !dbg locationAdrian Prantl2018-11-283-0/+52
| | | | | | | | | | | | | | | | | | | | | | Function calls without a !dbg location inside a function that has a DISubprogram make it impossible to construct inline information and are rejected by the verifier. This patch ensures that sanitizer check function calls have a !dbg location, by carrying forward the location of the preceding instruction or by inserting an artificial location if necessary. This fixes a crash when compiling the attached testcase with -Os. rdar://problem/45311226 Differential Revision: https://reviews.llvm.org/D53459 Note: This reapllies r344915, modified to reuse the IRBuilder's DebugLoc if one exists instead of picking the one from CGDebugInfo since the latter may get reset when emitting thunks such as block helpers in the middle of emitting another function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347810 91177308-0d34-0410-b5e6-96231b3b80d8
* [DebugInfo] NFC Clang test changes for: IR/Bitcode changes for DISubprogram ↵Paul Robinson2018-11-2824-74/+78
| | | | | | | | flags. Differential Revision: https://reviews.llvm.org/D54756 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347807 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct 'target' default behavior on redecl, allow forward declaration.Erich Keane2018-11-285-12/+106
| | | | | | | | | | | | | | | | | | | | | | | | Declarations without the attribute were disallowed because it would be ambiguous which 'target' it was supposed to be on. For example: void ___attribute__((target("v1"))) foo(); void foo(); // Redecl of above, or fwd decl of below? void ___attribute__((target("v2"))) foo(); However, a first declaration doesn't have that problem, and erroring prevents it from working in cases where the forward declaration is useful. Additionally, a forward declaration of target==default wouldn't properly cause multiversioning, so this patch fixes that. The patch was not split since the 'default' fix would require implementing the same check for that case, followed by undoing the same change for the fwd-decl implementation. Change-Id: I66f2c5bc2477bcd3f7544b9c16c83ece257077b0 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347805 91177308-0d34-0410-b5e6-96231b3b80d8
* [Coverage] Specify the Itanium ABI triple for a C++ testVedant Kumar2018-11-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347804 91177308-0d34-0410-b5e6-96231b3b80d8
* [Coverage] Do not visit artificial stmts in defaulted methods (PR39822)Vedant Kumar2018-11-282-4/+33
| | | | | | | | | | | | | | | | | | | | | | There is no reason to emit coverage mappings for artificial statements contained within defaulted methods, as these statements are not visible to users. Only emit a mapping for the body of the defaulted method (clang treats the text of the "default" keyword as the body when reporting locations). This allows users to see how often the default method is called, but trims down the coverage mapping by skipping visitation of the children of the method. The immediate motivation for this change is that the lexer's getPreciseTokenLocEnd API cannot return the correct location when given an artificial statement (with a somewhat made-up location) as an input. Test by Orivej Desh! Fixes llvm.org/PR39822. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347803 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[ASTImporter] Changed use of Import to Import_New in ASTImporter."Davide Italiano2018-11-282-377/+320
| | | | | | This broke the lldb bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347794 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Fix emission of the target regions in virtual functions.Alexey Bataev2018-11-282-1/+28
| | | | | | | | Fixed emission of the target regions found in the virtual functions. Previously we may end up with the situation when those regions could be skipped. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347793 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Move MultIversioning::Type into Decl so that it can be used inErich Keane2018-11-284-45/+62
| | | | | | | | CodeGen Change-Id: I32b14edca3501277e0e65672eafe3eea38c6f9ae git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347791 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Cleanup constructors in the Z3 backendMikhail R. Gadelha2018-11-281-96/+31
| | | | | | | | | | | | | | Summary: Left only the constructors that are actually required, and marked the move constructors as deleted. They are not used anymore and we were never sure they've actually worked correctly. Reviewers: george.karpenkov, NoQ Reviewed By: george.karpenkov Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, Szelethus, donat.nagy, dkrupp Differential Revision: https://reviews.llvm.org/D54974 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347777 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r347417 "Re-Reinstate 347294 with a fix for the failures."Hans Wennborg2018-11-2838-197/+567
| | | | | | | This was reverted in r347656 due to me thinking it caused a miscompile of Chromium. Turns out it was the Chromium code that was broken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347756 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASTImporter] Changed use of Import to Import_New in ASTImporter.Balazs Keri2018-11-282-320/+377
| | | | | | | | | | | | Reviewers: a.sidorin, shafik, a_sidorin Reviewed By: a_sidorin Subscribers: gamesh411, a_sidorin, dkrupp, martong, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53818 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347752 91177308-0d34-0410-b5e6-96231b3b80d8
* PR39809: (const void*)0 is not a null pointer constant in C.Richard Smith2018-11-282-6/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347730 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12884: Add test (bug is already fixed).Richard Smith2018-11-281-0/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347729 91177308-0d34-0410-b5e6-96231b3b80d8
* Move LoopHint.h from Sema to ParseRichard Trieu2018-11-287-9/+6
| | | | | | | | | struct LoopHint was only used within Parse and not in any of the Sema or Codegen files. In the non-Parse files where it was included, it either wasn't used or LoopHintAttr was used, so its inclusion did nothing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347728 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeGen] Fix included headers.Richard Trieu2018-11-281-1/+2
| | | | | | | | Remove the included Parse header because CodeGen should not depend on Parse. Instead, include the Lex headers that it needs instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347727 91177308-0d34-0410-b5e6-96231b3b80d8
* [diagtool] Remove unneeded header includes.Richard Trieu2018-11-282-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347726 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] remove redundant ColonExpected flag in ParseOpenMP.cpp (NFC)Kelvin Li2018-11-281-3/+0
| | | | | | | | | | | | The flag ColonExpected is not changed after being initialized to false at declaration. Patch by Ahsan Saghir Differential Revision: https://reviews.llvm.org/D54958 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347723 91177308-0d34-0410-b5e6-96231b3b80d8
* [RISCV] Mark unit tests as "requires: riscv-registered-target"Mandeep Singh Grang2018-11-276-0/+12
| | | | | | | | Some of these tests break if the RISCV backend has not been built. Reland D54816. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347720 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in "[clang][ARC] Fix test for commit r347699"Tatyana Krasnukha2018-11-271-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347718 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP][NVPTX]Basic support for reductions across the teams.Alexey Bataev2018-11-273-1327/+125
| | | | | | Added basic codegen support for the reductions across the teams. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347715 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS] Push outermost class DeclContexts only in -fdelayed-template-parsingReid Kleckner2018-11-272-12/+53
| | | | | | | This is more or less a complete rewrite of r347627, and it fixes PR38460 I added a reduced test case to DelayedTemplateParsing.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347713 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][ARC] Fix test for commit r347699Tatyana Krasnukha2018-11-271-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347705 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][slh] add attribute for speculative load hardeningZola Bridges2018-11-278-1/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Resubmit this with no changes because I think the build was broken by a different diff. ----- The prior diff had to be reverted because there were two tests that failed. I updated the two tests in this diff clang/test/Misc/pragma-attribute-supported-attributes-list.test clang/test/SemaCXX/attr-speculative-load-hardening.cpp ----- Summary from Previous Diff (Still Accurate) ----- LLVM IR already has an attribute for speculative_load_hardening. Before this commit, when a user passed the -mspeculative-load-hardening flag to Clang, every function would have this attribute added to it. This Clang attribute will allow users to opt into SLH on a function by function basis. This can be applied to functions and Objective C methods. Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347701 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][ARC] Add ARCTargetInfoTatyana Krasnukha2018-11-278-0/+402
| | | | | | | | Based-on-patch-by: Pete Couperus <petecoup@synopsys.com> Differential Revision: https://reviews.llvm.org/D53100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347699 91177308-0d34-0410-b5e6-96231b3b80d8