- Oct 21, 2008
-
-
rdar://problem/6257645Steve Naroff authored
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
-
Douglas Gregor authored
llvm-svn: 57909
-
- Oct 20, 2008
-
-
Steve Naroff authored
Sema::CheckCompareOperands() and ASTContext::mergeTypes(): Change handling 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
-
- Oct 17, 2008
-
-
Daniel Dunbar authored
llvm-svn: 57716
-
Daniel Dunbar authored
- Encode unions and bit-fields correctly. - Accept option to name record fields (used for NeXT runtime). llvm-svn: 57685
-
Daniel Dunbar authored
- Mechanism for detecting if a structure should be expanded wasn't reliable. Simplified by just keeping track of what we should be expanding. - This fixes a bug in using NSInvocation to invoke a method which returned a structure, which in used by Key Value Observing, which in the end, caused a miscompile in poor little Sketch. llvm-svn: 57675
-
Daniel Dunbar authored
llvm-svn: 57674
-
- Oct 16, 2008
-
-
Argyrios Kyrtzidis authored
llvm-svn: 57642
-
Daniel Dunbar authored
is to encode the state of the #pragma pack stack as an attribute when the structure is declared. - Extend PackedAttr to take an alignment (in bits), and reuse for both __attribute__((packed)) (which takes no argument, instead packing tightly (to "minimize the memory required") and for #pragma pack (which allows specification of the maximum alignment in bytes). __attribute__((packed)) is just encoded as Alignment=1. This conflates two related but different mechanisms, but it didn't seem worth another attribute. - I have attempted to follow the MSVC semantics as opposed to the gcc ones, since if I understand correctly #pragma pack originated with MSVC. The semantics are generally equivalent except when the stack is altered during the definition of a structure; its not clear if anyone does this in practice. See testcase if curious. llvm-svn: 57623
-
- Oct 12, 2008
-
-
Chris Lattner authored
llvm-svn: 57390
-
- Oct 05, 2008
-
-
Chris Lattner authored
llvm-svn: 57119
-
- Oct 03, 2008
-
-
Daniel Dunbar authored
llvm-svn: 56993
-
Daniel Dunbar authored
llvm-svn: 56992
-
- Sep 26, 2008
-
-
Daniel Dunbar authored
llvm-svn: 56638
-
- Sep 24, 2008
-
-
Steve Naroff authored
This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks. llvm-svn: 56554
-
- Sep 09, 2008
-
-
Steve Naroff authored
- 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
-
Steve Naroff authored
llvm-svn: 55989
-
- Sep 06, 2008
-
-
Steve Naroff authored
llvm-svn: 55862
-
- Sep 05, 2008
-
-
Ted Kremenek authored
Change struct forward declarations and definitions to use unique 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
-
Ted Kremenek authored
Remove "NextDecl" from RecordDecl. This change touches many files that 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
-
- Sep 04, 2008
-
-
Steve Naroff authored
llvm-svn: 55768
-
Steve Naroff authored
llvm-svn: 55767
-
- Aug 30, 2008
-
-
Anders Carlsson authored
llvm-svn: 55572
-
- Aug 28, 2008
-
-
Steve Naroff authored
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier. llvm-svn: 55495
-
Daniel Dunbar authored
- Added ASTContext::getObjCEncodingForPropertyDecl. llvm-svn: 55461
-
- Aug 27, 2008
-
-
Steve Naroff authored
This commit adds the declaration syntax (and associated type). llvm-svn: 55417
-
- Aug 22, 2008
-
-
Eli Friedman authored
because nothing uses the merged types yet.) llvm-svn: 55161
-
Eli Friedman authored
llvm-svn: 55160
-
Eli Friedman authored
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
-
- Aug 14, 2008
-
-
Steve Naroff authored
Fix ASTContext::getObjCEncodingForType() to limit the type info for structure bodies (mimics gcc's adhoc rules). This fixes <rdar://problem/6140902> clang ObjC rewriter: If a class contains a struct ivar with a lot of members, ... llvm-svn: 54777
-
Daniel Dunbar authored
getIntegerConstantExprValue where appropriate. llvm-svn: 54771
-
- Aug 11, 2008
-
-
Daniel Dunbar authored
- Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
-
Daniel Dunbar authored
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and SourceLocation.h) - Move ASTContext constructor into implementation llvm-svn: 54627
-
- Aug 09, 2008
-
-
Chris Lattner authored
an invalid struct decl. Thanks to Martin Doucha for the isIncompleteArrayType part of this patch. llvm-svn: 54592
-
Argyrios Kyrtzidis authored
No functionality change. llvm-svn: 54588
-
Argyrios Kyrtzidis authored
llvm-svn: 54585
-
- Aug 07, 2008
-
-
Argyrios Kyrtzidis authored
llvm-svn: 54488
-
- Aug 04, 2008
-
-
Chris Lattner authored
Finally fix PR2189. This makes a fairly invasive but important change to move getAsArrayType into ASTContext instead of being a method on type. This is required because getAsArrayType(const AT), where AT is a typedef for "int[10]" needs to return ArrayType(const int, 10). Fixing this greatly simplifies getArrayDecayedType, which is a good sign. llvm-svn: 54317
-
- Jul 26, 2008
-
-
Chris Lattner authored
of doing it directly. This is required for PR2189. llvm-svn: 54102
-
Chris Lattner authored
First, fix canonical type handling of these, since protocol qualified id's are always canonical. Next, enhance SemaType to actually make these when used (instead of int) allowing them to actually be used when appropriate. Finally remove a bunch of logic relating to the mishandling of canonical types with protocol-qual id's. This fixes rdar://5986251 llvm-svn: 54083
-