Daniel Dunbar
a671c2a9fe
Fix (invalid) may-be-uninitialized warning.
...
llvm-svn: 92828
2010-01-06 07:13:04 +00:00
Douglas Gregor
d01472beee
Revert my available_externally vtables experiment. It's breaking the LLVM-with-Clang build with linker errors that I have yet to investigate.
...
llvm-svn: 92822
2010-01-06 04:50:56 +00:00
Mike Stump
81478719a7
Reorder to avoid invalidating idx which is an accessor into VCall.
...
llvm-svn: 92819
2010-01-06 03:09:19 +00:00
Douglas Gregor
26751ffc53
Silence bogus GCC warning
...
llvm-svn: 92787
2010-01-05 21:55:26 +00:00
Douglas Gregor
1a68ab6c83
Make use of available_externally linkage for vtables when the
...
non-inline key function of a class template instantiation, when no key
function is present, the class template instantiation itself was
instantiated with an explicit instantiation declaration (aka extern
template). I'm fairly certain that the C++0x specification gives us
this lattitude, although GCC doesn't take advantage of it.
llvm-svn: 92779
2010-01-05 21:40:05 +00:00
Douglas Gregor
a318efd1f2
Improve key-function computation for templates. In particular:
...
- All classes can have a key function; templates don't change that.
non-template classes when computing the key function.
- We always mark all of the virtual member functions of class
template instantiations.
- The vtable for an instantiation of a class template has weak
linkage.
We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.
llvm-svn: 92753
2010-01-05 19:06:31 +00:00
Mike Stump
79ed590c85
Add code to skip the emission of available externally functions at -O0. WIP.
...
llvm-svn: 92749
2010-01-05 18:48:04 +00:00
Anders Carlsson
a0b025e40f
When emitting member function pointers, use the canonical decl if the member function is virtual. Fixes PR5940.
...
llvm-svn: 92680
2010-01-05 05:04:05 +00:00
Daniel Dunbar
d443c0a02a
Revert r92431, this code isn't dead and broke the ntfs build.
...
llvm-svn: 92493
2010-01-04 18:47:06 +00:00
Daniel Dunbar
5b9019515a
Fix -Asserts warning.
...
llvm-svn: 92491
2010-01-04 18:02:28 +00:00
Eli Friedman
6257e08a3d
Get rid of more dead code.
...
llvm-svn: 92439
2010-01-03 01:11:47 +00:00
Eli Friedman
c52a9367b3
Get rid of some unnecessary code.
...
llvm-svn: 92432
2010-01-02 23:43:59 +00:00
Eli Friedman
14e4005851
Delete impossible case.
...
llvm-svn: 92431
2010-01-02 23:28:56 +00:00
Anders Carlsson
c92a37e917
Speculative MSVC fix.
...
llvm-svn: 92421
2010-01-02 18:46:23 +00:00
Anders Carlsson
93a1884fde
Move address points to CGVtableInfo, no functionality change.
...
llvm-svn: 92420
2010-01-02 18:02:32 +00:00
Anders Carlsson
e36a6b3e44
Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow.
...
llvm-svn: 92409
2010-01-02 01:01:18 +00:00
Anders Carlsson
27da15ba8e
Move a few more functions away from CGCXX and to CGClass and CGExprCXX.
...
llvm-svn: 92399
2010-01-01 20:29:01 +00:00
Mike Stump
9d44fdb397
Fix last patch, catch of reference to non-pointer.
...
llvm-svn: 92386
2010-01-01 03:20:32 +00:00
Mike Stump
5ee041873b
Fix catching a reference to a pointer.
...
llvm-svn: 92385
2010-01-01 02:51:52 +00:00
Anders Carlsson
2d21394190
If the key function of a record is inline, then the RTTI data should have weak_odr linkage.
...
llvm-svn: 92371
2009-12-31 19:36:25 +00:00
Anders Carlsson
7ae81bb711
More RTTI builder cleanup.
...
llvm-svn: 92360
2009-12-31 17:43:53 +00:00
Anders Carlsson
a442499072
Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
...
llvm-svn: 92319
2009-12-30 23:47:56 +00:00
Anders Carlsson
ac2f681777
More RTTI cleanup, test that RTTI classes have the correct vtables.
...
llvm-svn: 92284
2009-12-30 01:00:12 +00:00
Anders Carlsson
79c184e975
Match gcc and treat vector types as fundamental types.
...
llvm-svn: 92278
2009-12-29 22:30:11 +00:00
Anders Carlsson
ef88695860
Handle enum types as well.
...
llvm-svn: 92276
2009-12-29 22:13:01 +00:00
Anders Carlsson
0e4151c685
Test linkage of RTTI descriptors of array types.
...
llvm-svn: 92274
2009-12-29 21:58:32 +00:00
Anders Carlsson
26cf4ab8e2
Fix function type RTTI linkage and add tests.
...
llvm-svn: 92266
2009-12-29 20:20:19 +00:00
Chris Lattner
3f8e5dd898
strength reduce this call away.
...
llvm-svn: 92253
2009-12-29 07:49:13 +00:00
Anders Carlsson
88ea2455f8
Get rid of FixedWidthIntType, as suggested by Chris and Eli.
...
llvm-svn: 92246
2009-12-29 07:07:36 +00:00
Chris Lattner
9f021fd05d
adjust for llvm api changes.
...
llvm-svn: 92236
2009-12-28 23:41:39 +00:00
Chris Lattner
5e124bf913
this form of SetDebugLocation is about to go away, add some #includes that
...
are about to not come in implicitly.
llvm-svn: 92228
2009-12-28 21:44:41 +00:00
Anton Korobeynikov
73d50b9141
Promote arguments of frameaddr / returnaddr builtins to i32 type, when needed.
...
This is needed for the platforms, where bitwidth of "int" is not 32 bits
(e.g. 16 on msp430).
llvm-svn: 92176
2009-12-27 14:27:22 +00:00
Eli Friedman
1e26278b3b
Add a sanity assertion so that we don't silently generate bad code; I'll file
...
a bug with a testcase hitting this assertion in a moment.
llvm-svn: 92175
2009-12-27 07:02:50 +00:00
Eli Friedman
af76ad73ed
Fix obvious mistake.
...
llvm-svn: 92172
2009-12-27 03:44:17 +00:00
Benjamin Kramer
d20ef75b91
Remove some dead variables clang-analyzer found.
...
llvm-svn: 92162
2009-12-25 15:43:36 +00:00
Eli Friedman
b8841af8bd
Minor optimization; emit proper unsupported messages for a couple of cases.
...
llvm-svn: 92153
2009-12-25 06:17:05 +00:00
Eli Friedman
2e06e8bbcc
Some small improvements to dead code elimination; helps a bit on
...
LLVM-Code-Symbols test.
llvm-svn: 92152
2009-12-25 05:29:40 +00:00
Eli Friedman
fddc26cc64
Make copy constructor elimination work in more cases; the case in question
...
here affects clang-on-clang.
llvm-svn: 92151
2009-12-24 23:33:34 +00:00
Anders Carlsson
fb404888af
Move a bunch of class related functions to CGClass.cpp, no functionality change.
...
llvm-svn: 92148
2009-12-24 22:46:43 +00:00
Anders Carlsson
bfb3671b25
Pass the return value slot to all call exprs.
...
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Anders Carlsson
1749083e2e
Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
...
llvm-svn: 92142
2009-12-24 20:40:36 +00:00
Anders Carlsson
61a401caec
Pass ReturnValueSlot to EmitCall. No functionality change yet.
...
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Anders Carlsson
0435ed5875
Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
...
llvm-svn: 92136
2009-12-24 19:08:58 +00:00
Douglas Gregor
5c13090bd4
Fix double-destruction assertion to account for temporaries in conditionals
...
llvm-svn: 92134
2009-12-24 18:16:21 +00:00
Douglas Gregor
4cd5d53ebf
Assert that we aren't trying to push the same C++ temporary onto the live temporary stack twice. A little insurance against PR5867 surprising us again
...
llvm-svn: 92132
2009-12-24 17:48:05 +00:00
Mike Stump
d538a6d364
Remove some dead code.
...
llvm-svn: 92123
2009-12-24 07:29:41 +00:00
Mike Stump
4a779b93e4
Cleanup some dead code.
...
llvm-svn: 92122
2009-12-24 06:52:05 +00:00
Mike Stump
bb2f57dd39
Don't set hidden for a non-external symbol as that would make it extenal.
...
Refine codegen for visibility and hidden. WIP.
llvm-svn: 92118
2009-12-24 02:33:48 +00:00
David Chisnall
3a509cd8cc
Fix for bug 5691.
...
This fixes throwing exceptions inside @catch blocks nested inside outer @try blocks and also fixes jumping from an inner @finally to an outer @finally (via any relevant @catch blocks).
The code exhibiting this bug was based on code from CGObjCMac. I believe that this bug may still be present on the Mac runtimes, although the test case in the bug contains a few GNUisms and won't compile without some minor tweaks with Apple's libobjc.
llvm-svn: 92117
2009-12-24 02:26:34 +00:00
Mike Stump
a8a2a33af9
Fix recent regression caught by g++.old-deja/g++.mike/eh19.C.
...
llvm-svn: 92109
2009-12-24 01:10:27 +00:00