summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* -Changes to TagDecl:Argyrios Kyrtzidis2008-06-094-21/+17
| | | | | | | | | Added TagKind enum. Added getTagKind() method. Added convenience methods: isEnum(), isStruct(), isUnion(), isClass(). -RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one. llvm-svn: 52160
* Add code to make test/CodeGen/struct-init.c work correctly without the Eli Friedman2008-06-091-0/+105
| | | | | | | | | | | | | | | pointer cast hack currently in isIntegerConstantExpr (in lib/AST/Expr.cpp). Also removes an odd test that even gcc doesn't accept. The reason the pointer cast hack is relevant here is that it makes Sema end up misinterpreting the relevant expression as a null pointer constant. The reason for this patch is that I plan to remove the pointer cast hack sometime soon because it causes strange issues, especially in its current form; see my recent email to cfe-dev "[PATCH] add constant expression evaluation to the AST and fix PR2413". llvm-svn: 52120
* For struct initialization, check compatibility with the unqualified Eli Friedman2008-06-091-1/+3
| | | | | | | | type; this isn't explicitly stated in the standard, but it doesn't really make sense for them to have an effect here. Fixes the included testcase, sent to me by Steve Naroff. llvm-svn: 52113
* implement the alias attirbute (in both Sema and Codegen)Nuno Lopes2008-06-082-0/+30
| | | | llvm-svn: 52092
* capture whether a CharacterLiteral was wide or not in the AST. Chris Lattner2008-06-071-1/+2
| | | | | | Patch by Mike Stump! llvm-svn: 52081
* Clean up dead code from SemaInit landing.Eli Friedman2008-06-062-214/+1
| | | | llvm-svn: 52054
* Oops...remove weird printf:-)Steve Naroff2008-06-051-1/+0
| | | | llvm-svn: 52025
* Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: ↵Steve Naroff2008-06-052-3/+13
| | | | | | redefinition of 'XCElementToggler' as different kind of symbol llvm-svn: 52024
* super fix submitted by David Chisnall.Steve Naroff2008-06-051-1/+1
| | | | llvm-svn: 52014
* Fixed a recent test regression from last night (r51976).Steve Naroff2008-06-051-4/+4
| | | | llvm-svn: 52006
* Fix <rdar://problem/5986833> clang on xcode: incompatible type returning ↵Steve Naroff2008-06-052-4/+28
| | | | | | | | | 'void', expected 'int'. - Changed Sema::ObjCActOnStartOfMethodDef() to more accurately type "self" in factory methods. - Changed Sema::ActOnInstanceMessage() to use the new type to restrict the lookup. llvm-svn: 52005
* Fix <rdar://problem/5987482> clang on xcode: null dereference in ↵Steve Naroff2008-06-051-6/+17
| | | | | | | | Sema::ActOnMemberReferenceExpr. In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>"). llvm-svn: 52001
* Fix trivial crasher and downgrade an error to warning (to match GCC).Steve Naroff2008-06-051-2/+2
| | | | llvm-svn: 51976
* Fix crash identified by <rdar://problem/5986085>.Steve Naroff2008-06-041-11/+23
| | | | llvm-svn: 51969
* Added fixmes.Ted Kremenek2008-06-041-0/+2
| | | | llvm-svn: 51964
* Make sure the types are consistent for a void conditional. No visible Eli Friedman2008-06-041-4/+4
| | | | | | difference, but it's better to be consistent. llvm-svn: 51961
* fix type of ?: operator. If one of the operator is void, the type should be ↵Nuno Lopes2008-06-041-2/+4
| | | | | | | | void as well. Please confirm this is safe llvm-svn: 51957
* Fix a gcc compatibility issue which allows more protocol-qualified id on RHS ↵Fariborz Jahanian2008-06-041-3/+12
| | | | | | | | to be assigned to less protocol qualified object on LHS. llvm-svn: 51956
* Moved LangOptions from TranslationUnit to ASTContext. This induced a ↵Ted Kremenek2008-06-041-2/+3
| | | | | | variety of cleanups in some ASTConsumers. llvm-svn: 51943
* Sema::ActOnClassMessage() needs to look through it's local implementation ↵Steve Naroff2008-06-041-0/+6
| | | | | | for private class methods. llvm-svn: 51938
* Give the "isa" slot a name!Steve Naroff2008-06-041-1/+2
| | | | llvm-svn: 51924
* Implement another property related FIXME:Steve Naroff2008-06-031-1/+3
| | | | | | Fix <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51919
* Re-fix r51907 in a way which doesn't affect valid code. This essentially Eli Friedman2008-06-032-3/+60
| | | | | | | | | | | | | moves the check for the invalid construct to a point where it doesn't affect other uses of isIntegerConstantExpr, and we can warn properly when the extension is used. This makes it a bit more complicated, but it's a lot cleaner. Steve, please tell me if this check is sufficient to handle the relevant system header. I know it's enough to handle the testcase, but I don't know what exactly the original looks like. llvm-svn: 51918
* Fixup recent "super" regression.Steve Naroff2008-06-031-1/+1
| | | | llvm-svn: 51913
* Allow implicit pointer/int conversions on ObjCQualifiedIdTypes in ↵Steve Naroff2008-06-031-6/+14
| | | | | | | | Sema::CheckCompareOperands() and Sema::CheckAssignmentConstraints(). Fixes <rdar://problem/5980804> clang on xcode: error: incompatible type sending 'id<XDUMLType>', expected 'NSCellType'. llvm-svn: 51902
* Finish up r51900.Steve Naroff2008-06-031-4/+5
| | | | llvm-svn: 51901
* Allow for a GCC cast extension.Steve Naroff2008-06-031-3/+10
| | | | | | Fixes part of <rdar://problem/5980829> clang on xcode: used type 'NSRange' where arithmetic or pointer type is required. llvm-svn: 51900
* Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared ↵Steve Naroff2008-06-021-0/+5
| | | | | | identifier 'super' llvm-svn: 51888
* fix decl attributes cleaningNuno Lopes2008-06-011-1/+2
| | | | | | this plugs the leak of attributes and also fixes a crash in the test llvm-svn: 51862
* Tweak Sema::ObjCQualifiedIdTypesAreCompatible() to handle qualified ↵Steve Naroff2008-06-011-5/+24
| | | | | | | | | | interface types on the RHS. This eliminates a bogus warning identified in the test below. This fixes <rdar://problem/5968256> clang on xcode: error: incompatible type initializing 'NSObject<XCSelectionSource> *', expected 'id<NSObject,XCSelectionSource>' llvm-svn: 51832
* Teach Sema::CheckConditionalOperands() to check for ObjCQualifiedIdType's. ↵Steve Naroff2008-05-311-1/+7
| | | | | | | | This fixes a bogus error. <rdar://problem/5967036> clang on xcode: error: incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream *') llvm-svn: 51828
* Added "InitializeTU" to ASTConsumer. This is used by Sema::ParseAST to pass aTed Kremenek2008-05-311-1/+1
| | | | | | | | | | | TranslationUnit object instead of an ASTContext. By default it calls Initialize(ASTConstext& Context) (to match with the current interface used by most ASTConsumers). Modified the ObjC-Rewriter to use InitializeTU, and to tell the TranslationUnit to not free its Decls. This is a workaround for: <rdar://problem/5966749> llvm-svn: 51825
* Fix <rdar://problem/5965704> clang: bad receiver type 'id const'Steve Naroff2008-05-311-2/+3
| | | | llvm-svn: 51809
* Allow a pointer implicitly cast to a bool as a constant expression, as Eli Friedman2008-05-301-17/+34
| | | | | | | | | | required by the standard (the standard doesn't know anything about implicit casts). Disallow pointers cast to non-integral arithmetic types as constant expressions. This was previously allowed by accident. llvm-svn: 51779
* Make sure to allow assigning a pointer to a bool.Eli Friedman2008-05-301-11/+14
| | | | llvm-svn: 51778
* Add basic support for properties references (a missing feature).Steve Naroff2008-05-301-0/+30
| | | | | | While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51719
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-293-1/+3
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Get the type right for wide string literals; it's wchar_t, not char.Eli Friedman2008-05-271-1/+1
| | | | llvm-svn: 51586
* Add FIXME.Eli Friedman2008-05-271-0/+1
| | | | llvm-svn: 51585
* Don't swap function decls, and add them to the scope as they are Eli Friedman2008-05-271-7/+1
| | | | | | | | | | | | | encountered. Mixing up the decls is unintuitive, and confuses the AST destruction code. Fixes PR2360. Note that there is a need to look up the characteristics and declarations of a function associated with a particular name or decl, but the original swapping code doesn't solve it properly. http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-May/001644.html is one suggestion for how to fix that. llvm-svn: 51584
* Stop leaking the main Sema object. (Leak found using valgrind.)Eli Friedman2008-05-271-2/+3
| | | | llvm-svn: 51580
* Implementation of gcc mode attribute; this is significant because Eli Friedman2008-05-273-1/+142
| | | | | | | | | | it fixes PR2204. Not too much to say about the implementation; it works in a similar way to the vector size attribute. At some point, we need to modify the targets to provide information about the appropriate types. llvm-svn: 51577
* Count the number of initializable members correctly in structs/unions Eli Friedman2008-05-251-2/+6
| | | | | | with unnamed members. llvm-svn: 51557
* Diagnose implicit init list for empty aggregate, like struct {}. Fixes Eli Friedman2008-05-251-0/+7
| | | | | | PR2151 (by not creating the empty implicit init list). llvm-svn: 51556
* Move the error checking for variable-sized objects so we don't Eli Friedman2008-05-251-20/+19
| | | | | | double-report errors; fixes PR2362. llvm-svn: 51555
* Revert r51498: ↵Ted Kremenek2008-05-231-4/+2
| | | | | | | | | http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=51498&r1=51497&r2=51498&view=diff Turns out that there are multiple places where a redefinition diagnostic can be emitted. A cleaner solution (without touching Sema) is to have the Driver turn off these diagnostics. (will submit this patch soon) llvm-svn: 51502
* Remove a diagnostic (temporary hack that will be removed next week).Steve Naroff2008-05-231-2/+4
| | | | llvm-svn: 51498
* Make sure the source location for @property points the the @-sign (not the ↵Steve Naroff2008-05-221-0/+4
| | | | | | | | decl spec). Also added a FIXME related to how we represent @properties in the ObjCInterfaceDecl AST. llvm-svn: 51450
* Patch for PR2350; the issue was tnat we were allowing (with an error) Eli Friedman2008-05-221-2/+3
| | | | | | void f(const void) in one place and rejecting it in another. llvm-svn: 51424
* Move getAccessedFieldNo out of lib/AST/Expr.cpp intoDan Gohman2008-05-221-5/+5
| | | | | | | | | lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to use its own enum for visibility types instead of using llvm::GlobalValue::VisibilityTypes. These changes eliminate dependencies in the AST library on LLVM's VMCore library. llvm-svn: 51398
OpenPOWER on IntegriCloud