Anders Carlsson
b136e626ea
Simplify EmitCopyCtorCall.
...
llvm-svn: 102849
2010-05-01 17:07:40 +00:00
Anders Carlsson
aab3b57359
Simplify EmitClassAggrMemberwiseCopy.
...
llvm-svn: 102848
2010-05-01 17:02:18 +00:00
Anders Carlsson
ab826ad169
Clean up EmitClassMemberwiseCopy further.
...
llvm-svn: 102846
2010-05-01 16:54:05 +00:00
Anders Carlsson
820022c55c
Get rid of a parameter from EmitClassMemberwiseCopy.
...
llvm-svn: 102845
2010-05-01 16:49:43 +00:00
Anders Carlsson
7911150a3d
When defining implicit copy constructors, use SetBaseOrMemberInitializers to initialize the bases.
...
llvm-svn: 102842
2010-05-01 16:39:01 +00:00
Anders Carlsson
d6c5391cd9
Remove an unnecessary parameter from EmitClassCopyAssignment.
...
llvm-svn: 102747
2010-04-30 19:45:28 +00:00
John McCall
b3cec96a7c
Account for the VTT argument when making an implicit copy constructor for
...
a class with virtual bases. Just a patch until Sema starts (correctly) doing
most of this analysis.
Fixes PR 6622.
llvm-svn: 102692
2010-04-30 05:56:45 +00:00
Anders Carlsson
786a3d910e
Get the base class addresses before calling EmitClassCopyAssignment.
...
llvm-svn: 102676
2010-04-30 00:04:01 +00:00
Anders Carlsson
2b4ec8d003
Remove an unnecessary argument to EmitClassCopyAssignment.
...
llvm-svn: 102674
2010-04-29 23:51:42 +00:00
Anders Carlsson
06eed9bee2
Land another cleanup patch.
...
llvm-svn: 102293
2010-04-25 01:03:12 +00:00
Anders Carlsson
53e1ba948d
Revert enough of my patches to fix self-host again :(
...
llvm-svn: 102289
2010-04-25 00:52:09 +00:00
Anders Carlsson
dde8b46e62
Cleanup SynthesizeCXXCopyConstructor.
...
llvm-svn: 102286
2010-04-24 23:11:18 +00:00
Anders Carlsson
84e3b62ac0
Clean up SynthesizeCXXCopyAssignment a little.
...
llvm-svn: 102285
2010-04-24 23:09:21 +00:00
Anders Carlsson
c4ba0cd2ea
RenameGetAddressOfBaseOfCompleteClass to GetAddressOfDirectBaseInCompleteClass to reflect that it only handles direct bases.
...
llvm-svn: 102284
2010-04-24 23:01:49 +00:00
Anders Carlsson
26b6e23d57
More cleanup.
...
llvm-svn: 102282
2010-04-24 22:43:39 +00:00
Anders Carlsson
9523ad4fd3
Simplify EmitClassMemberwiseCopy now that it's only used for fields.
...
llvm-svn: 102281
2010-04-24 22:36:50 +00:00
Anders Carlsson
90235beb55
DefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create implicit base initializers. (Member initializers are still handled by CodeGenFunction::SynthesizeCXXCopyConstructor for now).
...
llvm-svn: 102279
2010-04-24 22:25:18 +00:00
Anders Carlsson
bea9e74e82
Rename GetAddressOfBaseClass to OldGetAddressOfBaseClass.
...
llvm-svn: 102275
2010-04-24 21:51:08 +00:00
Anders Carlsson
795213efde
Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to use the new version.
...
llvm-svn: 102274
2010-04-24 21:27:51 +00:00
Anders Carlsson
8a64c1c94c
Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.
...
llvm-svn: 102273
2010-04-24 21:23:59 +00:00
Anders Carlsson
c6eaea70af
Convert more call sites over to the new GetAddressOfBaseClass.
...
llvm-svn: 102272
2010-04-24 21:12:55 +00:00
Anders Carlsson
d829a02514
Add a new GetAddressOfBaseClass overload that takes a base path and. Use it for derived-to-base casts.
...
llvm-svn: 102270
2010-04-24 21:06:20 +00:00
Anders Carlsson
34f54d55e2
Comment out an assert for now.
...
llvm-svn: 102007
2010-04-21 18:03:05 +00:00
Anders Carlsson
91baecfeb3
Back out r101911 and see if it makes the bots happy.
...
llvm-svn: 101921
2010-04-20 18:05:10 +00:00
Anders Carlsson
6a0227df49
Fix a bug which triggered the assertion I added yesterday. Basically, when we initialize the vtable pointer for a virtual base, and there was another path from the most derived class to another base with the same class type, we would use the wrong base.
...
llvm-svn: 101911
2010-04-20 16:22:16 +00:00
Anders Carlsson
53cebd1ea6
Move code to apply a non-virtual and virtual offset out into a separate function.
...
llvm-svn: 101909
2010-04-20 16:03:35 +00:00
Anders Carlsson
652758c3ec
Pass the nearest virtual base decl to InitializeVTablePointers. No functionality change right now.
...
llvm-svn: 101872
2010-04-20 05:22:15 +00:00
Anders Carlsson
3d4218570a
Assert that the path from the derived to the base class in CodeGenFunction::GetAddressOfBaseClass is not ambiguous.
...
llvm-svn: 101869
2010-04-20 05:07:22 +00:00
Douglas Gregor
c4df407604
Keep track of the actual storage specifier written on a variable or
...
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.
llvm-svn: 101826
2010-04-19 22:54:31 +00:00
Anders Carlsson
1c0f8bb4ce
Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.
...
llvm-svn: 101004
2010-04-12 00:51:03 +00:00
Rafael Espindola
c50c27cca8
the big refactoring bits of PR3782.
...
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920
2010-03-30 20:24:48 +00:00
Anders Carlsson
f141dd1b95
Remove the old vtable layout code.
...
llvm-svn: 99869
2010-03-30 03:43:47 +00:00
Anders Carlsson
9d08fc1cd2
Use the new function in EmitClassAggrMemberwiseCopy, fixing the same assert as seen in PR6628 but for arrays this time.
...
llvm-svn: 99867
2010-03-30 03:30:08 +00:00
Anders Carlsson
093bdff0c5
Factor emitting a call to a copy constructor out into a separate function.
...
llvm-svn: 99866
2010-03-30 03:27:09 +00:00
Anders Carlsson
b9fd57f198
Introduce a CXXTemporariesCleanupScope RAII object and use it to cleanup the temporaries code.
...
llvm-svn: 99865
2010-03-30 03:14:41 +00:00
Anders Carlsson
10834b8d56
Handle default arguments when calling copy constructors for bases or members when synthesizing a copy constructor. Fixes PR6628.
...
llvm-svn: 99864
2010-03-30 02:57:48 +00:00
Anders Carlsson
383f4cc8b9
Flip the switch to always get vtables from the VTT when necessary, I've verified that clang bootstraps with this.
...
llvm-svn: 99800
2010-03-29 02:38:51 +00:00
Anders Carlsson
f6f24c609b
Cleanup, no functionality change.
...
llvm-svn: 99798
2010-03-29 02:08:26 +00:00
Anders Carlsson
948d3f4ec6
Fix another thinko, so that flags don't depend on previous bases.
...
llvm-svn: 99791
2010-03-29 01:16:41 +00:00
Anders Carlsson
74d7dfcf8e
When generating base ctors/dtors, we need to lookup virtual bases using the vtable.
...
llvm-svn: 99790
2010-03-29 01:14:25 +00:00
Anders Carlsson
5889027ccc
Use construction vtables when needed. This is currently guarded by -fdump-vtable-layouts since it doesn't work 100% yet :)
...
llvm-svn: 99787
2010-03-29 01:08:49 +00:00
Anders Carlsson
d589593c93
Reapply r99775 with a fix for a silly bug - we were setting the vtable pointer for all bases, even those without a vtable pointer :)
...
llvm-svn: 99777
2010-03-28 21:07:49 +00:00
Anders Carlsson
fcc9f91287
Looks like I broke self-host again :(.
...
llvm-svn: 99776
2010-03-28 20:55:21 +00:00
Anders Carlsson
74eab715ae
More improvements to setting the vtable pointer. We now no longer set the vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors.
...
llvm-svn: 99775
2010-03-28 20:34:31 +00:00
Anders Carlsson
e87fae9afa
Factor vtable pointer setting code out into a separate function.
...
llvm-svn: 99773
2010-03-28 19:40:00 +00:00
Anders Carlsson
aaf8acfea1
Revert r99612 and see if it fixes self-host.
...
llvm-svn: 99614
2010-03-26 06:35:42 +00:00
Anders Carlsson
6fffc64dd2
Don't initialize virtual pointers for primary bases, they've already been initialized.
...
llvm-svn: 99612
2010-03-26 05:53:12 +00:00
Anders Carlsson
1f9348c1fc
Simplify InitializeVtablePtrs in preparation of making it work with construction vtables.
...
llvm-svn: 99609
2010-03-26 04:39:42 +00:00
Anders Carlsson
67fbf9853f
Use getNamedGlobal instead of getGlobalVariable. (Fixes self-host).
...
llvm-svn: 99385
2010-03-24 05:32:05 +00:00
Anders Carlsson
b35ea55e2e
More vtable work; preparations for moving over to the new vtable layout code (finally).
...
llvm-svn: 99381
2010-03-24 03:57:14 +00:00