summaryrefslogtreecommitdiffstats
path: root/clang/utils
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplifying attribute generation with range-based for loops. No functional ↵Aaron Ballman2014-03-021-277/+187
| | | | | | changes intended. llvm-svn: 202654
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-021-1/+1
| | | | llvm-svn: 202635
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-011-12/+3
| | | | | | No functionality change. llvm-svn: 202590
* Add 'remark' diagnostic type in 'clang'Tobias Grosser2014-02-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic. A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized. This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks. This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling. llvm-svn: 202475
* ARM NEON: add _f16 support to a couple of vector-shuffling intrinsics.Tim Northover2014-02-251-5/+11
| | | | llvm-svn: 202137
* [AArch64] Change int64_t from 'long long int' to 'long int' for AArch64 target.Kevin Qin2014-02-241-3/+3
| | | | | | | | | | Most 64-bit targets define int64_t as long int, and AArch64 should make same definition to follow LP64 model. In GNU tool chain, int64_t is defined as long int for 64-bit target. So to get consistent with GNU, it's better Changing int64_t from 'long long int' to 'long int', otherwise clang will get different name mangling suffix compared with g++. llvm-svn: 202004
* Moving the documentation for the type safety checking attributes into ↵Aaron Ballman2014-02-211-1/+2
| | | | | | AttrDocs. If a custom heading is provided, do not automatically generate the alternate spelling list. This is necessary because some attributes have distinct semantic spellings and meanings, but use the same semantic attribute internally. Such attributes should have multiple elements in their documentation list, but not show all spellings. At some point, it would be nice to have a way to attach the documentation element to a specific spelling for these cases. llvm-svn: 201851
* Refactored the way attribute category headers are handled so that it is ↵Aaron Ballman2014-02-191-49/+25
| | | | | | possible to use custom categories. This allows for moving the consumable attributes (consumable, callable_when, return_typestate, etc) to be grouped together, with a content heading, like they were in the language extensions documentation. Moved the consumable attribute documentation from the language extensions into the attribute documentation table. llvm-svn: 201732
* Added a documentation category for statement attributes so that things like ↵Aaron Ballman2014-02-191-0/+6
| | | | | | clang::fallthrough can be documented. llvm-svn: 201714
* AArch64: look up EmitAArch64Scalar support before calling.Tim Northover2014-02-191-4/+12
| | | | | | | | | | | | This fixes one immediate bug where an expression with side-effects could be emitted twice during a NEON call. It also prepares the way for folding CodeGen for many of the SISD intrinsics into a table, reducing code size and hopefully increasing performance eventually ("binary search + few switch cases" should be better than "lots of switch cases"). llvm-svn: 201667
* ARM & AArch64: move struct definition outside function.Tim Northover2014-02-191-5/+5
| | | | | | | | Apparently it's not True C++. rdar://problem/16035743 still. llvm-svn: 201663
* ARM NEON: use more flexible TableGen field for defs.Tim Northover2014-02-191-85/+64
| | | | | | | | | | | | | | | | | | | | We used to have special handling for isCrypto and isA64 bits in the NeonEmitter.cpp file (it knew the former was predicated on __ARM_FEATURE_CRYPTO and the latter on __aarch64__ and went through various contortions to make sure the correct intrinsics were emitted under the correct guard. This is ugly and has obvious scalability problems (e.g. vcvtX intrinsics are needed, which are ARMv8 only but available on both, yet another category). This patch moves the #if predicate into the arm_neon.td file directly and makes NeonEmitter.cpp agnostic about what goes in there. It also deduplicates arm_neon.td so that each desired intrinsic is mentioned in just one place (necessary because of the new mechanism for creating arm_neon.h). rdar://problem/16035743 llvm-svn: 201660
* ARM & AArch64: merge the semantic checking of NEON intrinsicsTim Northover2014-02-191-93/+50
| | | | | | | | | | | | | | | | | | | | | There are two kinds of automatically generated tests for NEON intrinsics, both of which can be merged without adversely affecting users. 1. We check that a valid kind of __builtin_neon_XYZ overload is requested (e.g. we're not asking for a float32x4_t version when it only accepts integers. Since the __builtin_neon_XYZ intrinsics should only be used in arm_neon.h, relaxing this test and permitting AArch64 types for AArch32 should not cause a problem. The extra arm_neon.h definitions should be #ifdefed out anyway. 2. We check that intrinsics which take immediates are actually given compile-time constants within range. Since all NEON intrinsics should be backwards compatible, these tests should be identical on AArch64 and AArch32 anyway. This patch, therefore, merges the separate AArch64 and 32-bit checks. rdar://problem/16035743 llvm-svn: 201659
* Forcing it to be an error when there is no Documentation list specified for ↵Aaron Ballman2014-02-171-0/+11
| | | | | | an attribute. This is a bit of a (harmless) hack, but the FIXME explains why and when this hack can be removed. It's a justified hack because this prevents attribute authors from forgetting to add documentation when they add a new attribute. llvm-svn: 201524
* The default assignment operator could not be generated by all of the bots, ↵Aaron Ballman2014-02-171-11/+11
| | | | | | but it's required by std::vector to operate properly. llvm-svn: 201518
* Removing a C++11'ism to also fix the build bots.Aaron Ballman2014-02-171-2/+3
| | | | llvm-svn: 201517
* Fixing build bot breakage due to using a local type as a template argument.Aaron Ballman2014-02-171-7/+7
| | | | llvm-svn: 201516
* Implements a declarative approach to documenting individual attributes in ↵Aaron Ballman2014-02-173-1/+237
| | | | | | | | Clang via a Documentation tablegen class. Also updates the internals manual with information about how to use this new, required, documentation feature. This patch adds some very, very sparse initial documentation for some attributes. Additional effort from attribute authors is greatly appreciated. llvm-svn: 201515
* Attributes: Avoid a big useless copy in the emitterReid Kleckner2014-02-121-1/+2
| | | | llvm-svn: 201251
* Attributes: Emit enumerators in td file declaration orderReid Kleckner2014-02-121-9/+18
| | | | llvm-svn: 201246
* Whitespace cleanup (mostly stray tabs, a few not-quite-empty lines).Tim Northover2014-02-121-15/+15
| | | | llvm-svn: 201234
* ARM NEON: fix range checking on immediates.Tim Northover2014-02-121-0/+8
| | | | | | | | | | Previously, range checking on the __builtin_neon_XYZ_v Clang intrinsics didn't take account of the type actually passed to the call, which meant a request like "vext_s16(a, b, 7)" was allowed through (TableGen was conservative and allowed 0-7 for all types). This caused an assert in the backend because the lane doesn't make sense. llvm-svn: 201232
* [AArch64] Fixed vget/vset_lane_f16 implementationAna Pazos2014-02-101-17/+28
| | | | | | | | Replaced cast and vreinterepret operations with code to reinterpret bitwise the types float16_t and int16_t. llvm-svn: 201112
* MS ABI: Add support for #pragma pointers_to_membersDavid Majnemer2014-02-101-0/+3
| | | | | | | | | | | | | | | | | | | Introduce a notion of a 'current representation method' for pointers-to-members. When starting out, this is set to 'best case' (representation method is chosen by examining the class, selecting the smallest representation that would work given the class definition or lack thereof). This pragma allows the translation unit to dictate exactly what representation to use, similar to how the inheritance model keywords operate. N.B. PCH support is forthcoming. Differential Revision: http://llvm-reviews.chandlerc.com/D2723 llvm-svn: 201105
* ARM: implement support for crypto intrinsics in arm_neon.hTim Northover2014-02-031-3/+4
| | | | llvm-svn: 200708
* ARM & AArch64: share the BI__builtin_neon enum defs.Tim Northover2014-01-301-42/+9
| | | | llvm-svn: 200470
* Consolidating several table-generated files containing parser-related string ↵Aaron Ballman2014-01-293-153/+129
| | | | | | | | switches into a single file. This reduces build-related complexity by replacing four separate projects (and table-gen instantiations) with a single one. No functional changes intended. llvm-svn: 200424
* Add a new attribute meta-spelling called "GCC" -- it widens into being a GNU ↵Aaron Ballman2014-01-271-97/+119
| | | | | | | | spelling, and a CXX11 spelling with the namespace "gnu". It also sets a bit on the spelling certifying that it is known to GCC. From this, we can warn about the extension appropriately. As a consequence, the FunctionDefinition functionality is completely removed. Replacing the functionality from r199676, which didn't solve the problem as elegantly. llvm-svn: 200252
* For AArch64 Neon, fix intrinsics implementation using nested macros.Jiangning Liu2014-01-261-48/+78
| | | | llvm-svn: 200114
* Adds a getSemanticSpelling function to semantic attribute subclasses which ↵Aaron Ballman2014-01-241-39/+110
| | | | | | have a meaningful semantic spelling. Adds a sibling function to parsed attribtues (via AttributeList) for getting the semantic spelling, if one were to exist. This can be used for cleaner code that deals directly with the semantic spellings (such as the MSInheritance attribute). llvm-svn: 200041
* Since Visual Studio 2012 is the minimum version of MSVC we support, the ↵Aaron Ballman2014-01-242-391/+44
| | | | | | old-style visualizers are being removed. Adding a Natvis replacement for the debugging visualizers. llvm-svn: 200032
* If an attribute has a semantically meaningful spelling (such as ↵Aaron Ballman2014-01-221-0/+8
| | | | | | ArgumentWithTypeTagAttr or MSInheritanceAttr), display the spelling used for the attribute as part of the AST dump. This should ease debugging the AST for these attributes. Attributes without semantically meaningful spelling variations are not affected. llvm-svn: 199834
* Exposed a declarative way to specify that an attribute can be duplicated ↵Aaron Ballman2014-01-201-0/+3
| | | | | | when merging attributes on a declaration. This replaces some hard-coded functionality from Sema. llvm-svn: 199677
* Remove some hard-coded specialness for thread-safety attributes from the ↵Aaron Ballman2014-01-201-0/+22
| | | | | | parser, and made it more declarative. If an attribute is allowed to appear on a function definition when late parsed, it can now use the FunctionDefinition attribute subject. It's treated as a FunctionDecl for most purposes, except it also gets exposed on the AttributeList so that it can be used while parsing. llvm-svn: 199676
* [CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.NAKAMURA Takumi2014-01-191-1/+0
| | | | | | LLVM_*_OUTPUT_INTDIR should be available everywhere. It was my mistake when I introduced INTDIR stuff. llvm-svn: 199597
* Fix comment typosAlp Toker2014-01-181-2/+2
| | | | llvm-svn: 199563
* When generating Spelling enumeration values, do not generate identifiers in ↵Aaron Ballman2014-01-161-3/+19
| | | | | | the reserved namespace. Strip underscores as appropriate, taking care to not create duplicate identifiers. llvm-svn: 199414
* Fixing a warning that causes the sanitizer build disliked about mixing && ↵Aaron Ballman2014-01-161-3/+4
| | | | | | and ||. Since this is generated code, the && has been removed from the expression entirely. llvm-svn: 199392
* Factored some function-like type reasoning out of SemaDeclAttr and onto Decl ↵Aaron Ballman2014-01-161-4/+10
| | | | | | itself. This allows for more declarative subjects in attribute tablegen where the attribute appertains to something function-like, but not strictly a FunctionDecl. llvm-svn: 199387
* Distinguish between attributes explicitly written at the request of the ↵Aaron Ballman2014-01-161-5/+98
| | | | | | | | user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute. Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it. llvm-svn: 199378
* replace LeakSanitizerIsTurnedOffForTheCurrentProcess with ↵Kostya Serebryany2014-01-151-5/+7
| | | | | | __lsan_is_turned_off, but this time hide it under __has_feature(address_sanitizer); also include <sanitizer/lsan_interface.h> llvm-svn: 199303
* When determining the attribute's parsed kind, pay attention to the syntax ↵Aaron Ballman2014-01-131-21/+42
| | | | | | used. This fixes bugs where an attribute has differing GNU and Declspec spellings, but they are treated as the same. Eg) __declspec(aligned) when it should be __attribute__((aligned)), and __attribute__((align)) when it should be __declspec(align). llvm-svn: 199144
* reapply r198858: Disable LeakSanitizer in TableGen binaries, see PR18325; ↵Kostya Serebryany2014-01-101-0/+7
| | | | | | this time LeakSanitizerIsTurnedOffForTheCurrentProcess is used instead of __lsan_is_turned_off llvm-svn: 198922
* __has_attribute now understands target-specific attributes. So when you ask ↵Aaron Ballman2014-01-091-6/+43
| | | | | | whether an ARM target has the "interrupt" attribute, it will return true for ARM and MSP430 targets, and false for others. llvm-svn: 198897
* Removing the notion of TargetAttributesSema and replacing it with one where ↵Aaron Ballman2014-01-091-4/+113
| | | | | | the parsed attributes are responsible for knowing their target-specific nature, instead of letting Sema figure it out. This is necessary so that __has_attribute can eventually determine whether a parsed attribute applies to the given target or not. llvm-svn: 198896
* Revert "Disable LeakSanitizer in TableGen binaries, see PR18325"Alp Toker2014-01-091-7/+0
| | | | | | | | | | | To declare or define reserved identifers is undefined behaviour in standard C++. This needs to be addressed in compiler-rt before it can be used in LLVM. See the list discussion for details. This reverts commit r198858. llvm-svn: 198885
* Removing a bit of custom parsing functionality used by the thread safety ↵Aaron Ballman2014-01-093-0/+36
| | | | | | analysis APIs. Now using tablegen to determine whether an attribute's arguments should be parsed in an unevaluated context instead of relying on a separate, hard-coded list of attributes. llvm-svn: 198883
* Disable LeakSanitizer in TableGen binaries, see PR18325Kostya Serebryany2014-01-091-0/+7
| | | | llvm-svn: 198858
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-3/+3
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* This helper method isn't needed, and it's unsafe for it to use StringRef in ↵Aaron Ballman2014-01-051-33/+12
| | | | | | the first place. Replaced the unsafe code with the proper accessor. llvm-svn: 198569
OpenPOWER on IntegriCloud