Граф коммитов

20 Коммитов

Автор SHA1 Сообщение Дата
John McCall 9b7da1c46d Perform zero-initialization of virtual base classes when emitting
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125555 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 06:40:56 +00:00
John McCall d9e0ff273f A CGRecordLayout object persists. Since its contained types may
refer to opaque types, they must be held via PATypeHolders.  I'm
not sure why this hasn't blown up before.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 23:21:46 +00:00
Anders Carlsson ba2c2eec87 CGRecordLayout types are always struct types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24 19:37:16 +00:00
Anders Carlsson 9a5a3f2f3b Rename BaseLLVMType to NonVirtualBaseLLVMType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21 23:59:45 +00:00
Anders Carlsson 3d155e683a Introduce the concept of a non-virtual base type to CGRecordLayoutBuilder as a first step towards fixing PR6995.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 05:25:47 +00:00
Daniel Dunbar e7a80bd66a IRgen: Move CGBitFieldInfo strategy computation helpers to static member
functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112913 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:53:28 +00:00
John McCall f16aa103d3 Go back to asking CodeGenTypes whether a type is zero-initializable.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 21:01:12 +00:00
Anders Carlsson c6772ce9c8 Keep track of the LLVM field numbers for non-virtual bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104013 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 05:22:06 +00:00
Daniel Dunbar 50810d355a Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 14:51:07 +00:00
Daniel Dunbar 2df2569679 IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor arguments, it is now an immutable object.
Also, add some checking of various invariants that should hold on the CGBitFieldInfo access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 05:09:32 +00:00
Daniel Dunbar 7fb6195004 IRgen: Eliminate now unused fields from CGBitFieldInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-15 05:09:28 +00:00
Daniel Dunbar e792584917 IRgen: Tweak CGBitFieldInfo doxyments & add an accessor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-14 04:07:59 +00:00
Daniel Dunbar ab970f90ce IRgen: Enhance CGBitFieldInfo with enough information to fully describe the "policy" with which a bit-field should be accessed.
- For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts).

 - Design comments appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 20:58:55 +00:00
Daniel Dunbar 93c62967d4 IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101051 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-12 18:14:18 +00:00
Daniel Dunbar 7f2896406c IRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValues to just store the base address of object containing the bit-field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 02:59:45 +00:00
Daniel Dunbar efbf487da8 IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-06 01:07:44 +00:00
Daniel Dunbar 2eec0b2e3e IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-05 16:20:44 +00:00
Daniel Dunbar 198bcb44b6 IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGenTypes, to per-record CGRecordLayout structures.
- I did a cursory check that this was perf neutral, FWIW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99978 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 01:09:11 +00:00
Daniel Dunbar 270e203b50 IRGen: Hide CGRecordLayoutBuilder class, because I can.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 00:11:27 +00:00
Daniel Dunbar 2924ade97e IRgen: Move CGRecordLayout to its own happy little file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:26:10 +00:00