Commit Graph

121 Commits

Author SHA1 Message Date
Peter Collingbourne cd3c3f4f3d Move VTableComponent to header file
llvm-svn: 140505
2011-09-26 01:56:45 +00:00
Peter Collingbourne 5ee9ee490e Move vtable component accessors to VTableContext
llvm-svn: 140504
2011-09-26 01:56:41 +00:00
Peter Collingbourne 71c26936a0 Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGen
llvm-svn: 140503
2011-09-26 01:56:36 +00:00
Peter Collingbourne a834166e48 Create a VTableContext class and start moving CodeGenVTables methods to it
llvm-svn: 140502
2011-09-26 01:56:30 +00:00
David Blaikie aa347f9392 Removing a bunch of dead returns/breaks after llvm_unreachables.
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie 83d382b1ca Switch assert(0/false) llvm_unreachable.
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Douglas Gregor e8bbc12152 Extend the ASTContext constructor to delay the initialization of
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
2011-09-02 00:18:52 +00:00
Eli Friedman f5dfb31df0 Revert bad change. (It may look equivalent, but it isn't.)
llvm-svn: 137132
2011-08-09 18:16:09 +00:00
Eli Friedman f481ccafd8 Cleanup; no functionality change.
llvm-svn: 137126
2011-08-09 17:38:12 +00:00
Chris Lattner 0e62c1cc0b remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.

llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Chris Lattner 2192fe50da de-constify llvm::Type, patch by David Blaikie!
llvm-svn: 135370
2011-07-18 04:24:23 +00:00
Chris Lattner 8806e32f16 Rename CGT::VerifyFuncTypeComplete to isFuncTypeConvertible since
it is a predicate, not an action.  Change the return type to be a bool,
not the incomplete member.  Enhace it to detect the recursive compilation
case, allowing us to compile Eli's testcase on llvmdev:

struct T {
 struct T (*p)(void);
} t;

into:

%struct.T = type { {}* }

@t = common global %struct.T zeroinitializer, align 8

llvm-svn: 134853
2011-07-10 00:18:59 +00:00
Jay Foad 83be361b8a Replace the existing forms of ConstantArray::get() with a single form
that takes an ArrayRef.

llvm-svn: 133615
2011-06-22 09:24:39 +00:00
Anders Carlsson d6f1518cc9 Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.

llvm-svn: 131400
2011-05-16 04:08:36 +00:00
Eli Friedman 49a94b1c7c Add an implementation of thunks for varargs methods. The implementation is a bit messy, but it is correct as long as the method in question doesn't use indirect gotos. A couple of possible alternative implementations are outlined in FIXME's in this patch. rdar://problem/8077308 .
llvm-svn: 130993
2011-05-06 17:27:27 +00:00
Eli Friedman 43dca6a8d2 Simplify code a bit by using CallArgList::add. No intended functionality change.
llvm-svn: 130699
2011-05-02 17:57:46 +00:00
Anders Carlsson e5ec21c977 Change CollectPrimaryBases to collect the bases in the right order. Fixes one half of PR9660.
llvm-svn: 129252
2011-04-10 18:00:32 +00:00
Anders Carlsson 68aad14dd3 Make -fdump-vtable-layouts also dump vtable indices for all virtual member functions in the class.
llvm-svn: 129250
2011-04-10 17:42:45 +00:00
Ken Dyck bb4e977218 [Reapply r128776, modified so that it does not break debug info.]
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.

llvm-svn: 129072
2011-04-07 12:37:09 +00:00
Ken Dyck 3a09bc5ab0 [Reapply r128773. This is not the source of the issues Devang was seeing
with debug info.]

Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

llvm-svn: 129048
2011-04-07 01:22:42 +00:00
Ken Dyck 25c82240e9 [Reapply r128771. It wasn't the source of the issues Devang saw with debug
info.]

Use CharUnits for the offset type in the ClassNamesAndOffsets map in
dumpLayout(). No change in functionality intended.

llvm-svn: 129046
2011-04-07 00:59:42 +00:00
Ken Dyck 42a9d29c2c Reapply r128770. It's not the cause of the issues Devang saw with debug info.
Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.

llvm-svn: 129043
2011-04-07 00:55:01 +00:00
Devang Patel 84852bbb42 Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.
llvm-svn: 128842
2011-04-04 20:36:06 +00:00
Ken Dyck 1473c9a7c4 Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.

llvm-svn: 128776
2011-04-02 17:52:22 +00:00
Ken Dyck 1b23db93df Use CharUnits for the offsets in the VirtualBaseClassOffsetOffsetsMapTy. No
change in functionality intended.

llvm-svn: 128773
2011-04-02 17:13:02 +00:00
Ken Dyck cf4ef5314f Use CharUnits for the offset type in the ClassNamesAndOffsets map in
dumpLayout(). No change in functionality intended.

llvm-svn: 128771
2011-04-02 17:03:24 +00:00
Ken Dyck 1eac9f1546 Use CharUnits for the offsets in the VBaseOffsetOffsetsMapTy types. No
change in functionality intended.

llvm-svn: 128770
2011-04-02 16:57:20 +00:00
Ken Dyck 6b20919317 Convert BaseOffset::NonVirtualOffset to CharUnits. No change in
functionality intended.

llvm-svn: 128756
2011-04-02 01:32:03 +00:00
Ken Dyck 872d74a591 Convert offset parameters and return values of VTableComponent methods to
CharUnits. No change in functionality intended.

llvm-svn: 128754
2011-04-02 01:14:48 +00:00
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