summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Add a new attribute, fortify_stdlib"Erik Pilkington2019-03-131-1/+0
| | | | | | | | | | This reverts commit r353765. After talking with our c stdlib folks, we decided to use the existing pass_object_size attribute to implement _FORTIFY_SOURCE wrappers, like Bionic does (I didn't realize that pass_object_size could be used for this purpose). Sorry for the flip/flop, and thanks to James Y. Knight for pointing this out to me. llvm-svn: 356103
* [DWARF] Make -g with empty assembler source work better.Paul Robinson2019-03-011-1/+2
| | | | | | | | | | | | | This was sometimes causing clang or llvm-mc to crash, and in other cases could emit a bogus DWARF line-table header. I did an interim patch in r352541; this patch should be a cleaner and more complete fix, and retains the test. Addresses PR40538. Differential Revision: https://reviews.llvm.org/D58750 llvm-svn: 355226
* [X86] AMD znver2 enablementGanesh Gopalasubramanian2019-02-261-2/+2
| | | | | | | | | | | | | | | | | This patch enables the following 1) AMD family 17h "znver2" tune flag (-march, -mcpu). 2) ISAs that are enabled for "znver2" architecture. 3) For the time being, it uses the znver1 scheduler model. 4) Tests are updated. 5) This patch is the clang counterpart to D58343 Reviewers: craig.topper Tags: #clang Differential Revision: https://reviews.llvm.org/D58344 llvm-svn: 354899
* [attributes] Fix buildbot after r354530.Artem Dergachev2019-02-211-1/+1
| | | | | | | | Update the test after adding more attribute subjects. Differential Revision: https://reviews.llvm.org/D58365 llvm-svn: 354531
* [attributes] Add an attribute for server routines in Mach kernel and extensions.Artem Dergachev2019-02-211-0/+1
| | | | | | | | | | | | The new __attribute__ ((mig_server_routine)) is going to be used for annotating Mach Interface Generator (MIG) callback functions as such, so that additional static analysis could be applied to their implementations. It can also be applied to regular functions behavior of which is supposed to be identical to that of a MIG server routine. Differential Revision: https://reviews.llvm.org/D58365 llvm-svn: 354530
* Remove extraneous space in MSVC-style diagnostic outputHans Wennborg2019-02-191-22/+22
| | | | | | | | | | | | | | | There was an extra space between the file location and the diagnostic message: /tmp/a.c(1,12): warning: unused parameter 'unused' the tests didn't catch this due to FileCheck not running in --strict-whitespace mode. Reported by Marco: http://lists.llvm.org/pipermail/cfe-dev/2019-February/061326.html Differential revision: https://reviews.llvm.org/D58377 llvm-svn: 354351
* Fix some tests I broke in r354190Erik Pilkington2019-02-161-1/+1
| | | | | | | This was breaking on MSVC, since long double and double have the same semantics there. llvm-svn: 354192
* [Sema] Delay checking whether objc_designated_initializer is being applied ↵Erik Pilkington2019-02-131-0/+1
| | | | | | | | | | | | | | | | to an init method This fixes a regression that was caused by r335084, which reversed the order that attributes are applied. objc_method_family can change whether a method is an init method, so the order that these attributes are applied matters. The commit fixes this by delaying the init check until after all attributes have been applied. rdar://47829358 Differential revision: https://reviews.llvm.org/D58152 llvm-svn: 353976
* Add a new attribute, fortify_stdlibErik Pilkington2019-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | This attribute applies to declarations of C stdlib functions (sprintf, memcpy...) that have known fortified variants (__sprintf_chk, __memcpy_chk, ...). When applied, clang will emit calls to the fortified variant functions instead of calls to the defaults. In GCC, this is done by adding gnu_inline-style wrapper functions, but that doesn't work for us for variadic functions because we don't support __builtin_va_arg_pack (and have no intention to). This attribute takes two arguments, the first is 'type' argument passed through to __builtin_object_size, and the second is a flag argument that gets passed through to the variadic checking variants. rdar://47905754 Differential revision: https://reviews.llvm.org/D57918 llvm-svn: 353765
* bpf: teach BPF driver about the new CPU "v3"Jiong Wang2019-02-071-1/+1
| | | | | | | | | This patch simply teach BPF driver about the new CPU "v3" introduced in LLVM backend. Acked-by: Yonghong Song <yhs@fb.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> llvm-svn: 353479
* [OBJC] Add attribute to mark Objective C class as non-lazyJoe Daniels2019-02-041-0/+1
| | | | | | | | | | | | | A non-lazy class will be initialized eagerly when the Objective-C runtime is loaded. This is required for certain system classes which have instances allocated in non-standard ways, such as the classes for blocks and constant strings. Adding this attribute is essentially equivalent to providing a trivial +load method but avoids the (fairly small) load-time overheads associated with defining and calling such a method. Differential Revision: https://reviews.llvm.org/D56555 llvm-svn: 353116
* [WebAssembly] Fix ImportName's position in this test.Dan Gohman2019-02-011-1/+1
| | | | | | This is a follow-up to r352930. llvm-svn: 352936
* [WebAssembly] Add an import_field function attributeDan Gohman2019-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This is similar to import_module, but sets the import field name instead. By default, the import field name is the same as the C/asm/.o symbol name. However, there are situations where it's useful to have it be different. For example, suppose I have a wasm API with a module named "pwsix" and a field named "read". There's no risk of namespace collisions with user code at the wasm level because the generic name "read" is qualified by the module name "pwsix". However in the C/asm/.o namespaces, the module name is not used, so if I have a global function named "read", it is intruding on the user's namespace. With the import_field module, I can declare my function (in libc) to be "__read", and then set the wasm import module to be "pwsix" and the wasm import field to be "read". So at the C/asm/.o levels, my symbol is outside the user namespace. Differential Revision: https://reviews.llvm.org/D57602 llvm-svn: 352930
* Fix isInSystemMacro to handle pasted macrosSerge Guelton2019-02-014-0/+47
| | | | | | | | | | | | | Token pasted by the preprocessor (through ##) have a Spelling pointing to scratch buffer. As a result they are not recognized at system macro, even though the pasting happened in a system macro. Fix that by looking into the parent macro if the original lookup finds a scratch buffer. Differential Revision: https://reviews.llvm.org/D55782 This effectively fixes https://bugs.llvm.org/show_bug.cgi?id=35268, llvm-svn: 352838
* [cc1as] Test that -g of empty .s file does something sensible.Paul Robinson2019-01-291-0/+11
| | | | | | Depends on LLVM r352541. llvm-svn: 352542
* [WebAssembly] Add WebAssemblyImportModule to ↵Dan Gohman2019-01-241-0/+1
| | | | | | pragma-attribute-supported-attributes-list.test llvm-svn: 352108
* Emit !callback metadata and introduce the callback attributeJohannes Doerfert2019-01-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | With commit r351627, LLVM gained the ability to apply (existing) IPO optimizations on indirections through callbacks, or transitive calls. The general idea is that we use an abstraction to hide the middle man and represent the callback call in the context of the initial caller. It is described in more detail in the commit message of the LLVM patch r351627, the llvm::AbstractCallSite class description, and the language reference section on callback-metadata. This commit enables clang to emit !callback metadata that is understood by LLVM. It does so in three different cases: 1) For known broker functions declarations that are directly generated, e.g., __kmpc_fork_call for the OpenMP pragma parallel. 2) For known broker functions that are identified by their name and source location through the builtin detection, e.g., pthread_create from the POSIX thread API. 3) For user annotated functions that carry the "callback(callee, ...)" attribute. The attribute has to include the name, or index, of the callback callee and how the passed arguments can be identified (as many as the callback callee has). See the callback attribute documentation for detailed information. Differential Revision: https://reviews.llvm.org/D55483 llvm-svn: 351629
* [clang][slh] add Clang attr no_speculative_load_hardeningZola Bridges2019-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This attribute will allow users to opt specific functions out of speculative load hardening. This compliments the Clang attribute named speculative_load_hardening. When this attribute or the attribute speculative_load_hardening is used in combination with the flags -mno-speculative-load-hardening or -mspeculative-load-hardening, the function level attribute will override the default during LLVM IR generation. For example, in the case, where the flag opposes the function attribute, the function attribute will take precendence. The sticky inlining behavior of the speculative_load_hardening attribute may cause a function with the no_speculative_load_hardening attribute to be tagged with the speculative_load_hardening tag in subsequent compiler phases which is desired behavior since the speculative_load_hardening LLVM attribute is designed to be maximally conservative. If both attributes are specified for a function, then an error will be thrown. Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54909 llvm-svn: 351565
* [Nios2] Remove Nios2 backendCraig Topper2019-01-151-4/+0
| | | | | | | | As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months. Differential Revision: https://reviews.llvm.org/D56690 llvm-svn: 351230
* [Sema] Expose a control flag for integer to pointer ext warningKristina Brooks2019-01-141-2/+1
| | | | | | | | | | | | | While building openJDK11u, it seems that some of the code in the native core libraries make liberal use of integer to pointer comparisons. We currently have no flag to disabled this warning. This add such a flag. Patch by Kader (abdoul-kader keita) Differential Revision: https://reviews.llvm.org/D56241 llvm-svn: 351082
* [attributes] Extend os_returns_(not_?)_retained attributes to parametersGeorge Karpenkov2019-01-111-2/+4
| | | | | | | | | | | When applied to out-parameters, the attributes specify the expected lifetime of the written-into object. Additionally, introduce OSReturnsRetainedOn(Non)Zero attributes, which specify that an ownership transfer happens depending on a return code. Differential Revision: https://reviews.llvm.org/D56292 llvm-svn: 350942
* [ObjCARC] Add an new attribute, objc_externally_retainedErik Pilkington2019-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | This attribute, called "objc_externally_retained", exposes clang's notion of pseudo-__strong variables in ARC. Pseudo-strong variables "borrow" their initializer, meaning that they don't retain/release it, instead assuming that someone else is keeping their value alive. If a function is annotated with this attribute, implicitly strong parameters of that function aren't implicitly retained/released in the function body, and are implicitly const. This is useful to expose for performance reasons, most functions don't need the extra safety of the retain/release, so programmers can opt out as needed. This attribute can also apply to declarations of local variables, with similar effect. Differential revision: https://reviews.llvm.org/D55865 llvm-svn: 350422
* [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.Michael Kruse2018-12-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g. #pragma clang loop unroll_and_jam(enable) #pragma clang loop distribute(enable) is the same as #pragma clang loop distribute(enable) #pragma clang loop unroll_and_jam(enable) and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used. This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance, !0 = !{!0, !1, !2} !1 = !{!"llvm.loop.unroll_and_jam.enable"} !2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3} !3 = !{!"llvm.loop.distribute.enable"} defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop. Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account. For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations. Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated. To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied. With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling). Reviewed By: hfinkel, dmgreen Differential Revision: https://reviews.llvm.org/D49281 Differential Revision: https://reviews.llvm.org/D55288 llvm-svn: 348944
* NFC: Make this test kinder on downstream forksErik Pilkington2018-12-041-1/+2
| | | | | | | | | | | Downstream forks that have their own attributes often run into this test failing when a new attribute is added to clang because the number of supported attributes no longer match. This is redundant information for this test, so we can get by without it. rdar://46288577 llvm-svn: 348218
* Updating this test, which changed after the reverts from r348020.Aaron Ballman2018-11-301-3/+3
| | | | llvm-svn: 348023
* Reverting r347949-r347951 because they broke the test bots.Aaron Ballman2018-11-301-3/+3
| | | | | | http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/440/steps/ninja%20check%202/logs/FAIL%3A%20Clang%3A%3Aosobject-retain-release.cpp llvm-svn: 348020
* Move AST tests into their own test directory; NFC.Aaron Ballman2018-11-3034-3100/+0
| | | | | | This moves everything primarily testing the functionality of -ast-dump and -ast-print into their own directory, rather than leaving the tests spread around the testing directory. llvm-svn: 348017
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-11-301-1/+62
| | | | | | This adds tests for GenericSelectionExpr; note that it points out a minor whitespace bug for selection expression cases. llvm-svn: 348008
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-11-301-0/+30
| | | | | | This adds tests for DeclStmt and demonstrates that we don't create such an AST node for global declarations currently. llvm-svn: 347996
* Adding tests for -ast-dump; NFC.Aaron Ballman2018-11-301-0/+124
| | | | | | This adds tests for the majority of the functionality around FunctionDecl and CXXMethodDecl. llvm-svn: 347994
* [analyzer] Fixes after rebase.George Karpenkov2018-11-301-3/+3
| | | | llvm-svn: 347951
* [attributes] Add a family of OS_CONSUMED, OS_RETURNS and OS_RETURNS_RETAINED ↵George Karpenkov2018-11-301-1/+4
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 347947
* [clang][slh] add attribute for speculative load hardeningZola Bridges2018-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 347701
* [X86] Add -march=cascadelake support in clang.Craig Topper2018-11-271-2/+2
| | | | | | | | | | This is skylake-avx512 with the addition of avx512vnni ISA. Patch by Jianping Chen Differential Revision: https://reviews.llvm.org/D54792 llvm-svn: 347682
* Revert "[clang][slh] add attribute for speculative load hardening"Zola Bridges2018-11-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | until I figure out why the build is failing or timing out *************************** Summary: 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 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 This reverts commit a5b3c232d1e3613f23efbc3960f8e23ea70f2a79. (r347617) llvm-svn: 347628
* [clang][slh] add attribute for speculative load hardeningZola Bridges2018-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: 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 llvm-svn: 347617
* Create a diagnostic group for ↵Sylvestre Ledru2018-11-261-2/+1
| | | | | | | | | | | | | | | | warn_call_to_pure_virtual_member_function_from_ctor_dtor, so it can be turned into an error using Werror Summary: Patch by Arnaud Bienner Reviewers: davide, rsmith, jkorous Reviewed By: jkorous Subscribers: jkorous, sylvestre.ledru, cfe-commits Differential Revision: https://reviews.llvm.org/D53807 llvm-svn: 347555
* Compound literals, enums, et al require const exprBill Wendling2018-11-095-7/+14
| | | | | | | | | | | | | | | | | | Summary: Compound literals, enums, file-scoped arrays, etc. require their initializers and size specifiers to be constant. Wrap the initializer expressions in a ConstantExpr so that we can easily check for this later on. Reviewers: rsmith, shafik Reviewed By: rsmith Subscribers: cfe-commits, jyknight, nickdesaulniers Differential Revision: https://reviews.llvm.org/D53921 llvm-svn: 346455
* [AST] Only store the needed data in SwitchStmtBruno Ricci2018-10-291-1/+0
| | | | | | | | | | | | | | | | Don't store the data for the init statement and condition variable if not needed. This cuts the size of SwitchStmt by up to 2 pointers. The order of the children is intentionally kept the same. Also use the newly available space in the bit-fields of Stmt to store the bit representing whether all enums have been covered instead of using a PointerIntPair. Differential Revision: https://reviews.llvm.org/D53714 Reviewed By: rjmccall llvm-svn: 345510
* [AST] Don't store data for GNU range case statement if not neededBruno Ricci2018-10-281-2/+0
| | | | | | | | | | | | | | | | Don't store the data for case statements of the form LHS ... RHS if not needed. This cuts the size of CaseStmt by 1 pointer + 1 SourceLocation in the common case. Also use the newly available space in the bit-fields of Stmt to store the keyword location of SwitchCase and move the small accessor SwitchCase::getSubStmt to the header. Differential Revision: https://reviews.llvm.org/D53609 Reviewed By: rjmccall llvm-svn: 345472
* [AST] Only store the needed data in IfStmtBruno Ricci2018-10-271-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | Only store the needed data in IfStmt. This cuts the size of IfStmt by up to 3 pointers + 1 SourceLocation. The order of the children is intentionally kept the same even though it would be more convenient to put the optional trailing objects last. Additionally use the newly available space in the bit-fields of Stmt to store the location of the "if". The result of this is that for the common case of an if statement of the form: if (some_cond) some_statement the size of IfStmt is brought down to 8 bytes + 2 pointers, instead of 8 bytes + 5 pointers + 2 SourceLocation. Differential Revision: https://reviews.llvm.org/D53607 Reviewed By: rjmccall llvm-svn: 345464
* [Hexagon] Remove support for V4Krzysztof Parzyszek2018-10-191-1/+1
| | | | llvm-svn: 344786
* [clang] Add the exclude_from_explicit_instantiation attributeLouis Dionne2018-10-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: This attribute allows excluding a member of a class template from being part of an explicit template instantiation of that class template. This also makes sure that code using such a member will not take for granted that an external instantiation exists in another translation unit. The attribute was discussed on cfe-dev at [1] and is primarily motivated by the removal of always_inline in libc++ to control what's part of the ABI (see links in [1]). [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html rdar://problem/43428125 Reviewers: rsmith Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51789 llvm-svn: 343790
* Add inherited attributes before parsed attributes.Michael Kruse2018-09-241-0/+21
| | | | | | | | | | | | | | | | | Currently, attributes from previous declarations ('inherited attributes') are added to the end of a declaration's list of attributes. Before r338800, the attribute list was in reverse. r338800 changed the order of non-inherited (parsed from the current declaration) attributes, but inherited attributes are still appended to the end of the list. This patch appends inherited attributes after other inherited attributes, but before any non-inherited attribute. This is to make the order of attributes in the AST correspond to the order in the source code. Differential Revision: https://reviews.llvm.org/D50214 llvm-svn: 342861
* Allow all supportable non-type attributes to be used with #pragma clang ↵Richard Smith2018-09-051-1/+54
| | | | | | | | | | | | | | | | | attribute. Summary: We previously disallowed use of undocumented attributes with #pragma clang attribute, but the justification for doing so was weak and it prevented many reasonable use cases. Reviewers: aaron.ballman, arphaman Subscribers: cfe-commits, rnk, benlangmuir, dexonsmith, erik.pilkington Differential Revision: https://reviews.llvm.org/D51507 llvm-svn: 341437
* [AttrDocs] Fix build bots: add missing GNUInline pragma to test.Jordan Rupprecht2018-08-301-1/+2
| | | | llvm-svn: 341002
* Add a new flag and attributes to control static destructor registrationErik Pilkington2018-08-211-1/+3
| | | | | | | | | | | | | | | | | | | | This commit adds the flag -fno-c++-static-destructors and the attributes [[clang::no_destroy]] and [[clang::always_destroy]]. no_destroy specifies that a specific static or thread duration variable shouldn't have it's destructor registered, and is the default in -fno-c++-static-destructors mode. always_destroy is the opposite, and is the default in -fc++-static-destructors mode. A variable whose destructor is disabled (either because of -fno-c++-static-destructors or [[clang::no_destroy]]) doesn't count as a use of the destructor, so we don't do any access checking or mark it referenced. We also don't emit -Wexit-time-destructors for these variables. rdar://21734598 Differential revision: https://reviews.llvm.org/D50994 llvm-svn: 340306
* Refactor attribute printing to be a bit more obviously-correct.Richard Smith2018-08-091-0/+12
| | | | | | No functionality change intended. llvm-svn: 339306
* Append new attributes to the end of an AttributeList.Michael Kruse2018-08-031-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit of r335084 after revert in r335516. ... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse order, and therefore printed in the wrong order in -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effect, especially on diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attributes' order was changed instead. This unfortunately causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible to each other. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reverse. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway. Differential Revision: https://reviews.llvm.org/D48100 llvm-svn: 338800
* Implement cpu_dispatch/cpu_specific MultiversioningErich Keane2018-07-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As documented here: https://software.intel.com/en-us/node/682969 and https://software.intel.com/en-us/node/523346. cpu_dispatch multiversioning is an ICC feature that provides for function multiversioning. This feature is implemented with two attributes: First, cpu_specific, which specifies the individual function versions. Second, cpu_dispatch, which specifies the location of the resolver function and the list of resolvable functions. This is valuable since it provides a mechanism where the resolver's TU can be specified in one location, and the individual implementions each in their own translation units. The goal of this patch is to be source-compatible with ICC, so this implementation diverges from the ICC implementation in a few ways: 1- Linux x86/64 only: This implementation uses ifuncs in order to properly dispatch functions. This is is a valuable performance benefit over the ICC implementation. A future patch will be provided to enable this feature on Windows, but it will obviously more closely fit ICC's implementation. 2- CPU Identification functions: ICC uses a set of custom functions to identify the feature list of the host processor. This patch uses the cpu_supports functionality in order to better align with 'target' multiversioning. 1- cpu_dispatch function def/decl: ICC's cpu_dispatch requires that the function marked cpu_dispatch be an empty definition. This patch supports that as well, however declarations are also permitted, since the linker will solve the issue of multiple emissions. Differential Revision: https://reviews.llvm.org/D47474 llvm-svn: 337552
OpenPOWER on IntegriCloud