Commit Graph

95 Commits

Author SHA1 Message Date
Chris Lattner 37e0587839 remove the source location arguments to various target query methods.
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Nate Begeman 7dd8e72de9 Tabs are the enemy
llvm-svn: 47410
2008-02-20 22:57:40 +00:00
Chris Lattner 445fcabff7 Alternate address spaces work:
rename QualType::getQualifiers to getCVRQualifiers.
Add some fixme's and clean up some code relevant to qualifiers.
Change ASQualType to contain a Type* instead of a QualType.  
Any CVR qualifiers should be on the outer qual type.

llvm-svn: 47398
2008-02-20 20:55:12 +00:00
Eli Friedman bd258284e0 Split out incomplete arrays from VariableArrayType into
IncompleteArrayType.  This should make code dealing with both incomplete 
and variable length arrays much more readable, plus it allows properly 
making the distinction between isVariableArrayType() and 
isVariablyModifiedType().  The patch is a little big, but it's 
strightforward. so I don't think there should be any issues.

llvm-svn: 47165
2008-02-15 18:16:39 +00:00
Lauro Ramos Venancio d74057fa87 Fix a bitfield regression. Reported by Anders Carlsson.
llvm-svn: 46889
2008-02-08 19:46:46 +00:00
Lauro Ramos Venancio 9eff02d9f8 Simplify bitfield codegen.
Fix codegen of struct { short a[3]; int b:15; }.

llvm-svn: 46859
2008-02-07 19:29:53 +00:00
Lauro Ramos Venancio 0f166de892 Fix codegen of
struct {
  char a[3];
  unsigned char b:1;
};

Fix PR1990.

llvm-svn: 46856
2008-02-07 18:18:58 +00:00
Chris Lattner b818af539f now that ConvertTagDeclType is nice and simple, use it from UpdateCompletedType.
llvm-svn: 46809
2008-02-06 06:06:49 +00:00
Chris Lattner d11482ea22 simplify and speed up type refinement logic. No functionality change.
llvm-svn: 46808
2008-02-06 06:03:51 +00:00
Chris Lattner a64dde6b48 only convert the type name once, not each type it is refined.
llvm-svn: 46807
2008-02-06 05:48:29 +00:00
Chris Lattner 3340b92582 simplify a bunch of code.
llvm-svn: 46805
2008-02-06 05:29:46 +00:00
Chris Lattner 56096f3020 rename TypeHolderMap to TypeCache, which more aptly describes what it is.
llvm-svn: 46804
2008-02-06 05:21:55 +00:00
Chris Lattner ee9fafd533 split tagged decl layout into its own method.
llvm-svn: 46803
2008-02-06 05:18:32 +00:00
Chris Lattner f6e3669eb2 only update the llvm type for a struct when we used the struct
previously in an opaque context.  If we didn't do this, 
computing its layout could be wasted: just be lazy.

llvm-svn: 46802
2008-02-06 05:12:09 +00:00
Chris Lattner 68be60694e sink more of the type related code into CodeGenTypes.
llvm-svn: 46801
2008-02-06 05:08:19 +00:00
Chris Lattner b1537ebdd4 rewrite some of the type refinement code to eliminate dangling pointers
simplify the code and generally make it more robust.

llvm-svn: 46745
2008-02-05 08:06:13 +00:00
Chris Lattner 86964a9653 Change the key of CGRecordLayouts from being an llvm type* to being a decl*. LLVM
Type*'s can change as types are refined, so we can't use them as a stable key in
the map.  Decls don't change, so use them instead.

This patch was written by Anders, but he's too shy to commit it himself :)

llvm-svn: 46743
2008-02-05 06:55:31 +00:00
Devang Patel 6c037da51c Update outdated comment.
llvm-svn: 46737
2008-02-05 03:17:42 +00:00
Devang Patel a703a67384 Cleanup InitListExpr code generation code.
Handle padding fields while initializing struct (fix PR 1962)

llvm-svn: 46736
2008-02-05 02:39:50 +00:00
Eli Friedman 26a6dd0877 Fix memory corruption from the type map being modified while a reference
to a cell is being held.

llvm-svn: 46735
2008-02-05 02:18:07 +00:00
Devang Patel 86e7166522 Keep track of padding fields.
llvm-svn: 46734
2008-02-05 01:40:48 +00:00
Christopher Lamb 025b5fb883 Add experimental support for address space qualified types. Address space
qualifiers use the __attribute__((address_space(id))) syntax.

llvm-svn: 46691
2008-02-04 02:31:56 +00:00
Lauro Ramos Venancio bb733a2bdc Implement review feedback. Use getAsPointerType instead of cast<PointerType>.
llvm-svn: 46613
2008-01-31 15:19:04 +00:00
Lauro Ramos Venancio f5291d2871 A pointer to an opaque type is an "opaque type definition".
llvm-svn: 46575
2008-01-30 21:21:08 +00:00
Lauro Ramos Venancio 0ae6cd5219 Fix two bugs in bitfield codegen.
llvm-svn: 46255
2008-01-22 19:15:30 +00:00
Lauro Ramos Venancio 37bae3e8aa Simplify the bitfield codegen.
llvm-svn: 46230
2008-01-21 22:54:57 +00:00
Chris Lattner 41a1ef0dfe implement proper support for _Bool in memory, which is usually i8, not i1.
This fixes a crash reported by Seo Sanghyeon

llvm-svn: 45778
2008-01-09 18:47:25 +00:00
Ted Kremenek 1b0ea82459 Substituted all instances of the string "Objc" for "ObjC". This fixes
some naming inconsistencies in the names of classes pertaining to Objective-C
support in clang.

llvm-svn: 45715
2008-01-07 19:49:32 +00:00
Chris Lattner 5b12ab8c93 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.

llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Devang Patel 505b4f1fd4 Convert opaque type when struct definition is seen.
llvm-svn: 45287
2007-12-21 19:35:28 +00:00
Devang Patel 016e41e8a6 Keep track of llvm struct size while adding fields.
Update addPaddingFields() interface.

llvm-svn: 45284
2007-12-21 18:43:53 +00:00
Fariborz Jahanian 24cb52c9b0 Patch to implemented objective-c's dynamic object pointer qualified with
the protocol list (id<P,...> types).

llvm-svn: 45121
2007-12-17 21:03:50 +00:00
Christopher Lamb 77560fbde7 Update to use new PointerType::getUnqual() api.
llvm-svn: 45081
2007-12-17 01:11:20 +00:00
Devang Patel 527048247b Add assert to detect incomplete implementation work.
llvm-svn: 44974
2007-12-13 01:24:16 +00:00
Devang Patel e3f9fa6322 Refactor bit-field handling code into a separate method.
No functionality change.

llvm-svn: 44875
2007-12-11 19:51:39 +00:00
Devang Patel 7ae82e7305 Separate access field number is not required.
llvm-svn: 44833
2007-12-11 01:23:33 +00:00
Devang Patel 113bd8be70 Beautify comment.
llvm-svn: 44831
2007-12-11 00:54:19 +00:00
Devang Patel ab6aadb34a Add support to share llvm fields for bit-fields.
For example, struct { char a; short b:2; };

llvm-svn: 44830
2007-12-11 00:49:18 +00:00
Devang Patel 3c31b54b47 Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
llvm-svn: 44799
2007-12-10 18:37:40 +00:00
Devang Patel bb5c0d8960 Use getABITypeSizeInBits() instead of getTypeSizeInBits() during struct layout.
llvm-svn: 44798
2007-12-10 18:25:34 +00:00
Devang Patel 65a2288eef More struct bitfields layout work. Now handle,
struct STestB1 {char a; char b:2; } stb1;
struct STestB2 {char a; char b:5; char c:4} stb2;

llvm-svn: 44664
2007-12-06 19:16:05 +00:00
Chris Lattner 6eed001371 fix some bogus code noticed by Kevin Andre
llvm-svn: 44615
2007-12-05 17:21:34 +00:00
Christopher Lamb 7d303b2a20 Better match llvm-gcc's behavior for CodeGen naming of anonymous structs and unions.
llvm-svn: 44490
2007-12-01 09:20:34 +00:00
Christopher Lamb b0e6094a22 When generating the CodeGen type name of a struct, union, enum use the typedef
name if a tag type name is not available for the type. This matches how llvm-gcc 
chooses CodeGen type names.

This means that "typedef struct {...} foo" now results in a CodeGen name of 
"struct.foo" rather than "struct."

llvm-svn: 44489
2007-12-01 09:08:41 +00:00
Chris Lattner 1cfe02c38b update to match change in mainline llvm.
llvm-svn: 44367
2007-11-27 18:20:52 +00:00
Devang Patel ec51171319 Add assert for the case that is not handled.
struct { char a; short b:2; };

llvm-svn: 43859
2007-11-08 00:32:12 +00:00
Devang Patel 7c7a07d949 Keep track of beginning offset for the bit field that does not start at byte boundry.
llvm-svn: 43857
2007-11-08 00:17:59 +00:00
Devang Patel ef2d838fef Stay within 80 columns.
llvm-svn: 43843
2007-11-07 21:04:59 +00:00
Devang Patel b1ecfc6e25 Start struct bit field laout work.
This is far from complete.

llvm-svn: 43801
2007-11-07 01:57:13 +00:00
Devang Patel e11664a0ef Rename classes and collections that maintain record layout information.
Now, at AST level record info is maintained by ASTRecordLayout class.
Now, at code gen  level record info is maintained by CGRecordLayout class.

llvm-svn: 43619
2007-11-01 19:11:01 +00:00