summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement codegen of aggregates as lvalues in binary expressions,Daniel Dunbar2008-09-042-1/+17
| | | | | | e.g. "(a = b).somefield". llvm-svn: 55758
* 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-033-4/+40
| | | | | | | - 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-037-1/+318
| | | | | | | | | | | | | | | 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
* Store: (static analyzer)Ted Kremenek2008-09-032-30/+90
| | | | | | | | | | | | | | | | | | | | | - Change definition of store::Region and store::Binding (once again) to make them real classes that just wrap pointers. This makes them more strictly typed, and allows specific implementations of Regions/Bindings to just subclass them. - minor renamings to RegionExtent and its subclasses - added a bunch of doxygen comments StoreManager: (static analyzer) - added 'iterBindings', an iteration method for iterating over the bindings of a store. It that takes a callback object (acting like a poor man's closure). - added 'getRVal' version for store::Binding. Will potentially phase the other versions of GetRVal in StoreManager out. - reimplemented 'getBindings' to be non-virtual and to use 'iterBindings' BasicStoreManager: (static analyzer) - implemented 'iterBindings' for BasicStoreManager llvm-svn: 55688
* 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
* Fix ObjCPropertRefExpr to be able to encode all the information forDaniel Dunbar2008-09-034-18/+43
| | | | | | | uses which refer to methods not properties. - Not yet wired in Sema. llvm-svn: 55681
* 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
* RecordDecl:Ted Kremenek2008-09-021-60/+56
| | | | | | | | - Remove method 'isForwardDecl'; this functionality is already provided by 'isDefinition()' - Move method definitions to be co-located with other RecordDecl methods. llvm-svn: 55649
* RecordDecl serialization:Ted Kremenek2008-09-021-7/+4
| | | | | | | - Don't serialize out the NextDeclarator field. It is unused and deprecated. - Serialize out the NextDecl pointer. llvm-svn: 55644
* RecordDecl:Ted Kremenek2008-09-021-0/+12
| | | | | | | | | - Added method 'isForwardDeclaration', a predicate method that returns true if a RecordDecl represents a forward declaration. - Added method 'getDefinitionDecl', a query method that returns a pointer to the RecordDecl that provides the actual definition of a struct/union. llvm-svn: 55642
* CXXRecordDecl and RecordDecl:Ted Kremenek2008-09-022-7/+38
| | | | | | | | | | | | | | | | | | | - Change constructor and create methods to accept a CXXRecordDecl* (RecordDecl*) instead of a ScopedDecl* for PrevDecl. This causes the type checking to be more tight and doesn't break any code. RecordDecl: - Don't use the NextDeclarator field in ScopedDecl to represent the previous declaration. This is a conflated use of the NextDeclarator field, which will be removed anyway when DeclGroups are fully implemented. - Instead, represent (a soon to be implemented) chain of RecordDecls using a NextDecl field. The last RecordDecl in the chain is always the 'defining' RecordDecl that owns the FieldDecls. The other RecordDecls in the chain are forward declarations. llvm-svn: 55640
* - Implement __block.Steve Naroff2008-09-021-3/+10
| | | | | | - Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions. llvm-svn: 55639
* Pull code from last commit. will put back soon.Steve Naroff2008-09-021-7/+0
| | | | llvm-svn: 55637
* Implement block pseudo-storage class modifiers (__block, __byref).Steve Naroff2008-09-021-0/+7
| | | | llvm-svn: 55635
* 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
* Fix for PR2750; don't check for an 'e' in the trash after the token.Eli Friedman2008-09-021-1/+1
| | | | | | | | Note that this isn't really a complete fix; I think there are other potential overrun situations. I don't really know what the best systematic fix is, though. llvm-svn: 55622
* 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
* codegen constant data as such. add QualType::isConstant()Nuno Lopes2008-09-012-0/+12
| | | | llvm-svn: 55603
* Patch by Kovarththanan Rajaratnam!Ted Kremenek2008-08-311-0/+10
| | | | | | "This minor patch adds markup of string literals with a red colour." llvm-svn: 55589
* Handle mutation while enumerating correctly. Fix some bugs.Anders Carlsson2008-08-314-7/+79
| | | | llvm-svn: 55583
* Initial support for CodeGen of for ... in statements.Anders Carlsson2008-08-311-1/+151
| | | | llvm-svn: 55580
* Stub out CodeGenFunction::EmitObjCForCollectionStmt.Anders Carlsson2008-08-305-20/+34
| | | | | | Add CodeGenFunction::EmitMemSetToZero and make AggExprEmitter::EmitAggregateClear use it. llvm-svn: 55573
* Add code to create the fast enumeration state typeAnders Carlsson2008-08-301-1/+28
| | | | llvm-svn: 55572
* Simplify some calls to Builder.CreateCallAnders Carlsson2008-08-302-22/+17
| | | | llvm-svn: 55567
* Add Objective-C property setter support.Daniel Dunbar2008-08-3010-46/+139
| | | | | | | | | | | | | | | | | | | | | | - 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
* Refactor handling of calls:Daniel Dunbar2008-08-306-93/+158
| | | | | | | | | | | | | | | | - Added CodeGenFunction::EmitCall which just takes the callee, return type, and a list of (Value*,QualType) pairs. - Added CodeGenFunction::EmitCallArg which handles emitting code for a call argument and turning it into an appropriate (Value*,QualType) pair. - Changed Objective-C runtime interface so that the actual emission of arguments for message sends is (once again) done in the code to emit a message send. No intended functionality change, this is prep work for better ABI support and for Objective-C property setter support. llvm-svn: 55560
* Add newline at end of file.Daniel Dunbar2008-08-301-1/+1
| | | | llvm-svn: 55559
* Downgrade a number of FIXME asserts to ErrorUnsupported.Daniel Dunbar2008-08-296-25/+33
| | | | | | - Notably VLAs llvm-svn: 55544
* minor cleanupNico Weber2008-08-291-15/+4
| | | | llvm-svn: 55538
* Added LLVM comment header.Zhongxing Xu2008-08-291-0/+14
| | | | llvm-svn: 55537
* Migrate the rest symbolic analysis stuff to BasicConstraintManager.Zhongxing Xu2008-08-293-150/+172
| | | | llvm-svn: 55536
* Add special "property reference" CodeGen::LValue type for emittingDaniel Dunbar2008-08-295-9/+67
| | | | | | | | Objective-C property references. - This handles property references "more correctly" but setters still don't work. llvm-svn: 55534
* Remove dead method.Ted Kremenek2008-08-291-1/+0
| | | | llvm-svn: 55526
* Added "getBindings" and "BindingAsString" to GRStateManager and StoreManager.Ted Kremenek2008-08-292-32/+59
| | | | | | | Migrated CFRefCount.cpp to use getBindings and BindingsAsString instead of making assumptions about the Store (removed dependence on GRState::vb_iterator). llvm-svn: 55522
* Remove BasicStore.h (migrated function prototype for CreateBasicStore() to ↵Ted Kremenek2008-08-282-2/+0
| | | | | | Store.h) llvm-svn: 55519
* Remove Regions.h and Regions.cpp, since we are now using an even more ↵Ted Kremenek2008-08-281-34/+0
| | | | | | abstract representation of "memory regions" in the static analyzer. llvm-svn: 55515
* Make store "Regions" and "Bindings" more abstract instead of concrete variants.Ted Kremenek2008-08-282-13/+23
| | | | | | | | Their precise semantics will be implemented by a specific StoreManager. Use function pointer to create the StoreManager in GRStateManager. This matches how we create ConstraintsManager. llvm-svn: 55514
* Add parser/action support for block literal expressions.Steve Naroff2008-08-282-3/+81
| | | | | | Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier. llvm-svn: 55495
* Fixed analyzer caching bug involving the transfer function for loads.Ted Kremenek2008-08-281-4/+5
| | | | llvm-svn: 55494
* Fix isIntegerConstantExpr eval of __builtin_offsetof to return resultDaniel Dunbar2008-08-281-0/+1
| | | | | | | | | with correct width. - PR2728. Also, fix PR2727 test case. llvm-svn: 55493
* Fixed analyzer caching bug in DeclStmt.Ted Kremenek2008-08-281-22/+11
| | | | llvm-svn: 55487
* Fix double-free error with sizeof applied to VLA types.Daniel Dunbar2008-08-282-0/+9
| | | | | | | | - PR2727. Also, fix warning in CodeGenTypes for new BlockPointer type. llvm-svn: 55479
OpenPOWER on IntegriCloud