summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement PR4407 - missing warnings on case value overflow,Chris Lattner2009-10-161-2/+27
| | | | | | patch by Zhanyong Wan! llvm-svn: 84259
* make the diagnostic in the 'unused result' warning more preciseChris Lattner2009-10-131-0/+19
| | | | | | about the reason, rdar://7186119. llvm-svn: 83940
* Implement -Wparentheses: warn about using assignments in contexts that requireJohn McCall2009-10-121-48/+10
| | | | | | | | | conditions. Add a fixit to insert the parentheses. Also fix a very minor possible memory leak in 'for' conditions. Fixes PR 4876 and rdar://problem/7289172 llvm-svn: 83907
* When the return type of a function is dependent, don't perform anyDouglas Gregor2009-10-011-1/+2
| | | | | | | | | | | | of the flow-control checks for falling off the end of a function, since the return type may instantiate to void. Similarly, if a return statement has an expression and the return type of the function is void, don't complain if the expression is type-dependent, since that type could instantiate to void. Fixes PR5071. llvm-svn: 83222
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-8/+5
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-98/+98
| | | | llvm-svn: 81346
* This patch does the following.Fariborz Jahanian2009-09-031-1/+9
| | | | | | | | | | | 1) Issue digsnostics in non-fragile ABI, when an expression evaluates to an interface type (except when it is used to access a non-fragile ivar). 2) Issue unsupported error in fragile ABI when an expression evaluates to an interface type (except when it is used to access a fragile ivar). llvm-svn: 80860
* Using "ObjCImplicitSetterGetterRefExpr" instead of ↵Fariborz Jahanian2009-08-201-1/+1
| | | | | | | | "ObjCImplctSetterGetterRefExpr". A field rename and more comments. llvm-svn: 79537
* Switch to SmallString::str from SmallString::c_str.Daniel Dunbar2009-08-191-4/+4
| | | | | | - Several FIXMEs due to non-Twinification of IRBuilder. llvm-svn: 79455
* Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.Fariborz Jahanian2009-08-181-1/+1
| | | | | | | | Removed an unnecessary loop to get to setters incoming argument. Added DoxyGen comments. Still more work to do in this area (WIP). llvm-svn: 79365
* Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap ↵Anders Carlsson2009-08-181-2/+6
| | | | | | the return expr inside a CXXExprWithTemporaries if needed. llvm-svn: 79342
* Improve the diagnostic emitted when an unused ObjC property getterChris Lattner2009-08-161-2/+10
| | | | | | | | | | | | is found. Instead of complaining about a generic "unused expr", emit: t.m:7:3: warning: property access result unused - getters should not have side effects While objc property getters *could* have side effects, according to the language best practices, they *shouldn't*. Hopefully the diagnostic now gets this across. llvm-svn: 79192
* objc2's foreach statement's selector type can beFariborz Jahanian2009-08-141-1/+2
| | | | | | a block pointer too. llvm-svn: 79050
* More warnings for unused expressions.Anders Carlsson2009-08-011-0/+2
| | | | llvm-svn: 77763
* Diagnose unused expression results for all statements, just not compound ↵Anders Carlsson2009-07-301-5/+17
| | | | | | statements. llvm-svn: 77631
* Factor code out into a DiagnoseUnusedExprResult function.Anders Carlsson2009-07-301-12/+20
| | | | llvm-svn: 77628
* Change uses of:Ted Kremenek2009-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Check for identical types in C++ catch expression. Patch by Erik Verbruggen.Sebastian Redl2009-07-291-5/+70
| | | | llvm-svn: 77475
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-2/+2
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.Ted Kremenek2009-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | This method is intended to eventually replace the individual Type::getAsXXXType<> methods. The motivation behind this change is twofold: 1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of them are basically copy-and-paste. 2) By centralizing the implementation of the getAs<Type> logic we can more smoothly move over to Doug Gregor's proposed canonical type smart pointer scheme. Along with this patch: a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>. b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>. llvm-svn: 76098
* Remove ASTContext::isObjCObjectPointerType().Steve Naroff2009-07-161-5/+5
| | | | | | Convert all clients to use the new predicate on Type. llvm-svn: 76076
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-301-3/+3
| | | | | | | | | The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
* Support for [class.local]p4.Anders Carlsson2009-06-241-1/+0
| | | | llvm-svn: 74030
* [class.local] p1 and p3. Also, add back the xcodeproj file.Anders Carlsson2009-06-241-0/+1
| | | | llvm-svn: 74027
* Use QualType to represent block's implicit return type asFariborz Jahanian2009-06-191-4/+11
| | | | | | to not lose its 'const/volatile' qualifier. llvm-svn: 73795
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-181-3/+3
| | | | llvm-svn: 73702
* add the location of the ')' in a do/while statement to DoStmt.Chris Lattner2009-06-121-2/+3
| | | | | | This fixes a source range problem reported by Olaf Krzikalla. llvm-svn: 73266
* Downgrade an error about "return in a no-return function" from being Chris Lattner2009-05-311-4/+2
| | | | | | | | an error to being a warning that defaults to error. If you want this to be a warning, you have to explicitly pass -Winvalid-noreturn to clang to map it back to a warning. llvm-svn: 72669
* ActOnReturnStmt should also take a FullExprArg.Anders Carlsson2009-05-301-2/+2
| | | | llvm-svn: 72641
* Use v.data() instead of &v[0] when SmallVector v might be empty.Jay Foad2009-05-211-1/+1
| | | | llvm-svn: 72210
* Make ActOnWhileStmt take a FullExprArg for the condition expr.Anders Carlsson2009-05-171-4/+5
| | | | llvm-svn: 71990
* Make ActOnExprStmt take a FullExprArg.Anders Carlsson2009-05-171-2/+2
| | | | llvm-svn: 71989
* Add the FullExprArg wrapper and use it for if statement conditions.Anders Carlsson2009-05-171-4/+6
| | | | llvm-svn: 71982
* Reflow some comments.Mike Stump2009-05-161-10/+9
| | | | llvm-svn: 71936
* Template instantiation for IndirectGotoStmt. Now my life is complete.Douglas Gregor2009-05-161-7/+9
| | | | llvm-svn: 71917
* Template instantiation for switch statementsDouglas Gregor2009-05-151-116/+141
| | | | llvm-svn: 71916
* Template instantiation for "for" loopsDouglas Gregor2009-05-151-2/+3
| | | | llvm-svn: 71901
* Template instantiation for do-while statements.Douglas Gregor2009-05-151-11/+15
| | | | llvm-svn: 71899
* Template instantiation for WhileStmt and CXXConditionDeclExpr.Douglas Gregor2009-05-151-11/+13
| | | | llvm-svn: 71896
* Template instantiation for "if" statements. Also:Douglas Gregor2009-05-151-12/+15
| | | | | | | | - Skip semantic analysis of the "if" condition if it is type-dependent. - Added the location of the "else" keyword into IfStmt, so that we can provide it for type-checking after template instantiation. llvm-svn: 71875
* Instantiate return statements.Anders Carlsson2009-05-151-1/+1
| | | | llvm-svn: 71825
* allow references to the larger value in a tied constraintChris Lattner2009-05-031-12/+28
| | | | | | from the asm string, but reject references to the smaller one. llvm-svn: 70679
* code cleanup, avoid shadowing i.Chris Lattner2009-05-031-4/+5
| | | | llvm-svn: 70678
* Don't insert an extra ParenExpr around asm operands.Eli Friedman2009-05-031-9/+8
| | | | llvm-svn: 70673
* If we have mismatched integer tied operands, but the operandChris Lattner2009-05-031-1/+20
| | | | | | | | number is not mentioned in the asm string, let it past sema. Right now these are currently rejected by the llvm code generator but this will be fixed next. llvm-svn: 70670
* avoid a crash when we encounter a implicit cast of the paren expr due toChris Lattner2009-05-031-2/+2
| | | | | | | promotions. This should be fixed by not modeling asm operands (which require the ()'s according to the grammar) as not being paren exprs. llvm-svn: 70668
* rename some variables, improve comments.Chris Lattner2009-05-031-9/+12
| | | | llvm-svn: 70663
* refactor matched operand type checking to happen after the AsmStmt is created,Chris Lattner2009-05-031-17/+35
| | | | | | no functionality change. llvm-svn: 70662
* Replace more release+static_cast with takeAs.Anders Carlsson2009-05-011-17/+16
| | | | llvm-svn: 70567
* Replace a bunch of static_cast + release with takeAs.Anders Carlsson2009-05-011-8/+8
| | | | llvm-svn: 70566
OpenPOWER on IntegriCloud