summaryrefslogtreecommitdiffstats
path: root/clang/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit !callback metadata and introduce the callback attributeJohannes Doerfert2019-01-191-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement Attr dumping in terms of visitorsStephen Kelly2019-01-113-35/+73
| | | | | | | | | | | | | | Remove now-vestigial dumpType and dumpBareDeclRef methods. The old tablegen generated code used to expect them to be present, but the new generated code has no such requirement. Reviewers: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D55492 llvm-svn: 350958
* [Bug 39548][Clang] PGO bootstrap fails with python3: errors in perf-helper.pySerge Guelton2019-01-111-2/+2
| | | | | | | | | | | Current clang fail to bootstrap in PGO mode when only python3 is available, because perf-helper.py is not compatible with python3. Commited on behalf of Romain Geissler. Differential Revision: https://reviews.llvm.org/D54071 llvm-svn: 350955
* Have MSVC Visualizer for DeducedTemplateSpecializationType show both the ↵Mike Spertus2019-01-061-13/+24
| | | | | | | | | | | | | | | | | | original template and deduced specialization Now appears in the Autos window something like - MyType DeducedTemplateSpecializationType {struct Y<int>} |- Template template<typename T> struct Y; |- Deduced As struct Y<int> |- isDeduced true bool |- TypeClass DeducedTemplateSpecialization (36) |- Flags No TypeBits set beyond TypeClass |- Canonical RecordType {struct Y<int>} Also changed QualType visualization to auto-expand the BaseType llvm-svn: 350487
* Fix MSVC Visualization for TemplateTypeParmType and TemplateTypeParmDeclMike Spertus2019-01-051-7/+10
| | | | llvm-svn: 350482
* Improve MSVC type visualizationsMike Spertus2019-01-051-7/+47
| | | | | | | | Display TypeBits in a single line. Fix bit rot in template visualizations Rudimentary support for deduced types llvm-svn: 350470
* Fix MSVC visualizations for ActionResult and OpaquePtrMike Spertus2019-01-031-32/+8
| | | | | | | Mainly just fixing buggy code. Also removed unnecessary visualizers for specializations of OpaquePtr llvm-svn: 350371
* Portable Python script across Python versionSerge Guelton2019-01-033-3/+3
| | | | | | | | Get rid of Python version specific shebang. Differential Revision: https://reviews.llvm.org/D55207 llvm-svn: 350319
* Make clearer which clang::type subclasses have visualizersMike Spertus2018-12-311-1/+1
| | | | llvm-svn: 350182
* DeclAccessPair visualizer should be expandableMike Spertus2018-12-301-0/+4
| | | | llvm-svn: 350167
* Improving this fatal diagnostic to help checker developers figure out what's ↵Aaron Ballman2018-12-221-3/+4
| | | | | | actually gone wrong when they hit it. llvm-svn: 350004
* Switch from cast<> to dyn_cast<>.Aaron Ballman2018-12-211-2/+5
| | | | | | This avoids a potential failed assertion that is happening on someone's out-of-tree build. llvm-svn: 349940
* Allow direct navigation to static analysis checker documentation through ↵Aaron Ballman2018-12-201-1/+37
| | | | | | | | SARIF exports. This adds anchors to all of the documented checks so that you can directly link to a check by a stable name. This is useful because the SARIF file format has a field for specifying a URI to documentation for a rule and some viewers, like CodeSonar, make use of this information. These links are then exposed through the SARIF exporter. llvm-svn: 349812
* Fix errors with the Clang natvis file.Aaron Ballman2018-12-181-23/+30
| | | | | | | | This updates the FunctionProtoType visualizer to use the proper bits for determining parameter information and the DeclarationName visualizer to use the detail namespace. It also adds support for viewing newer special declaration names (like deduction guides). Patch with help of Bruno Ricci. llvm-svn: 349547
* Portable Python script across Python versionSerge Guelton2018-12-1815-15/+15
| | | | | | | | Make scripts more future-proof by importing most __future__ stuff. Differential Revision: https://reviews.llvm.org/D55208 llvm-svn: 349504
* Portable Python script across Python versionSerge Guelton2018-12-181-1/+0
| | | | | | | | commands.getoutput has been move to subprocess module in Python3 Differential Revision: https://reviews.llvm.org/D55205 llvm-svn: 349503
* Portable Python script across Python versionSerge Guelton2018-12-187-17/+16
| | | | | | | | | | | In Python3, dict.items, dict.keys, dict.values, zip, map and filter no longer return lists, they create generator instead. The portability patch consists in forcing an extra `list` call if the result is actually used as a list. `map` are replaced by list comprehension and `filter` by filtered list comprehension. Differential Revision: https://reviews.llvm.org/D55197 llvm-svn: 349501
* Portable Python script across Python versionSerge Guelton2018-12-182-4/+4
| | | | | | | | | In Python2, division between integer yields an integer, while it yields a float in Python3. Use a combination of from __future__ import division and // operator to get a portable behavior. Differential Revision: https://reviews.llvm.org/D55204 llvm-svn: 349455
* Portable Python script across Python versionSerge Guelton2018-12-1814-136/+149
| | | | | | | | Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version. Differential Revision: https://reviews.llvm.org/D55213 llvm-svn: 349454
* Portable Python script across Python versionSerge Guelton2018-12-181-2/+5
| | | | | | | | ConfigParser module has been renamed as configparser in Python3 Differential Revision: https://reviews.llvm.org/D55200 llvm-svn: 349449
* Portable Python script across Python versionSerge Guelton2018-12-183-3/+3
| | | | | | | | Replace `xrange(...)` by either `range(...)` or `list(range(...))` depending on the context. Differential Revision: https://reviews.llvm.org/D55193 llvm-svn: 349448
* Portable Python script across Python versionSerge Guelton2018-12-131-2/+5
| | | | | | | | Queue module as been renamed into queue in Python3 Differential Revision: https://reviews.llvm.org/D55202 llvm-svn: 349009
* NFC: Make this test kinder on downstream forksErik Pilkington2018-12-041-6/+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
* Portable Python script across Python versionSerge Guelton2018-12-032-2/+4
| | | | | | | | Python3 does not support type destructuring in function parameters. Differential Revision: https://reviews.llvm.org/D55198 llvm-svn: 348129
* Portable Python script across versionSerge Guelton2018-12-035-11/+11
| | | | | | | | | Have all classes derive from object: that's implicitly the default in Python3, it needs to be done explicilty in Python2. Differential Revision: https://reviews.llvm.org/D55121 llvm-svn: 348127
* Portable Python script across Python versionSerge Guelton2018-12-035-15/+15
| | | | | | | | | | | | | | Python2 supports the two following equivalent construct raise ExceptionType, exception_value and raise ExceptionType(exception_value) Only the later is supported by Python3. Differential Revision: https://reviews.llvm.org/D55195 llvm-svn: 348126
* [analyzer] Drastically simplify the tblgen files used for checkersKristof Umann2018-11-121-239/+13
| | | | | | | | | | | | Interestingly, only about the quarter of the emitter file is used, the DescFile entry hasn't ever been touched [1], and the entire concept of groups is a mystery, so I removed them. [1] http://lists.llvm.org/pipermail/cfe-dev/2018-October/059664.html Differential Revision: https://reviews.llvm.org/D53995 llvm-svn: 346680
* [AArch64] Implement FP16FML intrinsicsBryan Chan2018-10-251-0/+37
| | | | | | | | | | | | | Generate the FP16FML intrinsics into arm_neon.h (AArch64 only for now). Add two new type modifiers to NeonEmitter to handle the new prototypes. Define __ARM_FEATURE_FP16FML when +fp16fml is enabled and guard the intrinsics with the macro in arm_neon.h. Based on a patch by Gao Yiling. Differential Revision: https://reviews.llvm.org/D53633 llvm-svn: 345344
* Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.Aaron Ballman2018-10-241-9/+9
| | | | | | This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace. llvm-svn: 345132
* [analyzer] [testing] Compute data on path length, compute percentilesGeorge Karpenkov2018-10-231-0/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D52844 llvm-svn: 344990
* Remove top-level using declaration from header files, as these aliases leak.Sam McCall2018-10-121-45/+42
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53135 llvm-svn: 344337
* [analyzer] [tests] Hotfix: missing spaceGeorge Karpenkov2018-10-021-1/+1
| | | | llvm-svn: 343643
* [analyzer] [tests] Allow specifying entire -analyze-config on the command ↵George Karpenkov2018-10-021-14/+16
| | | | | | | | line, make sure it's always propagated Differential Revision: https://reviews.llvm.org/D52801 llvm-svn: 343636
* Use the container form llvm::sort(C, ...)Fangrui Song2018-09-302-3/+3
| | | | | | | | | There are a few leftovers of rC343147 that are not (\w+)\.begin but in the form of ([-[:alnum:]>.]+)\.begin or spanning two lines. Change them to use the container form in this commit. The 12 occurrences have been inspected manually for safety. llvm-svn: 343425
* [analyzer] [testing] Pass through an extra argument for specifying extra ↵George Karpenkov2018-09-271-16/+22
| | | | | | | | analyzer options Differential Revision: https://reviews.llvm.org/D52585 llvm-svn: 343158
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-263-13/+11
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* Replaces __inline by __inline__ / C89 compatibleDiogo N. Sampaio2018-09-071-2/+2
| | | | llvm-svn: 341644
* [analyzer] Remove traces of ubigraph visualizationGeorge Karpenkov2018-09-061-76/+0
| | | | | | | | | | Ubigraph project has been dead since about 2008, and to the best of my knowledge, no one was using it. Previously, I wasn't able to launch the existing binary at all. Differential Revision: https://reviews.llvm.org/D51655 llvm-svn: 341601
* Fix arm_neon.h and arm_fp16.h generation for compiling with std=c89Diogo N. Sampaio2018-09-051-2/+2
| | | | | | | | | | | | | | | | | Summary: The inline attribute is not valid for C standard 89. Replace the argument in the generation of header files with __inline, as well adding tests for both header files. Reviewers: pbarrio, SjoerdMeijer, javed.absar, t.p.northover Subscribers: t.p.northover, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D51683 test/Headers/arm-fp16-header.c test/Headers/arm-neon-header.c utils/TableGen/NeonEmitter.cpp llvm-svn: 341475
* Update FIXME as requested in code review.Richard Smith2018-08-301-1/+2
| | | | llvm-svn: 341100
* Improve attribute documentation to list which spellings are used in which ↵Richard Smith2018-08-301-79/+86
| | | | | | | | | | | | | | | | | | | | | | | | | syntaxes. Summary: Instead of listing all the spellings (including attribute namespaces) in the section heading, only list the actual attribute names there, and list the spellings in the supported syntaxes table. This allows us to properly describe things like [[fallthrough]], for which we allow a clang:: prefix in C++ but not in C, and AlwaysInline, which has one spelling as a GNU attribute and a different spelling as a keyword, without needing to repeat the syntax description in the documentation text. Sample rendering: https://pste.eu/p/T1ZV.html Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51473 llvm-svn: 341097
* Adjust Attr representation so that changes to documentation don't affectRichard Smith2018-08-301-12/+8
| | | | | | | | | | | | | | | | | how we parse source code. Instead of implicitly opting all undocumented attributes out of '#pragma clang attribute' support, explicitly opt them all out and remove the documentation check from TableGen. (No new attributes should be added without documentation, so this has little chance of backsliding. We already support the pragma on one undocumented attribute, so we don't even want to enforce our old "rule".) No functionality change intended. llvm-svn: 341009
* Fix typoStephen Kelly2018-08-231-1/+1
| | | | llvm-svn: 340586
* [clang-tblgen] Add -print-records and -dump-json modes.Simon Tatham2018-08-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | Currently, if clang-tblgen is run without a mode option, it defaults to the first mode in its 'enum Action', which happens to be -gen-clang-attr-classes. I think it makes more sense for it to behave the same way as llvm-tblgen, i.e. print a diagnostic dump if it's not given any more specific instructions. I've also added the same -dump-json that llvm-tblgen supports. This means any tblgen command line (whether llvm- or clang-) can be mechanically turned into one that processes the same input into JSON. Reviewers: nhaehnle Reviewed By: nhaehnle Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50771 llvm-svn: 340390
* Model type attributes as regular Attrs.Richard Smith2018-08-201-0/+2
| | | | | | | | | | | | | | Specifically, AttributedType now tracks a regular attr::Kind rather than having its own parallel Kind enumeration, and AttributedTypeLoc now holds an Attr* instead of holding an ad-hoc collection of Attr fields. Differential Revision: https://reviews.llvm.org/D50526 This reinstates r339623, reverted in r339638, with a fix to not fail template instantiation if we instantiate a QualType with no associated type source information and we encounter an AttributedType. llvm-svn: 340215
* Revert r339623 "Model type attributes as regular Attrs."Reid Kleckner2018-08-141-2/+0
| | | | | | | | This breaks compiling atlwin.h in Chromium. I'm sure the code is invalid in some way, but we put a lot of work into accepting it, and I'm sure rejecting it was not an intended consequence of this refactoring. :) llvm-svn: 339638
* Model type attributes as regular Attrs.Richard Smith2018-08-131-0/+2
| | | | | | | | | | Specifically, AttributedType now tracks a regular attr::Kind rather than having its own parallel Kind enumeration, and AttributedTypeLoc now holds an Attr* instead of holding an ad-hoc collection of Attr fields. Differential Revision: https://reviews.llvm.org/D50526 llvm-svn: 339623
* Implement diagnostic stream operator for ParsedAttr.Erich Keane2018-08-091-1/+1
| | | | | | | | | | | | | As a part of attempting to clean up the way attributes are printed, this patch adds an operator << to the diagnostics/ partialdiagnostics so that ParsedAttr can be sent directly. This patch also rewrites a large amount* of the times when ParsedAttr was printed using its IdentifierInfo object instead of being printed itself. *"a large amount" == "All I could find". llvm-svn: 339344
* [analyzer] [tests] Do not be verbose by default when updating reference results.George Karpenkov2018-08-071-1/+1
| | | | llvm-svn: 339183
* revert r338831 - Fix unused variable warning in tablegen generated codeErich Keane2018-08-031-8/+4
| | | | | | No longer necessary thanks to r338889 (and friends). llvm-svn: 338893
OpenPOWER on IntegriCloud