summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix <rdar://problem/6257675> error: member reference base type ↵Steve Naroff2008-10-221-0/+7
| | | | | | | | ('NSUserDefaults *') is not a structure or union. Teach Sema::ActOnMemberReferenceExpr() to look through local category implementations associated with the class. llvm-svn: 57995
* Add representation of base classes in the AST, and verify that weDouglas Gregor2008-10-225-24/+103
| | | | | | | | don't have duplicated direct base classes. Seriliazation of base class specifiers is not yet implemented. llvm-svn: 57991
* QualType::isMoreQualifiedThan and isAtLeastAsQualifiedAs assert that weDouglas Gregor2008-10-222-6/+12
| | | | | | | | | aren't trying to compare with address-space qualifiers (for now). Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part of the check into a static DeclCanBeLvalue. llvm-svn: 57980
* Implement ranking of standard conversion sequences by their qualificationDouglas Gregor2008-10-224-40/+148
| | | | | | | | | | | | conversions (e.g., comparing int* -> const int* against int* -> const volatile int*); see C++ 13.3.3.2p3 bullet 3. Add Sema::UnwrapSimilarPointerTypes to simplify the control flow of IsQualificationConversion and CompareQualificationConversion (and fix the handling of the int* -> volatile int* conversion in the former). llvm-svn: 57978
* Add a bunch of getLValue* methods to RegionStore.Zhongxing Xu2008-10-221-0/+54
| | | | llvm-svn: 57977
* Adjust parameter order to more natural one.Zhongxing Xu2008-10-222-4/+4
| | | | llvm-svn: 57964
* Exprs of function type is another special case for ImplicitCast.Zhongxing Xu2008-10-221-2/+2
| | | | llvm-svn: 57963
* Move Sema::GetNonReferenceType to QualType::getNonReferenceType and make it ↵Douglas Gregor2008-10-223-19/+1
| | | | | | inline llvm-svn: 57951
* some minor cleanups to ParseObjCTypeName:Chris Lattner2008-10-221-17/+12
| | | | | | | | | | 1. Remove a bogus assertion, clients other than sema can return a null pointer from actions that result in ParseTypeName returning null. 2. Remove dead RParenLoc variable. 3. Simplify control flow handling error conditions. 4. On a major failure, we should skip until ')' not until '}'. llvm-svn: 57949
* Fix a thinko in the qualification-conversion check when the qualificaitons ↵Douglas Gregor2008-10-221-1/+1
| | | | | | are disjoint, and add some overloading-based tests of qualification conversions llvm-svn: 57942
* Functions can be lvalues in C++, but not modifiable lvaluesDouglas Gregor2008-10-221-1/+7
| | | | llvm-svn: 57941
* Initial step toward supporting qualification conversions (C++ 4.4).Douglas Gregor2008-10-215-11/+149
| | | | | | | | | | | | | | | | | | | | Changes: - Sema::IsQualificationConversion determines whether we have a qualification conversion. - Sema::CheckSingleAssignment constraints now follows the C++ rules in C++, performing an implicit conversion from the right-hand side to the type of the left-hand side rather than checking based on the C notion of "compatibility". We now rely on the implicit-conversion code to determine whether the conversion can happen or not. Sema::TryCopyInitialization has an ugly reference-related hack to cope with the initialization of references, for now. - When building DeclRefExprs, strip away the reference type, since there are no expressions whose type is a reference. We'll need to do this throughout Sema. - Expr::isLvalue now permits functions to be lvalues in C++ (but not in C). llvm-svn: 57935
* Fix use of dyn_cast.Daniel Dunbar2008-10-211-1/+1
| | | | llvm-svn: 57927
* Add GetModule accessor to ModuleBuilderDaniel Dunbar2008-10-211-0/+4
| | | | llvm-svn: 57924
* When conjuring symbols for compound assignments, use the promoted type to ↵Ted Kremenek2008-10-211-4/+4
| | | | | | determine if the symbolic value as a "loc::" or "nonloc::" value. llvm-svn: 57917
* Fix <rdar://problem/6257645> clang static analyzer crashes when encountering ↵Steve Naroff2008-10-211-0/+5
| | | | | | | | | blocks as objects ASTContext::isObjCObjectPointerType() needs to consider blocks as objects. Note: My previous commit was done in the test directory...as a result, this commit was necessary. llvm-svn: 57914
* Cosmetic patch from João Paulo Rechi VitaDouglas Gregor2008-10-211-1/+0
| | | | llvm-svn: 57910
* Preliminary support for function overloadingDouglas Gregor2008-10-2117-48/+1420
| | | | llvm-svn: 57909
* Handle [NSAutoreleasePool addObject:] (an alternative way to add objects to ↵Ted Kremenek2008-10-211-2/+27
| | | | | | | | the current autorelease pool). Added initial code for tracking stack of autorelease pools. llvm-svn: 57908
* Fix a crasher during error recovery in Parser::ParseObjCTypeName().Steve Naroff2008-10-211-1/+2
| | | | | | Found this while fixing another unrelated radar. llvm-svn: 57904
* Fix typo.Steve Naroff2008-10-211-1/+1
| | | | llvm-svn: 57899
* Fix <rdar://problem/6261178> clang-on-xcode: [sema] multiple method warning ↵Steve Naroff2008-10-212-10/+39
| | | | | | | | | | | | is over enthusiastic. Fix <rdar://problem/6265257> warnings for ambiguous message send swamp other warnings. Reworked Sema::MatchTwoMethodDeclarations() to optionally match based on method size and alignment (the default in GCC). Changed Sema::LookupInstanceMethodInGlobalPool() to use this feature. Added -Wno-struct-selector-match to driver, however didn't hook it up yet. Added a FIXME that says this. llvm-svn: 57898
* Localize the special processing of array variable inside Zhongxing Xu2008-10-212-14/+3
| | | | | | | | | | | GRExprEngine::VisitCast() so that other parts of the analyzer can be ignorant. When we cast "array of type T" to "pointer to T", we get the loc::MemRegionVal corresponding to the array variable. This is sufficient for BasicStore, but not for RegionStore. RegionStore should get the element region for the first array element in the cast. So next comes to the revamping of transfer functions for different store model. llvm-svn: 57897
* Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.Zhongxing Xu2008-10-213-24/+24
| | | | llvm-svn: 57896
* Rename:Zhongxing Xu2008-10-212-1/+1
| | | | | | RValues.h/cpp => SVals.h/cpp llvm-svn: 57893
* Process decls in RegionStore. Individual elements of fixed size arrays areZhongxing Xu2008-10-211-2/+115
| | | | | | initialized to UndefinedVal. llvm-svn: 57892
* Add ElementRegion to represent memory chunks for array elements.Zhongxing Xu2008-10-211-0/+28
| | | | llvm-svn: 57891
* Further improve path-sensitivity with divide-by-zero checking by assuming ↵Ted Kremenek2008-10-201-18/+31
| | | | | | that a denominator cannot be zero even when the result of an '/' or '%' expression is unknown. llvm-svn: 57855
* Used conjured symbols to recover path-sensitivity when the result of a ↵Ted Kremenek2008-10-201-0/+13
| | | | | | compound assignment is UnknownVal(). llvm-svn: 57851
* Fix <rdar://problem/6268365> Parser rejects property (dot notation) access ↵Steve Naroff2008-10-201-1/+9
| | | | | | on id<protocol>. llvm-svn: 57850
* Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling ↵Steve Naroff2008-10-202-4/+27
| | | | | | of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed). llvm-svn: 57841
* eliminate ObjCPropertyAttrs an corresponding enums, just useChris Lattner2008-10-202-21/+9
| | | | | | strcmp when needed. llvm-svn: 57817
* rearrange some code.Chris Lattner2008-10-201-17/+16
| | | | llvm-svn: 57816
* more simplifications to error recovery in ParseObjCPropertyAttributeChris Lattner2008-10-201-28/+18
| | | | llvm-svn: 57815
* remove extraneous bracesChris Lattner2008-10-201-3/+2
| | | | llvm-svn: 57814
* move some code around to make it fall through more, no functionality change.Chris Lattner2008-10-201-25/+24
| | | | llvm-svn: 57813
* reject properties completely in objc1 instead of emitting Chris Lattner2008-10-201-7/+15
| | | | | | weird errors about property attributes being unknown. llvm-svn: 57812
* More property attribute recovery improvements. Instead of this:Chris Lattner2008-10-201-16/+13
| | | | | | | | | | | | | | | | | | | | | | crash.m:8:12: error: type name requires a specifier or qualifier @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:29: error: expected ';' at end of declaration list @property (readonlyx, getter=isAwesome) int _awesome; ^ crash.m:8:39: error: expected identifier or '(' @property (readonlyx, getter=isAwesome) int _awesome; ^ we now get: crash.m:8:12: error: unknown property attribute 'readonlyx' @property (readonlyx, getter=isAwesome) int _awesome; ^ Also, we can eliminate isObjCPropertyAttribute now. llvm-svn: 57811
* significantly simplify and clean up error recovery in Chris Lattner2008-10-201-25/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ParseObjCPropertyAttribute. Before, on this code (where a comma was forgotten): @property (readonly getter=isAwesome) int _awesome; we emitted: crash.m:9:11: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: type name requires a specifier or qualifier @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:37: error: expected identifier or '(' crash.m:9:37: error: expected ';' at end of declaration list crash.m:9:1: error: @property requires fields to be named @property (readonly getter=isAwesome) int _awesome; ^ now we emit: crash.m:9:21: error: expected ')' @property (readonly getter=isAwesome) int _awesome; ^ crash.m:9:11: error: to match this '(' @property (readonly getter=isAwesome) int _awesome; ^ llvm-svn: 57809
* simplify some other code for __extension__ processing.Chris Lattner2008-10-202-7/+6
| | | | llvm-svn: 57807
* implement a couple fixme's by implementing __extension__ properly.Chris Lattner2008-10-204-13/+54
| | | | llvm-svn: 57806
* fix a crash on unnamed properties like:Chris Lattner2008-10-201-7/+13
| | | | | | @property (readonly) int : 4; llvm-svn: 57805
* simplify some code by using ExpectAndConsume. When an errorChris Lattner2008-10-201-9/+6
| | | | | | | occurs, skip to an @ or ; instead of to a } or ;. Properties don't necessarily live in {}'s. llvm-svn: 57804
* refactor a bunch of code:Chris Lattner2008-10-201-44/+27
| | | | | | | | | | Check for @end in ParseObjCInterfaceDeclList instead of in each caller Handle @required and @optional with the same code Add some fixmes about some apparently objc2 code that is being accepted in objc1. llvm-svn: 57803
* fix some minor error recovery bugs in ParseObjCInterfaceDeclListChris Lattner2008-10-201-12/+27
| | | | | | | | | | | where it would reject @required in non-protocols, but then go ahead and tag methods with required anyway. Instead, if we see this in something other than a protocol, just ignore the request. Also, improve error recovery a bit when we see something bogus inside an interface. llvm-svn: 57798
* restructure the body of the ParseObjCInterfaceDeclList loopChris Lattner2008-10-201-67/+77
| | | | | | to make it easier to understand. No functionality change. llvm-svn: 57797
* Fix rdar://6257721 by tightening up the block "snapshot" check, andChris Lattner2008-10-201-9/+39
| | | | | | move it to its own predicate to make it more clear. llvm-svn: 57796
* Support attributes in *yet another* place. Is there any place you Chris Lattner2008-10-201-0/+11
| | | | | | can't stick an attributes? llvm-svn: 57795
* Fix a parser bug where we let attributes interfere with our disambiguationChris Lattner2008-10-201-20/+70
| | | | | | | | | | | | | | | | | | | of whether a '(' was a grouping paren or the start of a function declarator. This is PR2796. Now we eat the attribute before deciding whether the paren is grouping or not, then apply it to the resultant decl or to the first argument as needed. One somewhat surprising aspect of this is that attributes interact with implicit int in cases like this: void a(x, y) // k&r style function void b(__attribute__(()) x, y); // function with two implicit int arguments void c(x, __attribute__(()) y); // error, can't have attr in identifier list. Fun stuff. llvm-svn: 57790
* fix indentationChris Lattner2008-10-201-1/+1
| | | | llvm-svn: 57789
OpenPOWER on IntegriCloud