summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the SmallVectors from AsmStmt. Fixes PR6105.Anders Carlsson2010-01-301-3/+3
| | | | llvm-svn: 94926
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-301-3/+11
| | | | llvm-svn: 94925
* Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.Anders Carlsson2010-01-301-6/+3
| | | | llvm-svn: 94918
* StringRef-ize the TargetInfo::ConstraintInfo constructor.Anders Carlsson2010-01-301-5/+2
| | | | llvm-svn: 94916
* Get rid of another old PerformCopyInitialization call.Anders Carlsson2010-01-291-4/+12
| | | | llvm-svn: 94819
* Implement instantiation of AsmStmts (Crazy, I know)Anders Carlsson2010-01-241-1/+5
| | | | llvm-svn: 94361
* fix PR6034, a crash on invalid where the switch stack would get Chris Lattner2010-01-241-0/+10
| | | | | | unbalanced. llvm-svn: 94347
* Give UnresolvedSet the ability to store access specifiers for each declaration.John McCall2010-01-201-2/+2
| | | | | | | Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its own header and make it templated over an inline capacity. llvm-svn: 93959
* Implement goto inside of blocks.Mike Stump2010-01-191-4/+0
| | | | llvm-svn: 93945
* Remember if the AsmStmt came from Microsoft-style inline assembly code.Mike Stump2010-01-041-4/+5
| | | | llvm-svn: 92526
* Remove some dead variables clang-analyzer found.Benjamin Kramer2009-12-251-1/+0
| | | | llvm-svn: 92162
* Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't ↵Douglas Gregor2009-12-221-29/+1
| | | | | | use the location information but we did spend a bunch of time building faked-up TypeLocs llvm-svn: 91905
* fix PR4010: add support for the warn_unused_result for function pointersNuno Lopes2009-12-201-1/+1
| | | | llvm-svn: 91803
* Try to de-bork DISABLE_SMART_POINTERS buildDouglas Gregor2009-12-181-7/+7
| | | | llvm-svn: 91696
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
* Fix semantic diagnostics that embed English works, from Nicola Gigante!Douglas Gregor2009-12-161-3/+3
| | | | llvm-svn: 91503
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-151-3/+3
| | | | llvm-svn: 91450
* Fix a thinko where we weren't always performing unary conversions on the ↵Douglas Gregor2009-11-251-4/+4
| | | | | | switch condition, fixing PR5612 llvm-svn: 89864
* When the condition of a switch() statement is semantically invalid,Douglas Gregor2009-11-251-6/+7
| | | | | | | still parse the body of the switch to try to avoid spurious diagnostics. Fixes PR5606. llvm-svn: 89847
* Refactor ActOnFinishSwitchStmt to simplify it furtherDouglas Gregor2009-11-251-14/+6
| | | | llvm-svn: 89843
* Refactor ActOnFinishSwitchStmt to simplify and reduce nestingDouglas Gregor2009-11-251-93/+106
| | | | llvm-svn: 89842
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-47/+62
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-241-1/+11
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-241-1/+11
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-231-2/+11
| | | | | | | | | rather than burying it in a CXXConditionDeclExpr (that occassionally hides behind implicit conversions). Similar changes for switch, while, and do-while will follow, then the removal of CXXConditionDeclExpr. This commit is the canary. llvm-svn: 89717
* Require a class type to be complete before probing its conversionDouglas Gregor2009-11-231-0/+7
| | | | | | | functions for a switch condition's conversion to integral or enumeration type. llvm-svn: 89656
* Implement conversion from a switch condition with class type to anDouglas Gregor2009-11-231-32/+98
| | | | | | integral or enumeration type (vi user-defined conversions). Fixes PR5518. llvm-svn: 89655
* Don't issue spurious diagnostic with Obj-C fast enumeration.Fariborz Jahanian2009-11-191-0/+9
| | | | | | (radar 7409165). llvm-svn: 89400
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* If we attempt to add a constructor template specialization that looksDouglas Gregor2009-11-141-2/+5
| | | | | | | | | | | | like a copy constructor to the overload set, just ignore it. This ensures that we don't try to use such a constructor as a copy constructor *without* triggering diagnostics at the point of declaration. Note that we *do* diagnose such copy constructors when explicitly written by the user (e.g., as an explicit specialization). llvm-svn: 88733
* Refine volatile handling, specifically, we must have the canonicalMike Stump2009-11-031-1/+1
| | | | | | | type to look at the volatile specifier. I found these all from just hand auditing the code. llvm-svn: 85967
* Remove default argument for ImpCastExprToType. Add appropriate argument Eli Friedman2009-10-201-2/+2
| | | | | | | | | | | | | to all callers. Switch a few other users of CK_Unknown to proper cast kinds. Note that there are still some situations where we end up with CK_Unknown; they're pretty easy to find with grep. There are still a few missing conversion kinds, specifically pointer/int/float->bool and the various combinations of real/complex float/int->real/complex float/int. llvm-svn: 84623
* Fix for PR5190, Credit to Zhanyong Wan.Edward O'Callaghan2009-10-171-5/+14
| | | | llvm-svn: 84346
* 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
OpenPOWER on IntegriCloud