summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-inline asm] Add a very simple test case. Basically, we're only testing forChad Rosier2012-08-081-0/+6
| | | | | | crashers at the moment (and coincidentally this case was causing a crash). llvm-svn: 161520
* [ms-inline asm] Refactor the logic to generate the AsmString into Sema. NoChad Rosier2012-08-081-5/+31
| | | | | | functional change intended. llvm-svn: 161518
* [ms-inline asm] Add support for detecting simple ms-style inline asm. SimpleChad Rosier2012-08-081-2/+104
| | | | | | | | | | | asm statements are those that don't reference variable names, function names, and labels. Add logic to generate a patched AsmString that will eventually be consumed by the AsmParser. No functional change at this point, so unfortunately no test case. llvm-svn: 161508
* Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.Chad Rosier2012-08-081-1/+2
| | | | llvm-svn: 161503
* [ms-inline asm] Stmt destructors are never called, so allocate the AsmToks usingChad Rosier2012-08-071-1/+1
| | | | | | the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface. llvm-svn: 161373
* [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functionalChad Rosier2012-08-061-1/+2
| | | | | | change intended. No test case as there's no real way to test at this time. llvm-svn: 161342
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-271-1/+1
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* Issue warning when assigning out-of-range integer values to enums.Fariborz Jahanian2012-07-171-0/+49
| | | | | | | Due to performance cost, this is an opt-in option placed under -Wassign-enum. // rdar://11824807 llvm-svn: 160382
* Don't try to do RVO on block variables that refer to an enclosing local.Nico Weber2012-07-111-1/+1
| | | | | | | Fixes PR13314, clang crashing on blocks refering to an enclosing local when the enclosing function returns void. llvm-svn: 160089
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-5/+3
| | | | llvm-svn: 159925
* objective-c++11: extend c++11 range-based loop to iterateFariborz Jahanian2012-07-061-0/+12
| | | | | | over objective-c container collection. // rdar://9293227 llvm-svn: 159847
* objective-c: Refactor parse/sema portion ofFariborz Jahanian2012-07-031-9/+29
| | | | | | | objective-c's fast enumeration statement, for more work to come. llvm-svn: 159689
* In blocks, only pretend that enum constants have enum type if necessary.Jordan Rose2012-07-021-44/+21
| | | | | | | | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) Thus, when a block's return type is inferred from an enum constant, it is incompatible with expressions that return the enum type. In r158899, I told block returns to pretend that enum constants have enum type, like in C++. Doug Gregor pointed out that this can break existing code. Now, we don't check the types of return statements until the end of the block. This lets us go back and add implicit casts in blocks with mixed enum constants and enum-typed expressions. <rdar://problem/11662489> (again) llvm-svn: 159591
* Pretend that enum constants have enum type when inferring a block return type.Jordan Rose2012-06-211-3/+25
| | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) This leads to odd warnings when returning enum constants directly in blocks with inferred return types. The easiest way out of this is to pretend that, like C++, enum constants have enum type when being returned from a block. <rdar://problem/11662489> llvm-svn: 158899
* Whitespace.Chad Rosier2012-06-201-16/+14
| | | | llvm-svn: 158837
* [ms-style asm] Change the fatal error to an extension warning. Apparently, thisChad Rosier2012-06-201-0/+3
| | | | | | | error was asserting on anything that included Windows.h. MS-style inline asm is still dropped, but at least now we're not completely silent about it. llvm-svn: 158833
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-0/+9
| | | | llvm-svn: 158325
* Remove a commented out variable declaration. This was originally a debuggingRichard Trieu2012-06-081-1/+0
| | | | | | variable which wasn't removed when the original patch was committed. llvm-svn: 158225
* Revert Decl's iterators back to pointer value_type rather than reference ↵David Blaikie2012-06-061-1/+1
| | | | | | | | | | | | | | value_type In addition, I've made the pointer and reference typedef 'void' rather than T* just so they can't get misused. I would've omitted them entirely but std::distance likes them to be there even if it doesn't use them. This rolls back r155808 and r155869. Review by Doug Gregor incorporating feedback from Chandler Carruth. llvm-svn: 158104
* Remove unused private member variables found by clang's new ↵Benjamin Kramer2012-06-061-6/+3
| | | | | | -Wunused-private-field. llvm-svn: 158086
* Add a warning to diagnose statements in C++ like "*(volatile int*)x;". ↵Eli Friedman2012-05-241-2/+8
| | | | | | Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>. llvm-svn: 157362
* Use a llvm::SmallString rather than std::string for duplicate-case errorsDouglas Gregor2012-05-161-4/+6
| | | | llvm-svn: 156922
* Produce more useful 'duplicate case' diagnostics. Fixes PR9243, from Terry Long!Douglas Gregor2012-05-161-2/+23
| | | | llvm-svn: 156904
* PR12826: Converting an lvalue to an xvalue is a no-op conversion, not an ↵Richard Smith2012-05-151-4/+2
| | | | | | lvalue-to-rvalue conversion. llvm-svn: 156803
* Bind cleanups after doing l2r conversion on the operand of aJohn McCall2012-05-081-4/+2
| | | | | | | | @throw expression; l2r conversion can introduce new cleanups in certain cases, like when the expression is an ObjC property reference of retainable type in ARC. llvm-svn: 156425
* Move Sema::VerifyIntegerConstantExpression() andDouglas Gregor2012-05-041-9/+49
| | | | | | | | Sema::ConvertToIntegralOrEnumerationType() from PartialDiagnostics to abstract "diagnoser" classes. Not much of a win here, but we're -several PartialDiagnostics. llvm-svn: 156217
* Move Sema::RequireCompleteType() and Sema::RequireCompleteExprType()Douglas Gregor2012-05-041-4/+4
| | | | | | | | | | | off PartialDiagnostic. PartialDiagnostic is rather heavyweight for something that is in the critical path and is rarely used. So, switch over to an abstract-class-based callback mechanism that delays most of the work until a diagnostic is actually produced. Good for ~11k code size reduction in the compiler and 1% speedup in -fsyntax-only on the code in <rdar://problem/11004361>. llvm-svn: 156176
* Skip checking for infinite for-loops if there are global or static variablesRichard Trieu2012-05-041-2/+3
| | | | | | in the conditional. llvm-svn: 156148
* Add -Wloop-analysis. This warning will fire on for loops which the variablesRichard Trieu2012-04-301-0/+216
| | | | | | in the loop conditional do not change. llvm-svn: 155835
* Remove the ref/value inconsistency in filter_decl_iterator.David Blaikie2012-04-301-1/+1
| | | | | | | | | | | | | filter_decl_iterator had a weird mismatch where both op* and op-> returned T* making it difficult to generalize this filtering behavior into a reusable library of any kind. This change errs on the side of value, making op-> return T* and op* return T&. (reviewed by Richard Smith) llvm-svn: 155808
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-1/+10
| | | | | | | | | 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
* Handle placeholder expressions in an ObjC for-collection loop.John McCall2012-03-301-3/+11
| | | | | | | The way we handle this implicitly removes the ability to use property l-values in this position, but that's really okay. llvm-svn: 153729
* Make sure we perform the relevant implied conversions correctly for ObjC ↵Eli Friedman2012-03-301-18/+19
| | | | | | methods with related result types. PR12384. llvm-svn: 153716
* For enums with no tag name, display its location in Fariborz Jahanian2012-03-211-3/+3
| | | | | | | the diagnostic instead of displaying ''. // rdar://11082110 llvm-svn: 153219
* fixes the diagnostic issued in // rdar://11069896Fariborz Jahanian2012-03-211-1/+1
| | | | llvm-svn: 153217
* Allow void blocks to return witn a void expression in Fariborz Jahanian2012-03-211-2/+7
| | | | | | | c-mode to match behavior with void functions in c. Issue warning with -pedantic. // rdar://11069896 llvm-svn: 153200
* Undo previous patch as I checked more than I intended.Fariborz Jahanian2012-03-211-7/+2
| | | | llvm-svn: 153193
* modern objective-c rewriter: remove 'const' fromFariborz Jahanian2012-03-211-2/+7
| | | | | | | pointer field declarations in several meta-data. // rdar://11079898 llvm-svn: 153192
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-18/+18
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-2/+6
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Doug's review comments.Sebastian Redl2012-02-221-1/+1
| | | | llvm-svn: 151173
* Fix parsing and processing initializer lists in return statements and as ↵Sebastian Redl2012-02-221-3/+24
| | | | | | direct member initializers. llvm-svn: 151155
* Specialize noreturn diagnostics for lambda expressions.Douglas Gregor2012-02-151-2/+8
| | | | llvm-svn: 150586
* Fix silly precedence error.Douglas Gregor2012-02-151-1/+1
| | | | llvm-svn: 150585
* Specialize the diagnostic complaining about conflicting types ofDouglas Gregor2012-02-151-2/+2
| | | | | | | return statements within a lambda; this diagnostic previously referred to blocks. llvm-svn: 150584
* Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)Dmitri Gribenko2012-02-141-15/+38
| | | | | | | | | | | | | | * if, switch, range-based for: warn if semicolon is on the same line. * for, while: warn if semicolon is on the same line and either next statement is compound statement or next statement has more indentation. Replacing the semicolon with {} or moving the semicolon to the next line will always silence the warning. Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp. llvm-svn: 150515
* Don't allow deduction of a lambda result type from an initializerDouglas Gregor2012-02-091-2/+10
| | | | | | list; it is not an expression. llvm-svn: 150194
* In C++11 mode, when an integral constant expression is desired and we have aRichard Smith2012-02-041-6/+8
| | | | | | | | | | | | | | | | | | value of class type, look for a unique conversion operator converting to integral or unscoped enumeration type and use that. Implements [expr.const]p5. Sema::VerifyIntegerConstantExpression now performs the conversion and returns the converted result. Some important callers of Expr::isIntegralConstantExpr have been switched over to using it (including all of those required for C++11 conformance); this switch brings a side-benefit of improved diagnostics and, in several cases, simpler code. However, some language extensions and attributes have not been moved across and will not perform implicit conversions on constant expressions of literal class type where an ICE is required. In passing, fix static_assert to perform a contextual conversion to bool on its argument. llvm-svn: 149776
* Don't allow a value of a scoped enumeration to be used as the first bound for anRichard Smith2012-02-041-1/+2
| | | | | | | array new expression. This lays some groundwork for the implicit conversion to integral or unscoped enumeration which C++11 ICEs undergo. llvm-svn: 149772
* Make sure we call MaybeCreateExprWithCleanups for the sub-expression of an ↵Eli Friedman2012-01-311-0/+1
| | | | | | indirect goto. llvm-svn: 149441
OpenPOWER on IntegriCloud