305 Commits

Author SHA1 Message Date
Anders Carlsson
03db9e9cd3 Correctly calculate base offsets for 'this' pointer adjustments involving virtual bases. This can't be tested yet due to lack of vcall offsets :)
llvm-svn: 96441
2010-02-17 02:05:23 +00:00
Anders Carlsson
13f0f66223 Handle layout of vtables for virtual bases.
llvm-svn: 96355
2010-02-16 16:49:35 +00:00
Anders Carlsson
b716a543c9 Move some code around in preparation for virtual base vtables.
llvm-svn: 96354
2010-02-16 16:26:28 +00:00
Anders Carlsson
14157939ab Fix a bug where we would not emit secondary vtables for bases of a primary base.
llvm-svn: 96351
2010-02-16 16:02:57 +00:00
Anders Carlsson
77904f1d5b Emit vbase offsets.
llvm-svn: 96329
2010-02-16 04:59:55 +00:00
Anders Carlsson
dc2dba306c More work on the new layout code.
llvm-svn: 96328
2010-02-16 04:49:44 +00:00
Anders Carlsson
033d48697f Don't compute final overriders or build vtables for bases that don't need a vtable.
llvm-svn: 96171
2010-02-14 17:05:59 +00:00
Anders Carlsson
073a0c88cc Build fix.
llvm-svn: 96140
2010-02-14 00:44:19 +00:00
Anders Carlsson
6a7e6a4c3c Baby steps towards teaching FinalOverriders about virtual bases.
llvm-svn: 96139
2010-02-14 00:37:35 +00:00
Anders Carlsson
1888b44988 Don't try to layout construction vtables for now.
llvm-svn: 96138
2010-02-14 00:22:59 +00:00
Anders Carlsson
258a1e35e8 Improve support for non-virtual 'this' pointer adjustments. With this, it should be possible to use the new vtable layout code for all class hierarchies that do not involve virtual bases.
llvm-svn: 96137
2010-02-14 00:16:19 +00:00
Anders Carlsson
d3adb0ced9 Add basic support for simple non-virtual 'this' pointer adjustments.
llvm-svn: 96136
2010-02-13 23:40:17 +00:00
Anders Carlsson
cce9ee8970 Add support for very simple non-virtual this adjustments in the FinalOverriders class.
llvm-svn: 96133
2010-02-13 23:17:31 +00:00
Anders Carlsson
c809cbdc3f Cleanup; remove some duplicated code.
llvm-svn: 96131
2010-02-13 22:39:18 +00:00
Anders Carlsson
a678aa1e51 Assert if we encounter this adjustments.
llvm-svn: 96125
2010-02-13 22:23:31 +00:00
Anders Carlsson
e75aaa97b3 Start laying out secondary vtables.
llvm-svn: 96123
2010-02-13 22:05:23 +00:00
Anders Carlsson
3f9917de6e Merge base offsets and dump them.
llvm-svn: 96121
2010-02-13 21:33:22 +00:00
Anders Carlsson
c1290adab7 Don't make return adjustments for pure virtual member functions.
llvm-svn: 96120
2010-02-13 21:16:54 +00:00
Anders Carlsson
cf5a882da1 Handle virtual bases in return adjustment types.
llvm-svn: 96119
2010-02-13 21:07:32 +00:00
Anders Carlsson
f3f67846c8 Handle virtual bases in ComputeBaseOffset.
llvm-svn: 96117
2010-02-13 20:41:15 +00:00
Anders Carlsson
6a6cbfc55f More work on covariant return types. We now handle non-virtual adjustments fine.
llvm-svn: 96114
2010-02-13 20:11:51 +00:00
Chandler Carruth
a932bbca75 Fix think-o, attributes can't come *within* the type of the variable.
llvm-svn: 96099
2010-02-13 10:42:55 +00:00
Chandler Carruth
94eab4ad04 Silence unused variable warning in a build without assertions.
llvm-svn: 96098
2010-02-13 10:38:52 +00:00
Benjamin Kramer
e047e11189 Remove dead {include, semicolon, variable}.
llvm-svn: 96087
2010-02-13 09:15:07 +00:00
Benjamin Kramer
02c673781d Use a different name for this iterator. MSVC and clang++ didn't like "I" in the same scope twice.
llvm-svn: 96086
2010-02-13 09:11:28 +00:00
Anders Carlsson
eee53d9c06 More work on return type adjustments in the new vtable builder.
llvm-svn: 96070
2010-02-13 02:02:03 +00:00
John McCall
ef3057c419 Switch the standard DeclarationName comparator to be a tri-valued comparator.
Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow,
has not actually caused a crash.

llvm-svn: 96062
2010-02-13 01:04:05 +00:00
Eli Friedman
18c28f6cdc if-0 out printf.
llvm-svn: 96052
2010-02-13 00:03:21 +00:00
Anders Carlsson
0760481f26 Fix a refacto that broke the clang-on-clang build.
llvm-svn: 95994
2010-02-12 18:14:46 +00:00
Anders Carlsson
5272c2574a Start stubbing out more of the covariant thunk support.
llvm-svn: 95990
2010-02-12 17:37:14 +00:00
Anders Carlsson
8e661e15f2 Keep track of whether a final overrider needs a return type adjustment.
llvm-svn: 95985
2010-02-12 17:13:23 +00:00
Anders Carlsson
136bd19224 Move overrider out into a separate struct.
llvm-svn: 95984
2010-02-12 16:55:34 +00:00
Anders Carlsson
e8a9756e63 Keep track of the address points for all primary bases, and add the ability to dump multiple address points for a single offset.
llvm-svn: 95970
2010-02-12 07:43:48 +00:00
John McCall
84c416b9f6 Fix a bug causing an assertion when a covariant return type differed from
an overriden type only by reduced qualification.

llvm-svn: 95968
2010-02-12 06:15:07 +00:00
Anders Carlsson
65b4978f7f More work on vtable layout. We can now layout vtables with primary bases.
llvm-svn: 95965
2010-02-12 05:25:12 +00:00
Anders Carlsson
09da3372b6 When dumping vtables, dump whether a virtual member function is pure or not.
llvm-svn: 95963
2010-02-12 02:38:13 +00:00
Anders Carlsson
9fbf6d95f6 More work on the final overriders.
llvm-svn: 95954
2010-02-12 01:40:03 +00:00
Anders Carlsson
e8ac42ad5c Stub out the final overriders class.
llvm-svn: 95922
2010-02-11 21:24:32 +00:00
Anders Carlsson
dd27b5d7bb Use getAs instead of cast/dyn_cast on types. (I'm sure Doug will appreciate this).
llvm-svn: 95911
2010-02-11 19:45:15 +00:00
Anders Carlsson
727ffb14a1 Move two functions to the top. No functionality change.
llvm-svn: 95908
2010-02-11 19:39:49 +00:00
Anders Carlsson
5bd8d19291 More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.
llvm-svn: 95887
2010-02-11 18:20:28 +00:00
Anders Carlsson
932c2f2a9a Keep track of, and dump, vtable address points.
llvm-svn: 95874
2010-02-11 17:18:51 +00:00
Anders Carlsson
5d40c6f658 Check in the beginnings of my new vtable layout builder idea.
Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.

I've also added a very simple new vtable layout test case.

llvm-svn: 95865
2010-02-11 08:02:13 +00:00
Chris Lattner
eb1e610d00 remove a big chunk of #if 0 code.
llvm-svn: 95201
2010-02-03 05:28:17 +00:00
Anders Carlsson
259688ce29 Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.
llvm-svn: 95063
2010-02-02 03:37:46 +00:00
Mike Stump
ded0a406b4 Refine the non-virtual this adjustments for thunks by using the offset
to the declaring class from the nearest virtual base class.  WIP.

llvm-svn: 94606
2010-01-26 22:44:01 +00:00
Mike Stump
a04ecfb701 Refine the non-virtual this adjustments for thunks by using the offset
to the declaring class from the nearest virtual base class.  WIP.

This fixes 40% of all the problems remaining in one of my testcases.

llvm-svn: 94592
2010-01-26 21:35:27 +00:00
Anders Carlsson
7228117108 Change getUnique to return a GlobalDecl. Fixes PR6147.
llvm-svn: 94554
2010-01-26 17:36:47 +00:00
Mike Stump
77537b136e Be sure to track the non-virtual part of the vcall offset in complex
multiple inheritance cases.  WIP.

This fixes 20% of the outstanding problems found by the randomized
tester.

llvm-svn: 94499
2010-01-26 03:42:22 +00:00
Mike Stump
90181eb294 Fixup a missing vcall entry. WIP.
llvm-svn: 94478
2010-01-26 00:05:04 +00:00