summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Check in half-assed implementation of @try/@catch.Anders Carlsson2008-09-091-2/+164
| | | | llvm-svn: 55994
* Simple @throw support.Anders Carlsson2008-09-091-1/+12
| | | | llvm-svn: 55991
* Tweak implementation for allowing ObjC builtin type redefinitions.Steve Naroff2008-09-094-22/+29
| | | | | | | | | | | - Replace string comparisons with pre-defined idents. - Avoid calling isBuiltinObjCType() to avoid two checks. - Remove isBuiltinObjCType(), since it was only used in Sema::MergeTypeDefDecl(). - Have Sema::MergeTypeDefDecl() set the new type. This is a moidified version of an patch by David Chisnall. llvm-svn: 55990
* Simplify typesAreBlockCompatible().Steve Naroff2008-09-091-41/+1
| | | | llvm-svn: 55989
* Add types and functions related to exceptions.Anders Carlsson2008-09-091-0/+93
| | | | llvm-svn: 55984
* Move handling of @try and @throw to the runtime class.Anders Carlsson2008-09-096-5/+59
| | | | llvm-svn: 55983
* Change CodeGen to emit calls using (RValue,Type) list:Daniel Dunbar2008-09-099-68/+60
| | | | | | | | | | | | | | - Add CodeGenFunction::EmitAnyExprToTemp o Like EmitAnyExpr, but emits aggregates to a temporary location if none is available. Seems like this should be simpler (even aside from using first class aggregates). - Killed CodeGenFunction::EmitCallArg (just append the pair) - Conversion of RValues to actual call arguments is now isolated in CodeGenFunction::EmitCall. llvm-svn: 55970
* Fix a number of issues w.r.t. emission of global for functions andDaniel Dunbar2008-09-082-70/+123
| | | | | | | | | | | | | | aliases. - Attributes specific to a definition are only set when the definition is seen. - Alias generation is delayed until the end of the module; necessary since the alias may reference forward. - Fixes: PR2743, <rdr://6140807&6094512> - Improves: <rdr://6095112> (added XFAIL) Also, print module on verification failures. llvm-svn: 55966
* Refactor parameter attribute handling:Daniel Dunbar2008-09-086-114/+230
| | | | | | | | | - Add CGCall.h for dealing with ABI issues related to calls. - Add CGFunctionInfo and CGCallInfo for capturing ABI relevant information about functions and calls. - Isolate LLVM parameter attribute handling inside CGCall.cpp llvm-svn: 55963
* Add ThreadSpecified bit to Decl.Daniel Dunbar2008-09-081-5/+4
| | | | | | - Patch from Kevin Tew. llvm-svn: 55940
* Support C++'s declaration-statement.Argyrios Kyrtzidis2008-09-071-1/+2
| | | | llvm-svn: 55888
* rename libclangSEMA to libclangSemaNico Weber2008-09-071-1/+1
| | | | llvm-svn: 55887
* Key LLVM types for TagDecl's off of the clang Type, since there is nowDaniel Dunbar2008-09-062-15/+27
| | | | | | a many-to-one relationship between TagDecl's and types. llvm-svn: 55870
* Per PR2773, define __USER_LABEL_PREFIX__ for x86-32 Linux and Windows.Eli Friedman2008-09-061-0/+2
| | | | | | | | | | If you're on some other platform, the correct definition for this macro would be appreciated; to find the correct definition, just run the following command: echo | gcc -dM -E - | grep USER_LABEL_PREFIX llvm-svn: 55869
* More type checking for blocks. Still incomplete (will hopefully finish up ↵Steve Naroff2008-09-054-31/+103
| | | | | | this weekend). llvm-svn: 55862
* Add comment back that Argiris pointed out that I mistakenly removed (the ↵Ted Kremenek2008-09-051-0/+2
| | | | | | comments below it were stale, so I accidently removed the whole thing). llvm-svn: 55841
* Change struct forward declarations and definitions to use unique ↵Ted Kremenek2008-09-056-90/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RecordDecls, as opposed to creating a single RecordDecl and reusing it. This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet). The motivation of this patch is as follows: - Capture more source information, necessary for refactoring/rewriting clients. - Pave the way to resolve ownership issues with RecordDecls with the forthcoming addition of DeclGroups. Current caveats: - Until DeclGroups are in place, we will leak RecordDecls not explicitly referenced by the AST. For example: typedef struct { ... } x; The RecordDecl for the struct will be leaked because the TypedefDecl doesn't refer to it. This will be solved with DeclGroups. - This patch also (temporarily) breaks CodeGen. More below. High-level changes: - As before, TagType still refers to a TagDecl, but it doesn't own it. When a struct/union/class is first referenced, a RecordType and RecordDecl are created for it, and the RecordType refers to that RecordDecl. Later, if a new RecordDecl is created, the pointer to a RecordDecl in RecordType is updated to point to the RecordDecl that defines the struct/union/class. - TagDecl and RecordDecl now how a method 'getDefinition()' to return the TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular enum/struct/class/union. This is useful from going from a RecordDecl* that defines a forward declaration to the RecordDecl* that provides the actual definition. Note that this also works for EnumDecls, except that in this case there is no distinction between forward declarations and definitions (yet). - Clients should no longer assume that 'isDefinition()' returns true from a RecordDecl if the corresponding struct/union/class has been defined. isDefinition() only returns true if a particular RecordDecl is the defining Decl. Use 'getDefinition()' instead to determine if a struct has been defined. - The main changes to Sema happen in ActOnTag. To make the changes more incremental, I split off the processing of enums and structs et al into two code paths. Enums use the original code path (which is in ActOnTag) and structs use the ActOnTagStruct. Eventually the two code paths will be merged, but the idea was to preserve the original logic both for comparison and not to change the logic for both enums and structs all at once. - There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls that correspond to the same type simply have a pointer to that type. If we need to figure out what are all the RecordDecls for a given type we can build a backmap. - The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the changes to RecordDecl. For some reason 'svn' marks the entire file as changed. Why is CodeGen broken: - Codegen assumes that there is an equivalence between RecordDecl* and RecordType*. This was true before because we only created one RecordDecl* for a given RecordType*, but it is no longer true. I believe this shouldn't be too hard to change, but the patch was big enough as it is. I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C). llvm-svn: 55839
* Support "typeof unary-expression" (GNU C++ extension).Argyrios Kyrtzidis2008-09-051-4/+22
| | | | llvm-svn: 55833
* Set different header search paths for the Windows platform.Argyrios Kyrtzidis2008-09-051-9/+17
| | | | llvm-svn: 55832
* Add header search paths for Mingw32 (GCC version 4).Argyrios Kyrtzidis2008-09-051-0/+9
| | | | llvm-svn: 55830
* Line endings: CRLF -> LFArgyrios Kyrtzidis2008-09-051-8/+8
| | | | llvm-svn: 55829
* Remove stale comments.Ted Kremenek2008-09-051-8/+0
| | | | llvm-svn: 55822
* Remove "NextDecl" from RecordDecl. This change touches many files that ↵Ted Kremenek2008-09-057-52/+16
| | | | | | | | where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration. The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType. llvm-svn: 55821
* Set sext/zext on function result.Daniel Dunbar2008-09-051-5/+12
| | | | | | - <rdar://problem/6156739> llvm-svn: 55815
* Set function attributes (sext, zext, etc.) on Objective-C methods.Daniel Dunbar2008-09-043-31/+73
| | | | llvm-svn: 55812
* Fix infinite loop in for ... in code generation.Daniel Dunbar2008-09-041-1/+1
| | | | | | - Patch via Thomas Clement, thanks! llvm-svn: 55804
* Fix CFG construction bug:Ted Kremenek2008-09-041-9/+15
| | | | | | | - Within for loops, 'continue' should jump to a basic block containing the increment code llvm-svn: 55800
* Prevent invalid warnings about incomplete implementations for methodsDaniel Dunbar2008-09-042-15/+28
| | | | | | which are inherited from base clases or protocols. llvm-svn: 55790
* Touchup CheckSingleAssignmentConstraints() and CheckCompareOperands() to ↵Steve Naroff2008-09-041-1/+19
| | | | | | | | check for block pointers. Added a couple FIXME's wrt PointLikeType. If the author reads this, it would be great to get some background on this class (thanks in advance). llvm-svn: 55778
* Fix a handful of typos (closure->block) to avoid confusion.Steve Naroff2008-09-043-5/+5
| | | | llvm-svn: 55768
* Add type checking for blocks.Steve Naroff2008-09-043-0/+143
| | | | llvm-svn: 55767
* Generate error if we try to implicit cast between different addressMon P Wang2008-09-041-5/+20
| | | | | | spaces llvm-svn: 55765
* NeXT: Emit lazy reference to Protocol class for forward protocolDaniel Dunbar2008-09-041-0/+5
| | | | | | references (to match gcc). llvm-svn: 55760
* Avoid superfluous errors regarding variable-length arrays (casts).Daniel Dunbar2008-09-045-9/+23
| | | | llvm-svn: 55759
* 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
OpenPOWER on IntegriCloud