summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] Fix clang_Cursor_isAnonymousIvan Donchevskii2019-01-103-10/+31
| | | | | | | | Use the same logic as in TypePrinter::printTag to determine that the tag is anonymous and the separate check for namespaces. Differential Revision: https://reviews.llvm.org/D54996 llvm-svn: 350805
* [AMDGPU] Separate feature dot-instsStanislav Mekhanoshin2019-01-104-22/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D56525 llvm-svn: 350794
* Refactor declarations of ASTContext allocate functions into its own header.Richard Trieu2019-01-106-23/+46
| | | | | | | | | | | | | | Forward declarations of the allocate functions combine with the forward declaration of the ASTContext class is enough information for some headers without pulling in ASTContext.h in its entirety. Pull the existing declarations from AttrIterator.h into a new header. Also place the default alignment size into this header. Previously, new had its default in AttrIterator.h while new[] had its default in ASTContext.h. Add new header includes where it is needed. Specifically to ASTVector.h to make it a standalone header, unlike previously which it was standalone as long as none of its functions were called. llvm-svn: 350792
* [X86] Really make the pointer arguments to avx512 gather/scatter intrinsics ↵Craig Topper2019-01-101-57/+57
| | | | | | | | | | 'void*' to match gcc and Intel's documentation. The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc. I tried to do this in r350696, but I only updated the header not the builtin definition. llvm-svn: 350785
* In nothrow new-expressions, null-check the result if we're going toRichard Smith2019-01-102-2/+46
| | | | | | | | | apply sanitizers to it. This avoids a sanitizer false positive that we are initializing a null pointer. llvm-svn: 350779
* [Sema] Mark target of __attribute__((alias("target"))) used for CNick Desaulniers2019-01-092-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Prevents -Wunneeded-internal-delcaration warnings when the target has no other references. This occurs frequently in device drivers in the Linux kernel. Sema would need to invoke the demangler on the target, since in C++ the target name is mangled: int f() { return 42; } int g() __attribute__((alias("_Z1fv"))); Sema does not have the ability to demangle names at this time. https://bugs.llvm.org/show_bug.cgi?id=39088 https://github.com/ClangBuiltLinux/linux/issues/232 Reviewers: rsmith, rjmccall Reviewed By: rsmith Subscribers: erik.pilkington, cfe-commits, pirama, srhines Differential Revision: https://reviews.llvm.org/D54188 llvm-svn: 350776
* [ObjC] Allow the use of implemented unavailable methods from withinAlex Lorenz2019-01-092-6/+90
| | | | | | | | | | | | | | | | | | the @implementation context In Objective-C, it's common for some frameworks to mark some methods like init as unavailable in the @interface to prohibit their usage. However, these frameworks then often implemented said method and refer to it in another method that acts as a factory for that object. The recent change to how messages to self are type checked in clang (r349841) introduced a regression which started to prohibit this pattern with an X is unavailable error. This commit addresses the aforementioned regression. rdar://47134898 Differential Revision: https://reviews.llvm.org/D56469 llvm-svn: 350768
* [OpenMP] Avoid remainder operations for loop index values on a collapsed ↵Gheorghe-Teodor Bercea2019-01-095-68/+232
| | | | | | | | | | | | | | | | loop nest. Summary: Change the strategy for computing loop index variables after collapsing a loop nest via the collapse clause by replacing the expensive remainder operation with multiplications and additions. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56413 llvm-svn: 350759
* [OpenMP] Add flag for preventing the extension to 64 bits for the collapse ↵Gheorghe-Teodor Bercea2019-01-097-21/+51
| | | | | | | | | | | | | | | | loop counter Summary: Introduce a compiler flag for cases when the user knows that the collapsed loop counter can be safely represented using at most 32 bits. This will prevent the emission of expensive mathematical operations (such as the div operation) on the iteration variable using 64 bits where 32 bit operations are sufficient. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: hfinkel, kkwli0, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D55928 llvm-svn: 350758
* [OPENMP][DOCS]Release notes/OpenMP support updates, NFC.Alexey Bataev2019-01-092-4/+19
| | | | llvm-svn: 350757
* Removing an include that was not necessary; NFC.Aaron Ballman2019-01-091-19/+19
| | | | | | The include also had a using namespace llvm in it, so this adds qualifiers where needed as well. llvm-svn: 350756
* [CodeGen] Clarify comment about COFF common symbol alignmentShoaib Meenai2019-01-091-2/+6
| | | | | | | | | | | | | After a discussion on the commit thread, it seems the 32 byte alignment limitation is an MSVC toolchain artifact, not an inherent COFF restriction. Clarify the comment accordingly, since saying COFF in the comment but using isKnownWindowsMSVCEnvironment in the conditional is confusing. Also add a newline before the comment, which is consistent with the local style. Differential Revision: https://reviews.llvm.org/D56466 llvm-svn: 350754
* [AST] Move back BasePathSize to the bit-fields of CastExprBruno Ricci2019-01-096-125/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | The number of trailing CXXBaseSpecifiers in CastExpr was moved from CastExprBitfields to a trailing object in r338489 (D50050). At this time these bit-fields classes were only 32 bits wide. However later r345459 widened these bit-field classes to 64 bits. The reason for this change was that on 64 bit archs alignment requirements caused 4 bytes of padding after the Stmt sub-object in nearly all expression classes. Reusing this padding yielded an >10% reduction in the size used by all statement/expressions when parsing all of Boost (on a 64 bit arch). This increased the size of statement/expressions for 32 bits archs, but this can be mitigated by moving more data to the bit-fields of Stmt (and moreover most people now care about 64 bits archs as a host). Therefore move back the number of CXXBaseSpecifiers in CastExpr to the bit-fields of Stmt. This in effect mostly revert r338489 while keeping the added test. Differential Revision: https://reviews.llvm.org/D56358 Reviewed By: lebedev.ri Reviewers: lebedev.ri, rjmccall llvm-svn: 350741
* Incorrect implicit data-sharing for nested tasksAlexey Bataev2019-01-092-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is a minor issue in how the implicit data-sharings for nested tasks are computed. For the following example: ``` int x; #pragma omp task shared(x) #pragma omp task x++; ``` We compute an implicit data-sharing of shared for `x` in the second task although I think that it should be firstprivate. Below you can find the part of the OpenMP spec that covers this example: - // In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above and that in the enclosing context is determined to be shared by all implicit tasks bound to the current team is shared.// - //In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivate.// Since each implicit-task has its own copy of `x`, we shouldn't apply the first rule. Reviewers: ABataev Reviewed By: ABataev Subscribers: cfe-commits, rogfer01 Tags: #openmp Differential Revision: https://reviews.llvm.org/D56430 llvm-svn: 350734
* [AST] Store the results in OverloadExpr in a trailing arrayBruno Ricci2019-01-095-275/+388
| | | | | | | | | | | | | | | Use the newly available space in the bit-fields of Stmt to pack OverloadExpr, UnresolvedLookupExpr and UnresolvedMemberExpr. Additionally store the results in the overload set in a trailing array. This saves 1 pointer + 8 bytes per UnresolvedLookupExpr and UnresolvedMemberExpr. Differential Revision: https://reviews.llvm.org/D56368 Reviewed By: rjmccall llvm-svn: 350732
* Remove dependency-related arguments in clang-check.Alexander Kornienko2019-01-091-0/+1
| | | | | | | This is the default behavior of clang tools, but clang-check overrides default argument adjusters for some reason. llvm-svn: 350727
* Fix typo in commentNico Weber2019-01-091-1/+1
| | | | llvm-svn: 350724
* Revert r350648: "Fix clang for r350647: Missed a function rename"Florian Hahn2019-01-091-3/+2
| | | | | | | The related commit r350647 breaks thread sanitizer on some macOS builders, e.g. http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/ llvm-svn: 350718
* [Driver] Fix libcxx detection on Darwin with clang run as ./clangIlya Biryukov2019-01-093-5/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: By using '..' instead of fs::parent_path. The intention of the code was to go from 'path/to/clang/bin' to 'path/to/clang/include'. In most cases parent_path works, however it would fail when clang is run as './clang'. This was noticed in Chromium's bug tracker, see https://bugs.chromium.org/p/chromium/issues/detail?id=919761 Reviewers: arphaman, thakis, EricWF Reviewed By: arphaman, thakis Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D56446 llvm-svn: 350714
* Use DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.Anastasia Stulova2019-01-0910-132/+135
| | | | | | | | | | Rather than duplicating data fields, use DeclSpec directly to store the qualifiers for the functions/methods. This change doesn't handle attributes yet and has to be extended further. Differential revision: https://reviews.llvm.org/D55948 llvm-svn: 350703
* [X86] Make the pointer arguments to avx512 gather/scatter intrinsics 'void*' ↵Craig Topper2019-01-093-96/+96
| | | | | | | | to match gcc and Intel's documentation. The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc. llvm-svn: 350696
* [libclang] Fix the mismatched delete operator for ExprEvalResultAlex Lorenz2019-01-081-1/+1
| | | | | | | | The '.stringVal' field in ExprEvalResult is allocated using new[], but was freed using a regular delete. That caused memory leaks in the test from r350666. llvm-svn: 350680
* [ASTDump] NFC: Move dumpDeclRef to NodeDumperStephen Kelly2019-01-083-45/+46
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55337 llvm-svn: 350677
* [Driver] Default to -fno-addrsig on Android.Dan Albert2019-01-082-0/+2
| | | | | | | | | | | | | | Summary: The Android NDK still uses GNU binutils by default. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56456 llvm-svn: 350668
* [libclang] Recommit r336590 with a fix for the memory leak in the testAlex Lorenz2019-01-082-24/+65
| | | | | | | | | | | | | | | | | | | | | | | | The original commit had a memory leak in the test has a leak as it doesn't dispose of the evaluated cursor result. This also contains the follow-up NFC refactoring commit r336591. rdar://45893054 Original commit message: [libclang] evalute compound statement cursors before trying to evaluate the cursor like a declaration This change fixes a bug in libclang in which it tries to evaluate a statement cursor as a declaration cursor, because that statement still has a pointer to the declaration parent. rdar://38888477 Differential Revision: https://reviews.llvm.org/D49051 llvm-svn: 350666
* Implement the TreeStructure interface through the TextNodeDumperStephen Kelly2019-01-084-91/+90
| | | | | | | | | | | | | | | | | | | | Summary: This way, when the generic ASTTraverser is extracted from ASTDumper, there can't be any problem related to ordering of class members, a concern that was raised in https://reviews.llvm.org/D55337. This will also preserve the property that the generic traverser does not enforce any coupling between the NodeDumper and the TreeStructure. https://godbolt.org/z/PEtT1_ Reviewers: aaron.ballman, erichkeane Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56407 llvm-svn: 350665
* Android is not GNU, so don't claim that it is.Dan Albert2019-01-082-1/+4
| | | | | | | | | | | | Reviewers: pirama, srhines Reviewed By: srhines Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D55953 llvm-svn: 350664
* [Sema] Teach Clang that aligned allocation is not supported with macosx10.13Louis Dionne2019-01-083-12/+12
| | | | | | | | | | | | | | | | | Summary: r306722 added diagnostics when aligned allocation is used with deployment targets that do not support it, but the first macosx supporting aligned allocation was incorrectly set to 10.13. In reality, the dylib shipped with macosx10.13 does not support aligned allocation, but the dylib shipped with macosx10.14 does. Reviewers: ahatanak Subscribers: christof, jkorous, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D56445 llvm-svn: 350649
* Fix clang for r350647: Missed a function renamePhilip Pfaffe2019-01-081-2/+3
| | | | llvm-svn: 350648
* Fix opencl test broken on windows by r350643.Erich Keane2019-01-081-2/+2
| | | | | | | | | Windows doesn't allow common with alignment >32 bits, so these tests were broken in windows mode. This patch makes 'common' optional in these cases. Change-Id: I4d5fdd07ecdafc3570ef9b09cd816c2e5e4ed15e llvm-svn: 350645
* [NFC] Don't over-eagerly check block alignmentJF Bastien2019-01-081-2/+2
| | | | | | Alignment of __block isn't relevant to this test, remove its checking. llvm-svn: 350644
* Limit COFF 'common' emission to <=32 alignment types.Erich Keane2019-01-082-0/+13
| | | | | | | | | | | | | | | | As reported in PR33035, LLVM crashes if given a common object with an alignment of greater than 32 bits. This is because the COFF file format does not support these alignments, so emitting them is broken anyway. This patch changes any global definitions greater than 32 bit alignment to no longer be in 'common'. https://bugs.llvm.org/show_bug.cgi?id=33035 Differential Revision: https://reviews.llvm.org/D56391 Change-Id: I48609289753b7f3b58c5e2bc1712756750fbd45a llvm-svn: 350643
* __has_feature(pragma_clang_attribute_namespaces) should be __has_extensionErik Pilkington2019-01-083-3/+9
| | | | | | Thanks to Richard Smith for pointing this out. llvm-svn: 350642
* Rename DIFlagFixedEnum to DIFlagEnumClass. NFCPaul Robinson2019-01-082-14/+14
| | | | llvm-svn: 350641
* Revert "Split -Wdelete-non-virtual-dtor into -Wdelete-abstract-non-virtual-dtor"Erik Pilkington2019-01-083-35/+1
| | | | | | | This reverts commit r350585. There was some late post-commit review on phab. llvm-svn: 350639
* Fix use-after-free bug in Tooling.Alexander Kornienko2019-01-083-17/+14
| | | | | | | | | | | | | | | | | | | Summary: `buildASTFromCodeWithArgs()` was creating a memory buffer referencing a stack-allocated string. This diff changes the implementation to copy the code string into the memory buffer so that said buffer owns the memory. Patch by Yitzhak Mandelbaum. Reviewers: alexfh Reviewed By: alexfh Subscribers: cfe-commits, EricWF Differential Revision: https://reviews.llvm.org/D55765 llvm-svn: 350638
* Don't emit DW_AT_enum_class unless it's actually an 'enum class'.Paul Robinson2019-01-082-1/+4
| | | | | | | | Finishes off the functional part of PR36168. Differential Revision: https://reviews.llvm.org/D56393 llvm-svn: 350636
* [AST][NFC] Pack CXXScalarValueInitExprBruno Ricci2019-01-084-9/+22
| | | | | | | Use the newly available space in the bit-fields of Stmt. This saves one pointer per CXXScalarValueInitExpr. NFC. llvm-svn: 350635
* [OPENMP]Fix PR40191: Do not allow orphaned cancellation constructs.Alexey Bataev2019-01-083-44/+47
| | | | | | Prohibited use of the orphaned cancellation directives. llvm-svn: 350634
* [AST][NFC] Pack CXXNoexceptExpr and SubstNonTypeTemplateParmExprBruno Ricci2019-01-083-29/+51
| | | | | | | | | | Use the newly available space in the bit-fields of Stmt. This saves one pointer per CXXNoexceptExpr/SubstNonTypeTemplateParmExpr. Use this opportunity to run clang-format on these two classes and fix some style issues. NFC overall. llvm-svn: 350627
* [AST] Pack CXXDependentScopeMemberExprBruno Ricci2019-01-085-128/+189
| | | | | | | | | | | | | | | | | | | | Use the newly available space in the bit-fields of Stmt. Additionally store FirstQualifierFoundInScope as a trailing object since it is most of the time null (non-null for 2 of the 35446 CXXDependentScopeMemberExpr when parsing all of Boost). It would be possible to move the data for the nested-name-specifier to a trailing object too to save another 2 pointers, however doing so did actually regress the time taken to parse all of Boost slightly. This saves 8 bytes + 1 pointer per CXXDependentScopeMemberExpr in the vast majority of cases. Differential Revision: https://reviews.llvm.org/D56367 Reviewed By: rjmccall llvm-svn: 350625
* [Sema] Diagnose array access preceding the array bounds even when the base ↵Bruno Ricci2019-01-082-7/+13
| | | | | | | | | | | | | | | | | type is incomplete. When the type of the base expression after IgnoreParenCasts is incomplete, it is still possible to diagnose an array access which precedes the array bounds. This is a follow-up on D55862 which added an early return when the type of the base expression after IgnoreParenCasts was incomplete. Differential Revision: https://reviews.llvm.org/D56050 Reviewed By: efriedma llvm-svn: 350622
* [X86] Add shift-by-immediate tests for non-immediate/out-of-range valuesSimon Pilgrim2019-01-086-0/+588
| | | | | | As noted on PR40203, for gcc compatibility we need to support non-immediate values in the 'slli/srli/srai' shift by immediate vector intrinsics. llvm-svn: 350619
* [ASTMatchers] Improve assert message for broken parent map.Sam McCall2019-01-081-7/+11
| | | | | | | | | | | | | | | | Summary: This assert catches places where the AST (as seen by RecursiveASTVisitor) becomes disconnected due to incomplete traversal. Making it print the actual parent-less node is a lot more helpful - it's possible to work out which part of the tree wasn't traversed. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56395 llvm-svn: 350612
* Split -Wdelete-non-virtual-dtor into -Wdelete-abstract-non-virtual-dtorErik Pilkington2019-01-083-1/+35
| | | | | | | | | | | | | | | -Wdelete-non-virtual-dtor previously controlled two diagnostics: 1) calling a non-virtual dtor from an abstract class, and 2) calling a non-virtual dtor from a polymorphic class. 1) is a lot more severe than 2), since 1) is a guaranteed crash, but 2) is just "code smell". Previously, projects compiled with -Wall -Wno-delete-non-virtual-dtor, which is somewhat reasonable, silently crashed on 1). rdar://40380564 Differential revision: https://reviews.llvm.org/D56405 llvm-svn: 350585
* NFC: Replace asserts with if() in SourceLocation accessorsStephen Kelly2019-01-073-13/+19
| | | | | | | | | | | | | | | | | | | Summary: Nowhere else in the AST classes assert on these kinds of accessors. This way, we can call the accessors and check the validity of the result instead of externally duplicating the conditions. This generality will make it possible to introspect instances for source locations: http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/iiaWhw Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56354 llvm-svn: 350573
* Add a __has_feature check for namespaces on #pragma clang attribute.Erik Pilkington2019-01-073-1/+8
| | | | | | Support for this was added in r349845. llvm-svn: 350572
* [OPENMP]Add call to __kmpc_push_target_tripcount() function.Alexey Bataev2019-01-0712-4/+247
| | | | | | | | | | Each we create the target regions with the teams distribute inner region, we can better estimate number of the teams required to execute the target region. Function __kmpc_push_target_tripcount() is used for purpose, which accepts device_id and the number of the iterations, performed by the associated loop. llvm-svn: 350571
* Recommit r350555 "[X86] Use funnel shift intrinsics for the VBMI2 ↵Craig Topper2019-01-076-417/+407
| | | | | | | | vshld/vshrd builtins." The MSVC limit hit in AutoUpgrade.cpp has been worked around for now. llvm-svn: 350568
* Revert r350555 "[X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd ↵Craig Topper2019-01-076-407/+417
| | | | | | | | builtins." Had to revert the LLVM patch this depends on to fix a MSVC compiler limit in AutoUpgrade.cpp llvm-svn: 350563
OpenPOWER on IntegriCloud