Eli Friedman
e85ef718d5
Fix up EmitMemberInitializer to handle many more cases.
...
llvm-svn: 88999
2009-11-16 23:53:01 +00:00
Eli Friedman
5e7d969526
Reorganize EmitMemberInitializer to put anonymous unions on the common codepath.
...
llvm-svn: 88995
2009-11-16 23:34:11 +00:00
Eli Friedman
c1daba3ec8
Make member initializers for union members work correctly.
...
llvm-svn: 88989
2009-11-16 22:58:01 +00:00
Eli Friedman
c2ef215bda
Implement a few more cases for copy constructor synthesis.
...
llvm-svn: 88971
2009-11-16 21:47:41 +00:00
Eli Friedman
e6ce354795
Fix a couple of cases where we weren't generating the right kind of call
...
for a call to a virtual function.
llvm-svn: 88891
2009-11-16 05:31:29 +00:00
Anders Carlsson
d787204e6d
When generating the deleting ctor, emit a call to delete.
...
llvm-svn: 88878
2009-11-15 23:03:25 +00:00
Eli Friedman
b572c92674
PR5483: Generate missing form of destructor when it is virtual. (Someone
...
more familiar with this stuff should double-check that there isn't some more
general rule; this is purely from inspecting g++ output.)
llvm-svn: 88755
2009-11-14 04:19:37 +00:00
Fariborz Jahanian
ebea005812
Code gen. For virtual destructor call on array objects
...
(still part of pr5472).
llvm-svn: 88712
2009-11-13 22:29:45 +00:00
Fariborz Jahanian
6814eaa2cc
Code gen for arrady delete operator. Fixes pr5472.
...
llvm-svn: 88680
2009-11-13 19:27:47 +00:00
Anders Carlsson
fb4dda4fed
Instead of storing CXXMethodDecls in the vtable builder, store GlobalDecls so we can represent both the complete and deleting destructors. Also, when encountering a destructor decl, emit entries for both the complete and deleting destructors. Mike, please review.
...
With this change, FileCheck builds and runs the clang test suite without failures!
llvm-svn: 88663
2009-11-13 17:08:56 +00:00
Anders Carlsson
e828c36933
Add a special BuildVirtualCall that's going to be used for building calls to destructors. This is needed because when compiling:
...
struct A {
virtual ~A();
};
void f(A* a) {
delete a;
}
A's deleting destructor should be called.
llvm-svn: 87083
2009-11-13 04:45:41 +00:00
Anders Carlsson
78cfaa9e56
Fix two bugs with temporaries:
...
1. For
A f() {
return A();
}
we were incorrectly calling the A destructor on the returned object.
2. For
void f(A);
void g() {
A a;
f(a);
}
we were incorrectly not calling the copy constructor.
llvm-svn: 87082
2009-11-13 04:34:45 +00:00
Fariborz Jahanian
03f62ed9bb
Value initialize non-class array members in ctor's
...
initializer list. Fixes PR5463.
llvm-svn: 86849
2009-11-11 17:55:25 +00:00
Fariborz Jahanian
e6c8112572
Avoid generating additional destructor(s) for initialized constructed
...
objects.
llvm-svn: 86778
2009-11-11 01:13:34 +00:00
Fariborz Jahanian
1254a0978c
This patch implements Code gen. for destruction of
...
global array of objects.
llvm-svn: 86701
2009-11-10 19:24:06 +00:00
Mike Stump
d846d0825b
Add vtable caching to prevent multiple vtables for the same class from
...
being generated.
Add the most derived vtable pointer to the VTT.
llvm-svn: 86671
2009-11-10 07:44:33 +00:00
Eli Friedman
d7686ef31c
Unify the codepaths used to verify base and member initializers for explicitly
...
and implicitly defined constructors. This has a number of benefits:
1. Less code.
2. Explicit and implicit constructors get the same diagnostics.
3. The AST explicitly contains constructor calls from implicit default
constructors. This allows handing some cases that previously weren't handled
correctly in IRGen without any additional code. Specifically, implicit default
constructors containing calls to constructors with default arguments are now
handled correctly.
llvm-svn: 86500
2009-11-09 01:05:47 +00:00
Fariborz Jahanian
c2d71b531c
This patch fixes code gen. part of pr5333 (Conversion
...
using elipsis conversion).
llvm-svn: 86276
2009-11-06 18:47:57 +00:00
Anders Carlsson
5852b13827
If a member initializer create temporaries we need to destroy them. Fixes PR5077.
...
llvm-svn: 86225
2009-11-06 04:11:09 +00:00
Anders Carlsson
a7cb98b202
More cleanup.
...
llvm-svn: 86224
2009-11-06 03:23:06 +00:00
Mike Stump
c550768a11
References can't be zero; omit zero check for return value adjustments
...
in covariant thunks that return references.
llvm-svn: 86121
2009-11-05 06:32:02 +00:00
Mike Stump
b8da7a046d
Refine covariant return value adjustments for thunks when null
...
pointers are returned.
llvm-svn: 86120
2009-11-05 06:12:26 +00:00
Fariborz Jahanian
18bc195473
Add code gen for pointer-to-member function in
...
ctor's initializer. Fixes pr5178.
llvm-svn: 86040
2009-11-04 19:13:37 +00:00
Douglas Gregor
615ac67fb8
Store the unresolved class type in MemberPointerType's Class field,
...
from Peter Collingbourne!
llvm-svn: 86030
2009-11-04 16:49:01 +00:00
Mike Stump
b9c9b351e9
Fix 80-col violations.
...
llvm-svn: 85990
2009-11-04 01:11:15 +00:00
Mike Stump
71609a2874
Split out return adjustments in thunks from this adjustment in thunks
...
so the optimizer can tailcall into the return value adjustment thunk.
This improves codesize for complex hierarchies.
llvm-svn: 85988
2009-11-04 00:53:51 +00:00
Mike Stump
8117848174
Misc cleanups.
...
llvm-svn: 85978
2009-11-03 23:50:34 +00:00
Mike Stump
53f9ded62b
Refine volatile handling, specifically, we must have the canonical
...
type to look at the volatile specifier. I found these all from just
hand auditing the code.
llvm-svn: 85967
2009-11-03 23:25:48 +00:00
Mike Stump
77738205e6
Refine return value adjustments for thunks.
...
llvm-svn: 85905
2009-11-03 16:59:27 +00:00
Mike Stump
92e5f8cb39
Refine codegen for non-virtual this adjustments for thunks.
...
llvm-svn: 85856
2009-11-03 03:16:46 +00:00
Mike Stump
f358972fdc
Add virtual adjustments for this for thunks.
...
llvm-svn: 85852
2009-11-03 02:12:59 +00:00
Mike Stump
31e1d43729
Add basic codegen for thunks that return values.
...
llvm-svn: 85842
2009-11-02 23:47:45 +00:00
Mike Stump
33ccd9e354
Refine codegen for thunks.
...
llvm-svn: 85839
2009-11-02 23:22:01 +00:00
Fariborz Jahanian
29baa2b1ba
Minor cleanup.
...
llvm-svn: 85434
2009-10-28 21:07:28 +00:00
Fariborz Jahanian
f1639fffbc
Code gen for array construction - WIP
...
llvm-svn: 85432
2009-10-28 20:55:41 +00:00
Fariborz Jahanian
e4d94cee05
Code-gen for CXXZeroInitValueExpr AST passed
...
as argument to a function call. Removes a FIXME.
llvm-svn: 84694
2009-10-20 23:29:04 +00:00
Fariborz Jahanian
da21efb566
Implement derived-to-base AST/code gen. There is a
...
FIXME in CGCXX.cpp that I would like Anders to
take a look at.
llvm-svn: 84265
2009-10-16 19:20:59 +00:00
Anders Carlsson
6bfee8f3e3
Don't assume that the LHS and RHS of a member pointer expression is a DeclRefExpr. Fixes PR5177.
...
llvm-svn: 83986
2009-10-13 17:41:28 +00:00
Anders Carlsson
a1b54fdbe1
Even more devirtualization cleverness.
...
llvm-svn: 83886
2009-10-12 19:59:15 +00:00
Anders Carlsson
2a01709204
More devirtualization improvements.
...
llvm-svn: 83883
2009-10-12 19:51:33 +00:00
Anders Carlsson
b61301f353
Devirtualize calls on temporaries. A().f() for example.
...
llvm-svn: 83882
2009-10-12 19:45:47 +00:00
Anders Carlsson
d7432dfb0a
Factor out devirtualization checking into a separate function and make it handle references correctly.
...
llvm-svn: 83880
2009-10-12 19:41:04 +00:00
Anders Carlsson
b5296558f1
If the base type of a member call is a record type we don't need to emit a virtual call.
...
llvm-svn: 83816
2009-10-11 23:55:52 +00:00
Anders Carlsson
2bb27f53e0
Move the vtable builder to CGVtable.cpp, general cleanup.
...
llvm-svn: 83798
2009-10-11 22:13:54 +00:00
Anders Carlsson
2295f31810
Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
...
llvm-svn: 83793
2009-10-11 21:24:51 +00:00
Anders Carlsson
6ce51fdf43
Move our (non-existing) RTTI emission code into CGRtti.cpp. No functionality change.
...
llvm-svn: 83732
2009-10-10 20:49:04 +00:00
Mike Stump
0d479e6653
Avoid warning.
...
llvm-svn: 83609
2009-10-09 01:25:47 +00:00
Anders Carlsson
ff971e8bf4
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
...
llvm-svn: 83442
2009-10-07 01:06:45 +00:00
Anders Carlsson
b703fd2216
Uncomment some commented out code.
...
llvm-svn: 83428
2009-10-06 23:02:00 +00:00
Anders Carlsson
c6d171ec77
Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.
...
llvm-svn: 83426
2009-10-06 22:43:30 +00:00