Ken Dyck
496906629b
Convert the offsets in VCallOffsetMap to CharUnits. No change in
...
functionality intended.
llvm-svn: 128753
2011-04-02 00:51:15 +00:00
Ken Dyck
eff7fe645b
Convert offset parameters of VTableBuilder::IsOverriderUsed() to CharUnits.
...
No change in functionality intended.
llvm-svn: 128752
2011-04-02 00:44:58 +00:00
Ken Dyck
4680e9219a
Convert the return value of
...
VCallAndVBaseOffsetBuilder::getCurrentOffsetOffset() to CharUnits. No change
in functionality intended.
llvm-svn: 128603
2011-03-31 01:08:46 +00:00
Ken Dyck
47e1e54343
Convert the OffsetInLayoutClass parameter of
...
VCallAndVBaseOffsetBuilder::AddVBaseOffsets() to CharUnits. No change in
functionality intended.
llvm-svn: 128600
2011-03-31 00:56:47 +00:00
Ken Dyck
1a93b3b080
Convert the OffsetInLayoutClass of the VCallAndVBaseOffsetBuilder
...
constructor to CharUnits. No change in functionality intended.
llvm-svn: 128598
2011-03-31 00:48:04 +00:00
Ken Dyck
9b32ee1611
Convert the RealBaseOffset parameter of
...
VCallAndVBaseOffsetBuilder::AddVCallAndVBaseOffsets() to
CharUnits. No change in functionality intended.
llvm-svn: 128596
2011-03-31 00:37:24 +00:00
Jay Foad
20c0f02cc5
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
...
PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128538
2011-03-30 11:28:58 +00:00
Ken Dyck
b3ba775523
Convert the offset parameter of
...
VCallAndVBaseOffsetBuilder::AddVCallOffsets() to CharUnits. No change in
functionality intended.
llvm-svn: 128531
2011-03-30 10:11:40 +00:00
Ken Dyck
075de167f8
Convert local offset variable to CharUnits in AddVCallOffsets. No change in
...
functionality intended.
llvm-svn: 128522
2011-03-30 01:21:33 +00:00
Ken Dyck
078f3e6905
Convert a local offset variable to CharUnits. No change in functionality
...
intended.
llvm-svn: 128521
2011-03-30 01:14:22 +00:00
Ken Dyck
032a903982
Convert the OffsetInLayoutClass parameter of DeterminePrimaryVirtualBases()
...
to CharUnits. No change in functionality intended.
llvm-svn: 128520
2011-03-30 01:10:23 +00:00
Ken Dyck
45956a467e
Convert the OffsetInLayoutClass parameter of LayoutSecondaryVTables to
...
CharUnits. No change in functionality intended.
llvm-svn: 128516
2011-03-30 00:50:28 +00:00
Ken Dyck
f9742cca31
Convert offset parameter in LayoutPrimaryAndSecondaryVTables() to CharUnits.
...
No change in functionality intended.
llvm-svn: 128393
2011-03-27 20:33:38 +00:00
Ken Dyck
9a7e532dd8
Convert VTableBuilder::MostDerivedClassOffset to CharUnits. No change in
...
functionality intended.
llvm-svn: 128392
2011-03-27 20:20:28 +00:00
Ken Dyck
0d5804a622
Convert FinalOverriders::MostDerivedClassOffset to CharUnits. No change in
...
functionality intended.
llvm-svn: 128391
2011-03-27 20:10:29 +00:00
Ken Dyck
5f3601d35a
Remove a fixed FIXME comment (the base offset has already been converted to
...
CharUnits).
llvm-svn: 128386
2011-03-27 19:19:52 +00:00
Ken Dyck
f4be03ae04
Convert the offset parameters of AddMethods() to CharUnits. No change in
...
functionality intended.
llvm-svn: 128385
2011-03-27 19:15:11 +00:00
Ken Dyck
f736d9cb75
Convert the BaseOffsetInLayoutClass parameter of ComputeThisAdjustment() to
...
CharUnits. No change in functionality intended.
llvm-svn: 128384
2011-03-27 19:03:44 +00:00
Ken Dyck
7d876f3649
Convert offset members in MethodInfo to CharUnits. No change in
...
functionality intended.
llvm-svn: 128383
2011-03-27 18:57:53 +00:00
John McCall
358d056c14
We were emitting construction v-tables with internal linkage all the time.
...
Emit them instead with the linkage of the VTT.
I'm actually really ambivalent about this; it's what GCC does, but outside
of improving code size (if the linkage is coalescing), I'm not sure it's
at all relevant. Construction vtables are naturally referenced only by the
VTT, which is itself only referenced by complete-object constructors and
destructors; giving the construction vtables possibly-external linkage is
important if you have an optimization that drills through the VTT to a
reference to a particular construction vtable which it cannot just emit
itself.
llvm-svn: 128374
2011-03-27 09:00:25 +00:00
Douglas Gregor
1baf38f5a6
On Mac OS X, the presence of an 'availability' attribute for that
...
platform implies default visibility. To achieve these, refactor our
lookup of explicit visibility so that we search for both an explicit
VisibilityAttr and an appropriate AvailabilityAttr, favoring the
VisibilityAttr if it is present.
llvm-svn: 128336
2011-03-26 12:10:19 +00:00
Ken Dyck
58863dc46a
Convert the OffsetInLayoutClass parameter of
...
FinalOverriders::ComputeBaseOffsets() to CharUnits. No change in
functionality intended.
llvm-svn: 128323
2011-03-26 01:36:26 +00:00
Ken Dyck
785cbdb6da
Convert FinalOverriders::Offset to CharUnits. No change in functionality
...
intended.
llvm-svn: 128321
2011-03-26 01:29:16 +00:00
Ken Dyck
808457cfd6
Convert offset in MethodBaseOffsetPairTy to CharUnits. No change in
...
functionality intended.
llvm-svn: 128318
2011-03-26 01:18:17 +00:00
Ken Dyck
70b47e08dc
Convert the offsets in SubobjectOffsetMapTy to CharUnits. No change in
...
functionality intended.
llvm-svn: 128317
2011-03-26 01:09:13 +00:00
Ken Dyck
ce81203d9b
Convert several local variables to CharUnits. No change in functionality
...
intended.
llvm-svn: 128315
2011-03-26 00:51:24 +00:00
Ken Dyck
16ffcac1a2
Convert the BaseOffset member of BaseSubobject to CharUnits from bits. No
...
change in functionality intended.
llvm-svn: 128190
2011-03-24 01:21:01 +00:00
John McCall
32ea969415
Use a slightly more semantic interface for emitting call arguments.
...
llvm-svn: 127494
2011-03-11 20:59:21 +00:00
John McCall
5fe009660d
Tame this assert, hopefully fixing self-host.
...
llvm-svn: 127319
2011-03-09 07:12:35 +00:00
John McCall
a738c25f5e
Use the "undergoes default argument promotion" bit on parameters to
...
simplify the logic of initializing function parameters so that we don't need
both a variable declaration and a type in FunctionArgList. This also means
that we need to propagate the CGFunctionInfo down in a lot of places rather
than recalculating it from the FAL. There's more we can do to eliminate
redundancy here, and I've left FIXMEs behind to do it.
llvm-svn: 127314
2011-03-09 04:27:21 +00:00
Tilmann Scheller
99cc30c371
Revert "Add CC_Win64ThisCall and set it in the necessary places."
...
This reverts commit 126863.
llvm-svn: 126886
2011-03-02 21:36:49 +00:00
Tilmann Scheller
e60baf731b
Revert "Add preliminary support for MSVC-style vtables."
...
This reverts commit 126865.
llvm-svn: 126876
2011-03-02 20:40:50 +00:00
Tilmann Scheller
a6c995dbb2
Add preliminary support for MSVC-style vtables.
...
llvm-svn: 126865
2011-03-02 19:38:28 +00:00
Tilmann Scheller
454464b491
Add CC_Win64ThisCall and set it in the necessary places.
...
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
Rafael Espindola
3968cd0f7b
For consistency, use llvm::raw_ostream in the rest of the mangle api.
...
llvm-svn: 125360
2011-02-11 02:52:17 +00:00
John McCall
ad7c5c1657
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
...
Block{Function,Module} base class. Minor other refactorings.
Fixed a few address-space bugs while I was there.
llvm-svn: 125085
2011-02-08 08:22:06 +00:00
Anders Carlsson
e866d44417
Fix self-host; if a thunk already exists and has available_externally linkage, we should change its linkage instead of asserting.
...
llvm-svn: 124986
2011-02-06 20:09:44 +00:00
Anders Carlsson
8b02183ff3
When building with optimizations, emit thunks with available_externally linkage so devirtualized function calls can also be de-thunked.
...
llvm-svn: 124984
2011-02-06 18:31:40 +00:00
Anders Carlsson
fe8a9939f9
Simplify thunks code.
...
llvm-svn: 124983
2011-02-06 17:15:43 +00:00
Anders Carlsson
73f97534b0
Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we
...
won't assert when building a thunk for an implicit virtual member function that is not marked used.
llvm-svn: 124967
2011-02-05 18:48:55 +00:00
Anders Carlsson
3c23948481
Re-land r124768, with a fix for PR9130.
...
We now emit everything except unused implicit virtual member functions when building the vtable.
llvm-svn: 124935
2011-02-05 04:35:53 +00:00
Rafael Espindola
af5b92e8f7
Revert 124768.
...
This reopens PR99114, but that one at least can be avoided with an #include.
PR9130 cannot.
llvm-svn: 124780
2011-02-03 06:30:58 +00:00
Anders Carlsson
bac84bef65
Don't try to mark virtual members referenced for classes where the key function
...
is not defined in the current translation unit. Doing so lead to compile errors
such as PR9114.
Instead, when CodeGen is building the vtable, don't try to emit a definition
for functions that aren't marked used in the current translation unit.
Fixes PR9114.
llvm-svn: 124768
2011-02-03 02:08:44 +00:00
Anders Carlsson
a03f3a85cb
When building with optimizations, emit vtables where the key is not in the
...
current translation unit as available_externally.
This helps devirtualize the second example in PR3100, comment 18:
struct S { S() {}; virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
void bar() { S s; foo(&s); }
This involved four major changes:
1. In DefineUsedVTables, always mark virtual member functions as referenced for
non-template classes and class template specializations.
2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are
enabled, even if the key function is not implemented in this translation
unit. We don't ever do this for code compiled with -fapple-kext, because we
don't ever want to devirtualize virtual member function calls in that case.
3. Give the correct linkage for vtables where the key function is not defined.
4. Update the linkage for RTTI structures when necessary.
llvm-svn: 124565
2011-01-30 20:45:54 +00:00
Anders Carlsson
265aa7c070
Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead of an "IsForRTTI" flag.
...
llvm-svn: 124546
2011-01-29 20:24:48 +00:00
Anders Carlsson
c6a47895f7
Get rid of an unneeded parameter from setGlobalVisibility.
...
llvm-svn: 124541
2011-01-29 19:39:23 +00:00
Anders Carlsson
883fc72c3c
Make emitting a VTT a two-step process, much like emitting a VTable. You first get the address of the VTT, and then pass it to EmitVTTDefinition.
...
llvm-svn: 124539
2011-01-29 19:16:51 +00:00
Anders Carlsson
93be9a90cc
Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cpp
...
llvm-svn: 124538
2011-01-29 18:25:07 +00:00
Anders Carlsson
fd4834061c
Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.
...
llvm-svn: 124529
2011-01-29 05:26:32 +00:00
Fariborz Jahanian
9f9438b314
More work to support -fapple-kext regarding
...
indirect vf calls and addition of extra entry
at bottom of vtbls.
llvm-svn: 124507
2011-01-28 23:42:29 +00:00