summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmtAttr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix PR20069: bad loop pragma arguments crash FEEli Bendersky2014-06-191-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a crash when handling malformed arguments to loop pragmas such as: "#pragma clang loop vectorize(()". Essentially any argument which is not an identifier or constant resulted in a crash. This patch also changes a couple of the error messages which weren't quite correct. New behavior with this patch vs old behavior: #pragma clang loop vectorize(1) OLD: error: missing keyword; expected 'enable' or 'disable' NEW: error: invalid argument; expected 'enable' or 'disable' #pragma clang loop vectorize() OLD: error: expected ')' NEW: error: missing argument to loop pragma 'vectorize' #pragma clang loop vectorize_width(bad) OLD: error: missing value; expected a positive integer value NEW: error: invalid argument; expected a positive integer value #pragma clang loop vectorize(bad) OLD: invalid keyword 'bad'; expected 'enable' or 'disable' NEW: error: invalid argument; expected 'enable' or 'disable' http://reviews.llvm.org/D4197 Patch by Mark Heffernan llvm-svn: 211292
* Explicitly initialize all fields to avoid -Wmissing-field-initializers warning.Eli Bendersky2014-06-121-5/+6
| | | | llvm-svn: 210791
* Add loop unroll pragma supportEli Bendersky2014-06-111-53/+60
| | | | | | | | http://reviews.llvm.org/D4089 Patch by Mark Heffernan. llvm-svn: 210667
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-071-1/+1
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. llvm-svn: 210403
* Fix DOS-style newlines.Eli Bendersky2014-06-061-181/+181
| | | | | | | | | A previous patch r210330 (and possibly another) introduced DOS-style newlines into a UNIX newline formatted file. Patch by Mark Heffernan (http://reviews.llvm.org/D4046) llvm-svn: 210369
* Replacing r210333 with an improved solution; we should never reach this code ↵Aaron Ballman2014-06-061-2/+3
| | | | | | with any other loop hint options. llvm-svn: 210338
* Quieting a false-positive which was causing the sanitizer bots to go red.Aaron Ballman2014-06-061-1/+1
| | | | llvm-svn: 210333
* Adding a new #pragma for the vectorize and interleave optimization hints.Aaron Ballman2014-06-061-25/+180
| | | | | | Patch thanks to Tyler Nowicki! llvm-svn: 210330
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-4/+4
| | | | llvm-svn: 209613
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-3/+1
| | | | llvm-svn: 207896
* Distinguish between attributes explicitly written at the request of the ↵Aaron Ballman2014-01-161-1/+2
| | | | | | | | 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
* Removing the notion of TargetAttributesSema and replacing it with one where ↵Aaron Ballman2014-01-091-1/+0
| | | | | | 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
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-191-2/+2
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* Improve C++11 attribute parsing.Michael Han2012-10-031-2/+7
| | | | | | | | - General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST. - Add support to parse arguments of attributes that in 'gnu' namespace. - Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic. llvm-svn: 165082
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-1/+1
| | | | llvm-svn: 159925
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-1/+1
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-1/+1
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-1/+1
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Handle C++11 attribute namespaces automatically.Alexis Hunt2012-06-181-1/+1
| | | | | | | | Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
* Add -Wimplicit-fallthrough warning flag, which warns on fallthrough betweenRichard Smith2012-05-031-4/+30
| | | | | | | | | | | | cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the case of intentional fallthrough. Patch by Alexander Kornienko! The handling of C++11 attribute namespaces in this patch is temporary, and will be replaced with a cleaner mechanism in a subsequent patch. llvm-svn: 156086
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-0/+48
attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! llvm-svn: 154723
OpenPOWER on IntegriCloud