summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Set register storage class correctly for function parameters.Daniel Dunbar2008-09-031-3/+5
| | | | | | - PR2730 llvm-svn: 55739
* Add __builtin_object_size support.Daniel Dunbar2008-09-032-4/+30
| | | | | | | - Currently CodeGen always returns a conservative value for this (-1 or 0 depending on the context). llvm-svn: 55735
* Add semantic analysis for "blocks". Steve Naroff2008-09-034-1/+224
| | | | | | | | | | | | | | | Highlights... - 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr. - Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt(). Next steps... - hack Sema::ActOnIdentifierExpr() to deal with block decl refs. - add attribute handler for byref decls. - add test cases. llvm-svn: 55710
* Fix 80 col violations.Ted Kremenek2008-09-031-9/+8
| | | | llvm-svn: 55707
* Improve type-checking of ?: for Objective-C types.Daniel Dunbar2008-09-031-12/+17
| | | | | | | - Allow any Objective-C object types to devolve to type id in a ?: expression. This matches gcc behavior more closely. llvm-svn: 55705
* Restore Objective-C dot-syntax access of methods.Daniel Dunbar2008-09-031-33/+63
| | | | | | | | - Now also searches for correct setter method. - There are still some issues regarding validation of the setter method and access of read-only properties. llvm-svn: 55686
* When creating CXXRecordDecls and RecordDecls within ActOnTag, hook up the ↵Ted Kremenek2008-09-021-5/+15
| | | | | | new [CXX]RecordDecl with the RecordDecl chain. llvm-svn: 55652
* Fix for PR2747: allow pointer->int casts with a null base; these are Eli Friedman2008-09-021-0/+7
| | | | | | offset-of-like expressions. llvm-svn: 55627
* An extremely hacky version of transparent_union support; it isn't Eli Friedman2008-09-021-7/+22
| | | | | | | | | anywhere near correct in terms of missing cases and missing diagnostics, but it's good enough to handle the uses in the Linux system headers, which are currently a constant pain for compiling applications on Linux. llvm-svn: 55621
* Make sure to take the unqualified versions of the canonical types for Eli Friedman2008-09-021-3/+4
| | | | | | | type-checking pointer subtraction; if the canonical types aren't used, the qualifiers won't always get stripped off correctly. llvm-svn: 55620
* Backing out r55607 due to logic errors and test regression.Eli Friedman2008-09-011-10/+6
| | | | | | I'll try to come up with a correct fix for the testcase sometime soon. llvm-svn: 55614
* Tidy up sema processing of attribute "nonull":Ted Kremenek2008-09-011-8/+20
| | | | | | | | - warn about nonnull being applied to functions with no pointer arguments - continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull - when no argument list is specified, only mark pointers as nonnull. This fixes PR 2732 and radar 6188814. llvm-svn: 55610
* fix one more this-is-not-a-constant error. test includedNuno Lopes2008-09-011-0/+3
| | | | llvm-svn: 55609
* make CheckArithmeticConstantExpression() aware of &foo and pointersNuno Lopes2008-09-011-6/+10
| | | | llvm-svn: 55607
* Add Objective-C property setter support.Daniel Dunbar2008-08-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | - Change Obj-C runtime message API, drop the ObjCMessageExpr arg in favor of just result type and selector. Necessary so it can be reused in situations where we don't want to cons up an ObjCMessageExpr. - Update aggregate binary assignment to know about special property ref lvalues. - Add CodeGenFunction::EmitCallArg overload which takes an already emitted rvalue. Add CodeGenFunction::StoreComplexIntoAddr. Disabled logic in Sema for parsing Objective-C dot-syntax that accesses methods. This code does not search in the correct order and the AST node has no way of properly representing its results. Updated StmtDumper to print a bit more information about ObjCPropertyRefExprs. llvm-svn: 55561
* minor cleanupNico Weber2008-08-291-15/+4
| | | | llvm-svn: 55538
* First wave of changes to support "blocks" (an extension to C).Steve Naroff2008-08-271-0/+8
| | | | | | This commit adds the declaration syntax (and associated type). llvm-svn: 55417
* Add synthesized property methods to protocols and categories in Sema.Daniel Dunbar2008-08-271-12/+25
| | | | | | | | | | | | | | | | - It is not clear that this is the right approach, but this is at least consistent with how interfaces are handled. - This means NeXT now emits the correct metadata for properties in protocols. - This currently introduces a spurious warning involving inherited properties in protocols or categories; however, it also fixes some situations where we were failing to emit a warning. I will scrub this code tomorrow and fix this issue as well as number of other missed warnings / error situations that appear to exist. llvm-svn: 55407
* Move implicit Obj-C param creation into ObjCMethodDecl.Daniel Dunbar2008-08-263-36/+3
| | | | | | | | | | - Add ObjCMethodDecl::createImplicitParams. - Remove ObjCMethodDecl::set{Self,Cmd}Decl - Remove Sema::CreateImplicitParameter No (intended) functionality change. llvm-svn: 55356
* Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)Daniel Dunbar2008-08-261-3/+3
| | | | | | | | | - Change enum name to Kind. - Change enum constants to English strings. Also, fix getPropertyImplementation (which probably should be renamed) llvm-svn: 55354
* In incompatible pointer-typed ?: expressions, add implicit conversionDaniel Dunbar2008-08-261-10/+23
| | | | | | | | | | | | | | | | | | | | of RHSs to id type instead of void* if either has Objective-C object type. - This ensures the result can still be used in normal places an object can be used, like a message send. Add implicit conversions for ?: applied to qualified id types to ensure that the RHSs are compatible. - This prevents a codegen crash (creating invalid PHI nodes). - Again, this relates to the fact that qualified id types have no canonical types. - Note that the implicit type casted to is incorrect, however this doesn't currently cause problems because of the flexibility of the id type. Test cases for above. llvm-svn: 55346
* Do typechecking and codegen for K&R-style function declarations Eli Friedman2008-08-252-13/+12
| | | | | | | correctly. Not a regression, but made more obvious by my recent fix which made function type compatibility checking a bit more strict. llvm-svn: 55339
* Fix for PR2720; be a little bit more permissive in initializers for Eli Friedman2008-08-251-21/+23
| | | | | | | | | | casting pointers to integers. Eventually, we should check whether we can evaluate an expression using Expr::tryEvaluate, and this codepath should be tightened to only handle standard-compliant cases. llvm-svn: 55331
* Objective-C foreach selector elements must be lvalues.Anders Carlsson2008-08-251-3/+10
| | | | llvm-svn: 55316
* Fix silly bug in objc_gc attribute parsing and add test caseAnders Carlsson2008-08-241-2/+2
| | | | llvm-svn: 55286
* Pass SourceRanges by reference to the various Diag methods.Argyrios Kyrtzidis2008-08-242-14/+16
| | | | llvm-svn: 55284
* Add support for parsing the objc_gc attribute. Tests will come shortly.Anders Carlsson2008-08-231-0/+32
| | | | llvm-svn: 55269
* Make sure to create CXX record decls for the implicit Obj-C type ↵Anders Carlsson2008-08-231-14/+16
| | | | | | declarations. This lets us compile Cocoa.h as Objective-C++ llvm-svn: 55261
* make sure that ParseAST invokes the action for end of translation unit.Chris Lattner2008-08-232-0/+10
| | | | llvm-svn: 55222
* minor cleanup, remove finalize method.Chris Lattner2008-08-232-5/+4
| | | | llvm-svn: 55216
* Use isa instead of dyn_cast.Anders Carlsson2008-08-221-2/+1
| | | | llvm-svn: 55207
* Add support for C++'s "type-specifier ( expression-list )" expression:Argyrios Kyrtzidis2008-08-222-0/+76
| | | | | | | | | | -The Parser calls a new "ActOnCXXTypeConstructExpr" action. -Sema, depending on the type and expressions number: -If the type is a class, it will treat it as a class constructor. [TODO] -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node. llvm-svn: 55177
* Initial sema support for C++ static initializers.Anders Carlsson2008-08-221-4/+11
| | | | llvm-svn: 55166
* Rewrite type compatibility testing to do type merging rather than just Eli Friedman2008-08-222-3/+32
| | | | | | | | | | | | testing compatibility. This is necessary for some constructs, like merging redeclarations. Also, there are some ObjC changes to make sure that typesAreCompatible(a,b) == typesAreCompatible(b,a). I don't have any ObjC code beyond the testsuite, so please tell me if there are any cases where this doesn't behave as expected. llvm-svn: 55158
* add a simple check to warn people who type "=+" when they probably meantChris Lattner2008-08-211-2/+22
| | | | | | "+=". llvm-svn: 55131
* Fix a regression from my fix to PR2631. Fixes PR2692.Eli Friedman2008-08-201-0/+2
| | | | llvm-svn: 55083
* Fix attributes on Obj-C interfaces & methods.Daniel Dunbar2008-08-201-2/+9
| | | | | | | - Drop MethodAttrs parameter to ObjCMethodDecl - Call ProcessDeclAttributeList for interface & method decls. llvm-svn: 55068
* Fix subtle bug introduced in r54852.Daniel Dunbar2008-08-202-2/+2
| | | | | | | | | - UsualUnaryConversions takes an Expr *& and may modify its argument, this broke when it was refactored into Sema::CheckCastTypes. This meant that we were missing implicit casts in some places. - Seems pretty sad that this got through our tests. llvm-svn: 55039
* Re-enable deletion of AST nodes upon completion of ParseAST.Ted Kremenek2008-08-201-3/+0
| | | | llvm-svn: 55038
* Added ObjCAtDefsFieldDecl to represent FieldDecls created by @defs.Ted Kremenek2008-08-201-4/+14
| | | | | | This fixes an ownership issue where FieldDecls could be owned both by an ObjCInterfaceDecl and a RecordDecl. llvm-svn: 55037
* Add ExplicitCastExpr to replace the current CastExpr, and have ↵Argyrios Kyrtzidis2008-08-183-22/+8
| | | | | | | | | | | ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr): Expr -> CastExpr -> ExplicitCastExpr -> ImplicitCastExpr llvm-svn: 54955
* warn when someone tries to make an array of ObjC interfaces instead of arrayChris Lattner2008-08-181-0/+4
| | | | | | of pointers to them. rdar://4304469 llvm-svn: 54953
* Support initialization of incomplete array with zero size (asDaniel Dunbar2008-08-181-10/+9
| | | | | | extension). llvm-svn: 54946
* Several cleanups and tweaks to diagnostics in Sema::ActOnAsmStmt,Chris Lattner2008-08-181-37/+29
| | | | | | no other functionality change. llvm-svn: 54941
* various updates to match r54873 on mainline.Chris Lattner2008-08-172-6/+6
| | | | llvm-svn: 54874
* Move the type checking that Sema::ActOnCastExpr does into a new ↵Argyrios Kyrtzidis2008-08-162-33/+41
| | | | | | Sema::CheckCastTypes function so that it can be reused. llvm-svn: 54852
* Change Parser & Sema to use interned "super" for comparions.Daniel Dunbar2008-08-144-3/+8
| | | | | | | | | | | | | | - Added as private members for each because it is not clear where to put the common definition. Perhaps the IdentifierInfos all of these "pseudo-keywords" should be collected into one place (this would KnownFunctionIDs and Objective-C property IDs, for example). Remove Token::isNamedIdentifier. - There isn't a good reason to use strcmp when we have interned strings, and there isn't a good reason to encourage clients to do so. llvm-svn: 54794
* Make diagnostics relating to the callee hilight just the calleeChris Lattner2008-08-141-4/+4
| | | | | | | | | | | | | | | | and put the caret on the ()'s. e.g. produces: t.c:13:9: error: called object is not a function or function pointer ((B)a)(); ~~~~~~^ instead of: t.c:13:3: error: called object is not a function or function pointer ((B)a)(); ^~~~~~~~ llvm-svn: 54775
* Update some isIntegerConstantExpr uses to useDaniel Dunbar2008-08-131-4/+2
| | | | | | getIntegerConstantExprValue where appropriate. llvm-svn: 54771
* Sema::ActOnStartProtocolInterface(): Make sure the protocol decl has a valid ↵Steve Naroff2008-08-131-1/+2
| | | | | | | | | | | | | | | | start location. The following case resulted in an invalid start location: // start location not being set for ObjCProtocolDecl AST (when a forward reference is in scope). @protocol Buggy; @protocol Buggy @optional - whatever; @end llvm-svn: 54740
OpenPOWER on IntegriCloud