Mike Stump
69bbd6ce84
Cleanups.
...
llvm-svn: 81077
2009-09-05 09:10:58 +00:00
Mike Stump
6363021ab9
Cleanups.
...
llvm-svn: 81075
2009-09-05 08:47:24 +00:00
Mike Stump
3cdb051425
Cleanups.
...
llvm-svn: 81074
2009-09-05 08:45:02 +00:00
Mike Stump
5e3ac0249c
Cleanups.
...
llvm-svn: 81073
2009-09-05 08:40:18 +00:00
Mike Stump
ea8eea2c45
Cleanups.
...
llvm-svn: 81072
2009-09-05 08:37:03 +00:00
Mike Stump
db14a73606
Cleanups.
...
llvm-svn: 81071
2009-09-05 08:07:32 +00:00
Mike Stump
001ad31c9a
Cleanups. WIP.
...
llvm-svn: 81069
2009-09-05 07:49:12 +00:00
Mike Stump
453fe4285d
Install thunks later to fixup overrides. Track space taken by vbase
...
offsets better for thunk refinements. Cleanups. WIP.
llvm-svn: 81067
2009-09-05 07:20:32 +00:00
Douglas Gregor
d94105a1c2
Don't generate any code for an explicit call to a trivial destructor.
...
Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!
llvm-svn: 81025
2009-09-04 19:04:08 +00:00
Mike Stump
5a522353c3
Add overidding for methods for vtable building for the secondary
...
vtables. Add thunk generation. WIP.
llvm-svn: 81014
2009-09-04 18:27:16 +00:00
Anders Carlsson
35dca26835
Fix an assertion when initializing a union using a member initializer. (We weren't casting from the union type to the initializer type correctly).
...
llvm-svn: 80837
2009-09-02 21:14:47 +00:00
Mike Stump
2348e62498
More overriding base work and some cleanups. WIP.
...
llvm-svn: 80737
2009-09-01 23:22:44 +00:00
Mike Stump
40dc64bcfc
Split out overriding. WIP.
...
llvm-svn: 80732
2009-09-01 22:20:28 +00:00
Anders Carlsson
783ab50b33
Assert that we don't have any virtual bases. We can emit dtors for polymorphics classes just fune.
...
llvm-svn: 80722
2009-09-01 21:12:16 +00:00
Anders Carlsson
6b8b4b459d
We can generate constructors/destructors with base classes and non-trivial fields just fine now.
...
llvm-svn: 80701
2009-09-01 18:33:46 +00:00
Douglas Gregor
96ee789d33
Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
...
also be adding explicit template arguments as an additional
"adornment". No functionality change.
llvm-svn: 80628
2009-08-31 21:41:48 +00:00
Eli Friedman
033e8d4ae6
Make IRGen for initializing a member reference work correctly.
...
llvm-svn: 80439
2009-08-29 20:58:20 +00:00
Mike Stump
beefdc8948
iGenerate vcalls as we build up the methods. WIP.
...
llvm-svn: 80405
2009-08-28 23:22:54 +00:00
Fariborz Jahanian
8b899e4247
ir-gen related patch for type conversion
...
with class type conversion methods. WIP.
llvm-svn: 80365
2009-08-28 15:11:24 +00:00
Mike Stump
a0d0e6fcb1
Fixup codegen for static dispatch to a virtual function that was
...
almost correct. :-)
llvm-svn: 80181
2009-08-26 23:38:08 +00:00
Fariborz Jahanian
c71f094c08
ir-gen for type convesion of class objects. WIP.
...
llvm-svn: 80178
2009-08-26 23:31:30 +00:00
Douglas Gregor
c190523d7a
When a member reference expression includes a qualifier on the member
...
name, e.g.,
x->Base::f()
retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.
When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?
llvm-svn: 80167
2009-08-26 22:36:53 +00:00
Mike Stump
a5588bf3ac
Implement virtual dispatch. :-) This is self-consistent with clang,
...
but not yet necessarily perfectly consistent with gcc. Also addressed
Doug and John's comments.
llvm-svn: 80137
2009-08-26 20:46:33 +00:00
Anders Carlsson
458055a890
Revert r80064 since it broke the build.
...
llvm-svn: 80066
2009-08-26 03:30:14 +00:00
Mike Stump
fbddfdacdc
Implement virtual dispatch. :-) This is self-consistent with clang, but not yet
...
necessarily perfectly consistent with gcc.
llvm-svn: 80064
2009-08-26 01:54:35 +00:00
Fariborz Jahanian
2c73b1d2a2
Simplified default construction of array data members
...
in the constructor prologue.
llvm-svn: 80060
2009-08-26 00:23:27 +00:00
Anders Carlsson
9cedbefb24
Add a -fno-elide-constructors option to clang-cc.
...
llvm-svn: 79782
2009-08-22 22:30:33 +00:00
Mike Stump
0b8c5ae7af
Calculate the address point for a vtable better, and start fleshing out the vcall
...
calculations better.
llvm-svn: 79687
2009-08-21 23:09:30 +00:00
Fariborz Jahanian
8adc973483
Patch to ir-gen copy assigning array members when synthesizing
...
a copy assignment operator function.
llvm-svn: 79681
2009-08-21 22:34:55 +00:00
Fariborz Jahanian
5626384384
Patch to provide ir-gen support in copying array members
...
when synthesizing a copy constructor. Arrays's base element
may have a trivial or non-trivial copy constructor.
llvm-svn: 79653
2009-08-21 18:30:26 +00:00
Fariborz Jahanian
7481bd88bb
Array member construction in prologue of user-declared
...
constructors.
llvm-svn: 79640
2009-08-21 17:09:38 +00:00
Fariborz Jahanian
6c9e5a2b9e
Introduce getConstantArrayElementCount API and use it in
...
construction/destruction of array members.
llvm-svn: 79637
2009-08-21 16:31:06 +00:00
Mike Stump
a002945a20
We now support overriding base functions in vtables. WIP.
...
llvm-svn: 79587
2009-08-21 01:45:00 +00:00
Fariborz Jahanian
1a606ab12a
Patch to ir-gen destruction of array member elements in revers order
...
of their construction.
llvm-svn: 79571
2009-08-20 23:02:58 +00:00
Fariborz Jahanian
9c83720d17
ir-gen patch to destruct array members. WIP.
...
llvm-svn: 79565
2009-08-20 20:54:15 +00:00
Mike Stump
cae6178b3b
Refine vbase offsets for the inductive case. Things are now starting
...
to come together nicely. Still a WIP.
llvm-svn: 79521
2009-08-20 07:22:17 +00:00
Mike Stump
2220447adc
Ensure we don't output repeated vbase offsets. I have a testcase for
...
this, but need to fixup the actual offset value before I can check it
in. WIP.
llvm-svn: 79506
2009-08-20 02:11:48 +00:00
Fariborz Jahanian
dd46eb770f
Test case for my last patch plus a minor clean up.
...
llvm-svn: 79500
2009-08-20 01:01:06 +00:00
Fariborz Jahanian
eeb0e57247
ir-gen for multi-dimensional array construction. WIP.
...
llvm-svn: 79497
2009-08-20 00:15:15 +00:00
Fariborz Jahanian
a8fe2c26a8
Removed unneeded code for break/continue statements in
...
manufactured for-loop per Anders feedback (thanks).
- Fariborz
llvm-svn: 79466
2009-08-19 21:10:38 +00:00
Fariborz Jahanian
431c883287
ir-gen for constructing arrays as non-static data members. WIP.
...
llvm-svn: 79464
2009-08-19 20:55:16 +00:00
Daniel Dunbar
58bc48c14e
Switch to SmallString::str from SmallString::c_str.
...
- Several FIXMEs due to non-Twinification of IRBuilder.
llvm-svn: 79455
2009-08-19 20:04:03 +00:00
Mike Stump
3bc0a3bf7d
One second thought, I think I want to limit this class to just vtable
...
building activities.
llvm-svn: 79438
2009-08-19 18:10:47 +00:00
Mike Stump
b386941208
Cleanup: fold IndirectPrimary into builder.
...
llvm-svn: 79423
2009-08-19 14:40:47 +00:00
Mike Stump
3b09f004db
We don't want to confuse this layout with the BLayout from the builder.
...
llvm-svn: 79422
2009-08-19 14:06:50 +00:00
Mike Stump
984c99d190
Restore vbase offsets for classes without a primary.
...
llvm-svn: 79402
2009-08-19 02:53:08 +00:00
Mike Stump
583ef62149
Refine vcalls a little.
...
llvm-svn: 79400
2009-08-19 02:06:38 +00:00
Mike Stump
6fe6ca11da
Cleanup.
...
llvm-svn: 79374
2009-08-18 22:04:08 +00:00
Mike Stump
07347353a0
Cleanups. Move GenerateRtti to CodeGenModule.
...
llvm-svn: 79372
2009-08-18 21:49:00 +00:00
Mike Stump
ee81dca8c7
Move the rest of the vtable building code into the new builder.
...
llvm-svn: 79370
2009-08-18 21:30:21 +00:00
Mike Stump
1f18b9a301
Suck up method generation.
...
llvm-svn: 79367
2009-08-18 21:03:28 +00:00
Mike Stump
5cb34077ef
Split out vtable bulding code into a builder.
...
llvm-svn: 79366
2009-08-18 20:50:28 +00:00
Fariborz Jahanian
d172e91f2a
Patch to 1) synthesizing non-trivial default destructor when
...
one is not provided by user. 2) More complete
emission of ctor prologue when it has no initializer
list or when it is synthesized.
llvm-svn: 79269
2009-08-17 19:04:50 +00:00
Anders Carlsson
49033712e4
Remove an ErrorUnsupported call.
...
llvm-svn: 79261
2009-08-17 18:24:57 +00:00
Anders Carlsson
81f0df9601
Improve handling of delete expressions.
...
llvm-svn: 79205
2009-08-16 21:13:42 +00:00
Mike Stump
22ea1f8a30
Cleanups and fixups for calculating the virtual base offsets. WIP.
...
llvm-svn: 79156
2009-08-16 01:46:26 +00:00
Fariborz Jahanian
0aed0225b4
Improved on ir-gen for synthesis of non-trivial default
...
constructor body whose class has non-static data-members which
required non-trivial construction.
llvm-svn: 79125
2009-08-15 18:55:17 +00:00
Fariborz Jahanian
42af5ba7b7
ir-gen for generation of trvial copy constructor
...
call.
llvm-svn: 79034
2009-08-14 20:11:43 +00:00
Mike Stump
bcf756cbac
Deconflate virtual base offsets from non-virtual base offsets.
...
Deconflate a virtual base primary from a non-virtual base.
llvm-svn: 78971
2009-08-14 01:44:03 +00:00
Fariborz Jahanian
92b3f47de2
Fixed a bug in ir-gen for copy assignment synthesis.
...
Fixed a bug when evaluating those copy-assignments
which need by lazily syntheized. A test case
for these.
llvm-svn: 78965
2009-08-14 00:01:54 +00:00
Mike Stump
c2f591b1e6
Refine vtable layout for virtual bases and keep better track of
...
primaries. WIP.
llvm-svn: 78950
2009-08-13 22:53:07 +00:00
Owen Anderson
41a750271b
Update for LLVM API change.
...
llvm-svn: 78946
2009-08-13 21:57:51 +00:00
Fariborz Jahanian
4985b33fd7
Patch to force synthesis of copy assignment operator
...
function in the order according to c++03. ir-gen
for copy assignment in the trivial case and the first
test case.
llvm-svn: 78938
2009-08-13 21:09:41 +00:00
Mike Stump
2631d8c517
Minor cleanups.
...
llvm-svn: 78927
2009-08-13 18:39:54 +00:00
Mike Stump
1300754fdd
Prep for vbase layout refinements. WIP.
...
llvm-svn: 78882
2009-08-13 02:02:14 +00:00
Fariborz Jahanian
9b630c3040
Minor refactoring of copy assign operator ir-gen. SWIP.
...
llvm-svn: 78875
2009-08-13 00:53:36 +00:00
Fariborz Jahanian
bbd5e8c2cf
More toward synthesizing copy assignments. SWIP.
...
llvm-svn: 78861
2009-08-12 23:34:46 +00:00
Mike Stump
b661738203
Cleanup.
...
llvm-svn: 78858
2009-08-12 23:25:18 +00:00
Mike Stump
938f15b033
Refactor. WIP. Eventually, this will all go into a vtable builder class.
...
llvm-svn: 78857
2009-08-12 23:14:12 +00:00
Mike Stump
480212253a
Cleanup.
...
llvm-svn: 78855
2009-08-12 23:03:28 +00:00
Mike Stump
82165efbc4
Refactor.
...
llvm-svn: 78854
2009-08-12 23:00:59 +00:00
Mike Stump
dc94d3fd27
Refactor.
...
llvm-svn: 78851
2009-08-12 22:34:12 +00:00
Fariborz Jahanian
de7d4c264a
Patch for synthesizing copy assignment operator.
...
WIP.
llvm-svn: 78841
2009-08-12 21:14:35 +00:00
Mike Stump
9deb22b850
Improve the secondary vtables to not include vbase offsets. WIP.
...
llvm-svn: 78831
2009-08-12 18:50:26 +00:00
Mike Stump
cecfe61cd1
Refine vtable building for the secondary vtables to exclude yet more
...
cases where a virtual base was already used as a primary base class.
WIP.
llvm-svn: 78820
2009-08-12 17:42:21 +00:00
Fariborz Jahanian
b2197042b8
ir-gen support for anonymous union data member
...
copying in copy constructors and used in
default constructor's initializer list.
llvm-svn: 78700
2009-08-11 18:49:54 +00:00
Mike Stump
78696a70bf
Implement more of the inductive case for vtable layout involving
...
virtual base primaries and improve the layout of classes with virtual
bases. WIP.
Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between. Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?
// CHECK: 1
// CHECK: 2
// CHECK: 3
// CHECK: 4
// CHECK: 5
// CHECK: 6
would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.
llvm-svn: 78638
2009-08-11 04:03:59 +00:00
Fariborz Jahanian
296584b2a9
Support for anonymous union in ctor's initializer and
...
bunch of FIXMEs for their is-gen.
llvm-svn: 78623
2009-08-10 23:56:17 +00:00
Fariborz Jahanian
9d3405ceab
minor refactoring. No change otherwise.
...
llvm-svn: 78582
2009-08-10 18:46:38 +00:00
Fariborz Jahanian
7cc52cf09f
ir-gen for generating copying of scalar data members in
...
a synthesized copy constructor.
llvm-svn: 78580
2009-08-10 18:34:26 +00:00
Fariborz Jahanian
2a26e351fc
Fixed a ir-gen bug in synthesizing copy constructors.
...
llvm-svn: 78570
2009-08-10 17:20:45 +00:00
Benjamin Kramer
b57e5d2f4f
Older GCCs don't have vector::data().
...
llvm-svn: 78519
2009-08-08 23:43:26 +00:00
Fariborz Jahanian
24f38969d5
ir-gen for initialization, in synthesize copy constructor,
...
of base/field which have trivial copy constructor.
llvm-svn: 78516
2009-08-08 23:32:22 +00:00
Anders Carlsson
b8be93fc92
Add support for global initializers.
...
llvm-svn: 78515
2009-08-08 23:24:23 +00:00
Anders Carlsson
f40886acca
Refactor some code and implement support for global destructors for static variables.
...
llvm-svn: 78507
2009-08-08 21:45:14 +00:00
Fariborz Jahanian
f6bda5d61e
Refactoring of copy ctor ir-gen. No change in functionality.
...
llvm-svn: 78489
2009-08-08 19:31:03 +00:00
Fariborz Jahanian
7c3d7f6c59
Remove use of uninitized variable.
...
llvm-svn: 78448
2009-08-08 00:59:58 +00:00
Fariborz Jahanian
59b3259284
Synthesize copying of non-static data members with
...
non-trivial copy constructors.
llvm-svn: 78445
2009-08-08 00:15:41 +00:00
Fariborz Jahanian
b68df0bc42
Synthesized copy constructor now generates code for
...
copying non-virtual base classes which have non-trivial
constructor. Work in progress.
llvm-svn: 78436
2009-08-07 23:51:33 +00:00
Mike Stump
16644668cd
Add vbase offsets to the vtable. Wow, having an rbegin was so
...
fortuitous. WIP.
llvm-svn: 78413
2009-08-07 21:54:03 +00:00
Fariborz Jahanian
40134e71be
More synthesis of copy constructors. Work in progress.
...
llvm-svn: 78402
2009-08-07 20:22:40 +00:00
Mike Stump
a4d94b1a95
Fix typo.
...
llvm-svn: 78401
2009-08-07 20:14:05 +00:00
Mike Stump
c266c6d797
Add ability to generate vcall offsets for primary virtual base.
...
llvm-svn: 78396
2009-08-07 19:00:50 +00:00
Mike Stump
b93185d05a
Fix some const_cast issues. This is the beginning of the rabbit hole.
...
llvm-svn: 78393
2009-08-07 18:05:12 +00:00
Mike Stump
7c32eab164
Add support for vcall generation for vtables for virtual bases. WIP.
...
llvm-svn: 78357
2009-08-06 23:48:32 +00:00
Mike Stump
3e62d00271
Also generate the rtti field for virtual bases for vtables. Turn on
...
rtti so we can properly test it. Refactor code a little. Still a
work in progress.
llvm-svn: 78343
2009-08-06 21:49:36 +00:00
Fariborz Jahanian
001309371e
Set and use Elidable in elimination of copy ctors.
...
llvm-svn: 78331
2009-08-06 19:12:38 +00:00
Mike Stump
2d8d655922
Layout the primary base first in the vtable.
...
llvm-svn: 78327
2009-08-06 18:05:22 +00:00
Mike Stump
c255f3581a
More layout for virtual tables for virtual bases. Still in progress.
...
llvm-svn: 78314
2009-08-06 15:50:11 +00:00
Mike Stump
6b2556f829
Layout virtual bases. Work in progress.
...
llvm-svn: 78308
2009-08-06 13:41:24 +00:00