summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-2/+2
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* switch clang to use the new-new way of creating llvm::StructType's.Chris Lattner2011-08-121-2/+2
| | | | llvm-svn: 137472
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-3/+3
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-181-6/+6
| | | | llvm-svn: 135370
* clang side to match the LLVM IR type system rewrite patch.Chris Lattner2011-07-091-29/+27
| | | | llvm-svn: 134831
* IRgen: Add a -fuse-register-sized-bitfield-access option, for testing.Daniel Dunbar2011-06-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changes bit-field access policy to try to use (aligned) register sized accesses. The idea here is that by using larger accesses we expose more coalescing potential to the backend when we have situations like adjacent bit-fields in the same structure (which is common), and that the backend should be smart enough to narrow the accesses down when no coalescing is done or when it is shown not to be profitable. -- $ clang -m32 -O3 -S -o - t.c _f0: ## @f0 pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movb (%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, (%eax) movb 1(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 1(%eax) movb 2(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 2(%eax) movb 3(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 3(%eax) popl %ebp ret $ clang -m32 -O3 -S -o - t.c -Xclang -fuse-register-sized-bitfield-access _f0: ## @f0 pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movl $-2139062144, %ecx ## imm = 0xFFFFFFFF80808080 andl (%eax), %ecx orl $16843009, %ecx ## imm = 0x1010101 movl %ecx, (%eax) popl %ebp ret -- llvm-svn: 133532
* Introduce Type::isSignedIntegerOrEnumerationType() andDouglas Gregor2011-05-201-1/+1
| | | | | | | | | | | | | Type::isUnsignedIntegerOrEnumerationType(), which are like Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also consider the underlying type of a C++0x scoped enumeration type. Audited all callers to the existing functions, switching those that need to also handle scoped enumeration types (e.g., those that deal with constant values) over to the new functions. Fixes PR9923 / <rdar://problem/9447851>. llvm-svn: 131735
* Finish off rules for z-length bitfields in ms_structFariborz Jahanian2011-05-031-4/+2
| | | | | | structs. // rdar://8823265 llvm-svn: 130783
* More rule enforcement of zero bitfields for ms_struct.Fariborz Jahanian2011-05-021-2/+4
| | | | llvm-svn: 130696
* Some refactoring of my ms_struct patch.Fariborz Jahanian2011-04-271-7/+2
| | | | | | // rdar://8823265 related. llvm-svn: 130311
* With ms_struct attribut, Zero-length bitfields following Fariborz Jahanian2011-04-261-4/+42
| | | | | | non-bitfield members are ignore. // rdar://8823265 wip llvm-svn: 130257
* Simplify AppendTailPadding() by converting its parameter to CharUnits. NoKen Dyck2011-04-241-11/+7
| | | | | | change in functionality intended. llvm-svn: 130108
* Eliminate literal 8s from LayoutUnionField by converting NumBytesToAppend toKen Dyck2011-04-241-4/+5
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 130107
* Eliminate literal 8s from LayoutBitField(), converting variables toKen Dyck2011-04-241-10/+16
| | | | | | | CharUnits or replacing the 8s with char align. No change in functionality intended. llvm-svn: 130106
* Convert AccessInfo::AccessAlignment to CharUnits. No change in functionalityKen Dyck2011-04-241-2/+3
| | | | | | intended. llvm-svn: 130087
* Convert CGBitFieldInfo::FieldByteOffset to CharUnits. No change inKen Dyck2011-04-241-4/+5
| | | | | | functionality intended. llvm-svn: 130085
* When laying out bases in, always try the "base subobject" LLVM type. If itAnders Carlsson2011-04-171-14/+66
| | | | | | | | | | | | | turns out that a field or base needs to be laid out in the tail padding of the base, CGRecordLayoutBuilder::ResizeLastBaseFieldIfNecessary will convert it to an array of i8. I've audited the new test results to make sure that they are still valid. I've also verified that we pass a self-host with this change. This (finally) fixes PR5589! llvm-svn: 129673
* Use a SmallVector for field types in CGRecordLayoutBuilder now that ↵Anders Carlsson2011-04-171-1/+1
| | | | | | llvm::StructType::get takes an ArrayRef. llvm-svn: 129667
* Fix typo in comment.Nick Lewycky2011-03-221-1/+1
| | | | llvm-svn: 128088
* A much-delayed response to Ken Dyck's review: make this somewhat moreJohn McCall2011-02-261-10/+16
| | | | | | char-width agnostic. llvm-svn: 126542
* improve support for big endian targets, fixing PR8171, patchChris Lattner2011-02-171-2/+15
| | | | | | by Heikki Kultala! llvm-svn: 125784
* Refactor CGRecordLayoutBuilder to use CharUnits more consistently.John McCall2011-02-151-144/+162
| | | | llvm-svn: 125605
* Perform zero-initialization of virtual base classes when emitting John McCall2011-02-151-112/+100
| | | | | | | | | | | | a zero constant for a complete class. rdar://problem/8424975 To make this happen, track the field indexes for virtual bases in the complete object. I'm curious whether we might be better off making CGRecordLayoutBuilder *much* more reliant on ASTRecordLayout; we're currently duplicating an awful lot of the ABI layout logic. llvm-svn: 125555
* Convert RecordLayout::Alignment to CharUnits from bit units. No change inKen Dyck2011-02-151-3/+4
| | | | | | functionality intended. llvm-svn: 125549
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-7/+4
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Drop the 'InBits' part from the name of RecordSizeInBits as the value is inKen Dyck2011-02-101-5/+5
| | | | | | character units. llvm-svn: 125281
* Eliminate some signed-to-unsigned comparision warnings introduced inKen Dyck2011-02-101-2/+4
| | | | | | r125156. llvm-svn: 125280
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-6/+9
| | | | | | functionality intended. llvm-svn: 125156
* Convert RecordLayout::NonVirtualAlign to CharUnits. No change inKen Dyck2011-02-081-5/+10
| | | | | | functionality intended. llvm-svn: 125069
* Convert RecordLayout::NonVirtualSize from bit units to CharUnits.Ken Dyck2011-02-011-6/+7
| | | | llvm-svn: 124646
* Fix another obscure corner layout case.Argyrios Kyrtzidis2010-12-101-9/+13
| | | | llvm-svn: 121436
* Add a LayoutBase member function. No functionality change.Anders Carlsson2010-12-041-15/+22
| | | | llvm-svn: 120924
* Replace calls to AppendBytes with calls to AppendPadding when the bytes ↵Anders Carlsson2010-12-041-11/+6
| | | | | | appended are padding. llvm-svn: 120922
* CGRecordLayoutBuilder does not need to be exported from this module.John McCall2010-11-301-3/+1
| | | | llvm-svn: 120489
* Don't store the maximum alignment, we can trivially compute it.Anders Carlsson2010-11-281-12/+21
| | | | llvm-svn: 120268
* More work on laying out virtual bases.Anders Carlsson2010-11-281-9/+46
| | | | llvm-svn: 120257
* Begin work on actually laying out virtual bases.Anders Carlsson2010-11-251-1/+32
| | | | llvm-svn: 120140
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-241-2/+2
| | | | llvm-svn: 120133
* Add CXXRecordDecl::getIndirectPrimaryBases.Anders Carlsson2010-11-241-1/+6
| | | | llvm-svn: 120129
* Simplify code.Anders Carlsson2010-11-241-13/+1
| | | | llvm-svn: 120109
* CGRecordLayout types are always struct types.Anders Carlsson2010-11-241-4/+4
| | | | llvm-svn: 120106
* Remove FIXME; we don't ever want to lay out empty bases.Anders Carlsson2010-11-221-7/+6
| | | | llvm-svn: 119957
* Rename BaseLLVMType to NonVirtualBaseLLVMType.Anders Carlsson2010-11-211-2/+2
| | | | llvm-svn: 119956
* Add getCGRecordLayout helper function. No functionality change.Anders Carlsson2010-11-211-6/+13
| | | | llvm-svn: 119955
* Remove debugging printf.Nick Lewycky2010-11-091-3/+0
| | | | | | Fix linux build. llvm-svn: 118497
* Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as ↵Anders Carlsson2010-11-091-9/+109
| | | | | | a first step towards fixing PR6995. llvm-svn: 118491
* Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson2010-10-311-1/+1
| | | | | | getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
* IRgen: Move CGBitFieldInfo strategy computation helpers to static memberDaniel Dunbar2010-09-021-11/+23
| | | | | | functions. llvm-svn: 112913
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-26/+21
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar2010-05-271-2/+3
| | | | llvm-svn: 104795
OpenPOWER on IntegriCloud