summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Use ranges to concisely express iterationDavid Majnemer2016-06-231-2/+2
| | | | | | | No functional change is intended, this should just clean things up a little. llvm-svn: 273522
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | llvm-svn: 272233
* Work around MinGW's macro definition of 'interface' to 'struct'Reid Kleckner2016-05-311-0/+5
| | | | | | | | | | | Previous attempts to rename the IBOutletCollection argument to something other than "Interface" were undone (r127127 and r139620). Instead of renaming it, work around this in tablegen, so the public facing getter can have the usual name of 'getInterface'. Fixes PR26682 llvm-svn: 271305
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-272-8/+10
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Turn copies into references as suggested by clang-tidy's ↵Benjamin Kramer2016-05-271-6/+7
| | | | | | performance-unnecessary-copy-initialization. llvm-svn: 270994
* Fix use-after-free ASan failures for modules / PCH files that deserialize ↵Richard Smith2016-05-181-7/+33
| | | | | | abi_tag or no_sanitize attributes. llvm-svn: 269869
* Fix Clang-tidy modernize-use-bool-literals in generated code.Eugene Zelenko2016-05-121-16/+118
| | | | | | | | | | Reduce space in empty constructors and between data members and first public section. Fix some Include What You Use warnings. Differential revision: http://reviews.llvm.org/D20213 llvm-svn: 269371
* Revert unnecessary tblgen change.Peter Collingbourne2016-04-271-1/+0
| | | | llvm-svn: 267788
* Rework interface for bitset-using features to use a notion of LTO visibility.Peter Collingbourne2016-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bitsets, and the compiler features they rely on (vtable opt, CFI), only have visibility within the LTO'd part of the linkage unit. Therefore, only enable these features for classes with hidden LTO visibility. This notion is based on object file visibility or (on Windows) dllimport/dllexport attributes. We provide the [[clang::lto_visibility_public]] attribute to override the compiler's LTO visibility inference in cases where the class is defined in the non-LTO'd part of the linkage unit, or where the ABI supports calling classes derived from abstract base classes with hidden visibility in other linkage units (e.g. COM on Windows). If the cross-DSO CFI mode is enabled, bitset checks are emitted even for classes with public LTO visibility, as that mode uses a separate mechanism to cause bitsets to be exported. This mechanism replaces the whole-program-vtables blacklist, so remove the -fwhole-program-vtables-blacklist flag. Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the support for the special attr:uuid blacklist entry is removed. Differential Revision: http://reviews.llvm.org/D18635 llvm-svn: 267784
* Re-commit r265518 ("[modules] Continue factoring encoding of AST records out ofRichard Smith2016-04-061-14/+11
| | | | | | | ASTWriter."), reverted in r265526, with a fix for an iterator invalidation bug (thanks, MSan!). llvm-svn: 265564
* Revert "[modules] Continue factoring encoding of AST records out of ASTWriter."Dmitry Polukhin2016-04-061-11/+14
| | | | | | This reverts commit r265518. llvm-svn: 265526
* [modules] Continue factoring encoding of AST records out of ASTWriter.Richard Smith2016-04-061-14/+11
| | | | llvm-svn: 265518
* Add an optional string argument to DeprecatedAttr for Fix-It.Manman Ren2016-03-161-0/+11
| | | | | | | | We only add this to __attribute__((deprecated)). Differential Revision: http://reviews.llvm.org/D17865 llvm-svn: 263652
* Print strict in Availability attribute when it is on.Manman Ren2016-03-101-0/+1
| | | | llvm-svn: 263172
* P0188R1: add support for standard [[fallthrough]] attribute. This is almostRichard Smith2016-03-081-0/+2
| | | | | | | | | | | | | | exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check. In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting. llvm-svn: 262881
* Semantic analysis for the swiftcall calling convention.John McCall2016-03-031-1/+2
| | | | | | | I've tried to keep the infrastructure behind parameter ABI treatments fairly general. llvm-svn: 262587
* Add an llvm_unreachable back to the autogeneration of this covered switch.John McCall2016-03-011-1/+2
| | | | llvm-svn: 262288
* Infrastructure improvements to Clang attribute TableGen.John McCall2016-03-011-82/+198
| | | | | | This should make it easier to add new Attr subclasses. llvm-svn: 262275
* Fix a leak in the generated code for attributes with strings.Benjamin Kramer2016-02-131-4/+17
| | | | | | | | Storing std::strings in attributes simply doesn't work, we never call the destructor. Use an array of StringRefs instead of std::strings and copy the data into memory taken from the ASTContext. llvm-svn: 260831
* No need to use utostr when putting integers into a raw_ostream. NFCCraig Topper2016-01-311-5/+5
| | | | llvm-svn: 259310
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* [TableGen] Merge the SuperClass Record and SMRange vector a single vector. ↵Craig Topper2016-01-183-18/+17
| | | | | | This removes the state needed to manage the extract vector. NFC llvm-svn: 258066
* [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects ↵Craig Topper2016-01-041-0/+3
| | | | | | in the support library will be deleted. llvm-svn: 256731
* Use range loops and autos in utils/TableGen/ClangAttrEmitter.cpp and ↵Eugene Zelenko2015-12-081-21/+17
| | | | | | | | generated code. Differential revision: http://reviews.llvm.org/D15313 llvm-svn: 255042
* Do not crash when dumping the objc_bridge_related attribute when its ↵Aaron Ballman2015-11-301-0/+2
| | | | | | | | optional arguments are not supplied. Patch thanks to Joe Ranieri! llvm-svn: 254303
* Add the ability to define "fake" arguments on attributes.John McCall2015-10-281-67/+98
| | | | | | | | | | | | | | Fake arguments are automatically handled for serialization, cloning, and other representational tasks, but aren't included in pretty-printing or parsing (should we eventually ever automate that). This is chiefly useful for attributes that can be written by the user, but which are also frequently synthesized by the compiler, and which we'd like to remember details of the synthesis for. As a simple example, use this to narrow the cases in which we were generating a specialized note for implicitly unavailable declarations. llvm-svn: 251469
* [ATTR] Automatic line feed after pragma-like attribute.Alexey Bataev2015-10-121-0/+1
| | | | | | | Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations. Differential Revision: http://reviews.llvm.org/D13546 llvm-svn: 250017
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-061-4/+5
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Fix Clang-tidy modernize-use-nullptr warnings in headers and generated ↵Hans Wennborg2015-09-292-6/+5
| | | | | | | | | | files; other minor cleanups. By Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13187 llvm-svn: 248828
* [ARM NEON] Remove special-case for f16 vcvt handling. NFCI.Ahmed Bougacha2015-08-221-4/+0
| | | | | | | | We can use the 'H' typespec modifier to use 128-bit vectors directly in the only two users of this special-case: the vcvt f16 intrinsics. This also lets us use more meaningful prototype modifiers. llvm-svn: 245778
* [ARM NEON] Use the common naming scheme for vcvt f16 builtins. NFC.Ahmed Bougacha2015-08-211-2/+2
| | | | | | | | | | | We had "vcvt_f16" and "VCVT_HIGH_F16": for other FP types, this naming is used for intrinsics with integer overloads. The FP->FP conversions, on the other hand, use the full "vcvt_f32_f64" name instead. Use the same naming convention for the f16<->f32 conversions. While there, reorder the definitions a little bit. llvm-svn: 245763
* [ARM NEON] Factor out FP-prototype checking. NFC.Ahmed Bougacha2015-08-211-5/+9
| | | | llvm-svn: 245761
* Fix memory ownership in the NeonEmitter by using values instead of pointers ↵David Blaikie2015-08-061-37/+30
| | | | | | | | | | | | | (smart or otherwise) Improvement to the memory leak fix in 244196. Address validity is required for the Intrinsic objects, but since the collections only ever grow (no elements are removed), deque provides sufficient guarantees (that the objects will never be reallocated/moved around) for this use case. llvm-svn: 244241
* Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.Yaron Keren2015-08-061-0/+6
| | | | llvm-svn: 244196
* [UB] Guard two calls to memcpy in generated attribute code to handleChandler Carruth2015-08-041-2/+4
| | | | | | | | null StringRef objects as inputs. Found by UBSan. llvm-svn: 243949
* Fix -Wextra-semi warnings.Hans Wennborg2015-07-221-1/+1
| | | | | | | | Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D11401 llvm-svn: 242931
* Refactor TableGen backend for ClangAttrEmitter to avoid duplication.Bob Wilson2015-07-201-89/+63
| | | | | | | | GenerateHasAttrSpellingStringSwitch and GenerateTargetRequirements had duplicated code to check the conditions for target-specific attributes. Refactor the duplicated code into a separate function. NFC. llvm-svn: 242731
* Ignore the "novtable" declspec when not using the Microsoft C++ ABI.Bob Wilson2015-07-201-3/+36
| | | | | | | | | | | | | | Clang used to silently ignore __declspec(novtable). It is implemented now, but leaving the vtable uninitialized does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so this changes clang to simply ignore novtable when not using the Microsoft C++ ABI. llvm-svn: 242730
* [TableGen] Change a couple methods to return an ArrayRef instead of a const ↵Craig Topper2015-07-061-2/+2
| | | | | | std::vector reference. NFC llvm-svn: 241431
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-223-3/+3
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-223-3/+3
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Check for consistent use of nullability type specifiers in a header.Douglas Gregor2015-06-191-1/+2
| | | | | | | | | | | | | | | | | Adds a new warning (under -Wnullability-completeness) that complains about pointer, block pointer, or member pointer declarations that have not been annotated with nullability information (directly or inferred) within a header that contains some nullability annotations. This is intended to be used to help maintain the completeness of nullability information within a header that has already been audited. Note that, for performance reasons, this warning will underrepresent the number of non-annotated pointers in the case where more than one pointer is seen before the first nullability type specifier, because we're only tracking one piece of information per header. Part of rdar://problem/18868820. llvm-svn: 240158
* [CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.Ahmed Bougacha2015-06-041-8/+24
| | | | | | | | | | | | | | | | | On ARM/AArch64, we currently always use EmitScalarExpr for the immediate builtin arguments, instead of directly emitting the constant. When the overflow sanitizer is enabled, this generates overflow intrinsics instead of constants, breaking assumptions in various places. Instead, use the knowledge of "immediates" to directly emit a constant: - teach the tablegen backend to emit the "immediate" modifiers - use those modifiers in the NEON CodeGen, on ARM and AArch64. Fixes PR23517. Differential Revision: http://reviews.llvm.org/D10045 llvm-svn: 239002
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-294-9/+7
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* Implement no_sanitize attribute.Peter Collingbourne2015-05-151-0/+14
| | | | | | Differential Revision: http://reviews.llvm.org/D9631 llvm-svn: 237463
* [TableGen] Clang changes for r235697 to stop leaking Expanders and Operators ↵Craig Topper2015-04-241-8/+7
| | | | | | in SetTheory. llvm-svn: 235698
* Implement target-specific __attribute__((aligned)) valueUlrich Weigand2015-04-211-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GCC construct __attribute__((aligned)) is defined to set alignment to "the default alignment for the target architecture" according to the GCC documentation: The default alignment is sufficient for all scalar types, but may not be enough for all vector types on a target that supports vector operations. The default alignment is fixed for a particular target ABI. clang currently hard-coded an alignment of 16 bytes for that construct, which is correct on some platforms (including X86), but wrong on others (including SystemZ). Since this value is ABI-relevant, it is important to get correct for compatibility purposes. This patch adds a new TargetInfo member "DefaultAlignForAttributeAligned" that targets can set to the appropriate default __attribute__((aligned)) value. Note that I'm deliberately *not* using the existing "SuitableAlign" value, which is used to set the pre-defined macro __BIGGEST_ALIGNMENT__, since those two values may not be the same on all platforms. In fact, on X86, __attribute__((aligned)) always uses 16-byte alignment, while __BIGGEST_ALIGNMENT__ may be larger if AVX-2 or AVX-512 are supported. (This is actually not yet correctly implemented in clang either.) The patch provides a value for DefaultAlignForAttributeAligned only for SystemZ, and leaves the default for all other targets at 16, which means no visible change in behavior on all other targets. (The value is still wrong for some other targets, but I'd prefer to leave it to the target maintainers for those platforms to fix.) llvm-svn: 235397
* Remove empty non-virtual destructors or mark them =default when non-publicBenjamin Kramer2015-04-111-8/+0
| | | | | | These add no value but can make a class non-trivially copyable. NFC. llvm-svn: 234689
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-15/+15
| | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix Reviewers: dblaikie Reviewed By: dblaikie Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D8926 llvm-svn: 234678
* [tblgen] Use StringRef::trimBenjamin Kramer2015-04-101-24/+5
| | | | llvm-svn: 234643
OpenPOWER on IntegriCloud