Commit Graph

80 Commits

Author SHA1 Message Date
Anders Carlsson
fe9009635d More record layout builder cleanup and simplification.
llvm-svn: 98238
2010-03-11 05:42:17 +00:00
Anders Carlsson
de710c9125 Get rid of the PrimaryBase parameter from LayoutVirtualBases.
llvm-svn: 98233
2010-03-11 04:33:54 +00:00
Anders Carlsson
f7b7a1e781 More cleanup towards fixing the real bug.
llvm-svn: 98232
2010-03-11 04:24:02 +00:00
Anders Carlsson
6a84889d3f Replace the class offset vectors in RecordLayoutBuilder with maps instead so we'll have faster lookup and so we can detect duplicates.
llvm-svn: 98231
2010-03-11 04:10:39 +00:00
Anders Carlsson
f2fa75bdbb More cleanup.
llvm-svn: 98230
2010-03-11 03:39:12 +00:00
Anders Carlsson
c4c00ec41b More record layout builder cleanup.
llvm-svn: 98229
2010-03-11 02:41:30 +00:00
Anders Carlsson
aa87b4eab1 Remove the IndirectPrimary parameter in LayoutVirtualBases; it's already there as a member variable.
llvm-svn: 98211
2010-03-11 00:21:21 +00:00
Anders Carlsson
8630b5b09b More cleanup and simplification of the record layout builder.
llvm-svn: 98208
2010-03-11 00:15:35 +00:00
Anders Carlsson
0d0b588fb2 Get rid of the LayoutBaseNonVirtually; it was used to lay out a base either as a non-virtual base or a virtual base.
llvm-svn: 98198
2010-03-10 22:26:24 +00:00
Anders Carlsson
09ffa32b92 More shuffling.
llvm-svn: 98197
2010-03-10 22:21:28 +00:00
Anders Carlsson
f08e681ba8 Cleanups, no functionality change yet.
llvm-svn: 98196
2010-03-10 22:16:06 +00:00
Ted Kremenek
c3015a914f Allocate ASTRecordLayout objects using the allocator associated with ASTContext.
This allows them to be allocated using a BumpPtrAllocated
in the common case.

llvm-svn: 97978
2010-03-08 20:56:29 +00:00
Fariborz Jahanian
aef662206b Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.

llvm-svn: 96638
2010-02-19 00:31:17 +00:00
Zhongxing Xu
ec345b7ecb Simplify code. If we can reach here, the base must be virtual.
llvm-svn: 96211
2010-02-15 04:28:35 +00:00
Mike Stump
0a2754ed8a Be sure to select primary bases among the nearly empties in preorder,
not just among the direct bases.  Before we where missing nearly
empties that were bases of virtual base classes.

llvm-svn: 94208
2010-01-22 20:27:17 +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
Eli Friedman
f2c79b6b9c Misc key function fixes.
llvm-svn: 90831
2009-12-08 03:56:49 +00:00
Anders Carlsson
8e0317bf05 Instantiated or specialized class templates never have a key function. This (and the previous check-in) fixes PR5557.
llvm-svn: 90753
2009-12-07 08:29:39 +00:00
Anders Carlsson
5ebf8b44e9 Move key functions to a separate map.
llvm-svn: 90745
2009-12-07 04:35:11 +00:00
Eli Friedman
71a26d8f82 Move helper onto CXXMethodDecl.
llvm-svn: 90716
2009-12-06 20:50:05 +00:00
Eli Friedman
0846d52f70 Tweak "key function" rules so that they work for templates with virtual
inline functions.

llvm-svn: 90645
2009-12-05 04:55:55 +00:00
Anders Carlsson
f98849eb8a In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.
llvm-svn: 90327
2009-12-02 17:15:43 +00:00
Anders Carlsson
b1d3f7c909 Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.
llvm-svn: 90168
2009-11-30 23:41:22 +00:00
Anders Carlsson
a30c0d3ace Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data structures!
llvm-svn: 90020
2009-11-27 22:14:40 +00:00
Anders Carlsson
03ff379911 Add a new PrimaryBaseInfo struct that combines the record decl of a primary base with whether it's virtual or not.
llvm-svn: 90018
2009-11-27 22:05:05 +00:00
Anders Carlsson
ba958400a2 When laying out bitfields, make sure that the data size is always aligned to a byte. This fixes PR5580.
llvm-svn: 89611
2009-11-22 19:13:51 +00:00
Anders Carlsson
072094407d Move bit-field layout out into a separate function. No functionality change.
llvm-svn: 89604
2009-11-22 17:37:31 +00:00
Alexis Hunt
96d5c76498 Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
 - align() - semantics believed to be conformant to n3000, except for
   redeclarations and what entities it may apply to
 - final - semantics believed to be conformant to CWG issue 817's proposed
   wording, except for redeclarations
 - noreturn - semantics believed to be conformant to n3000, except for
   redeclarations
 - carries_dependency - currently ignored (this is an optimization hint)

llvm-svn: 89543
2009-11-21 08:43:09 +00:00
Mike Stump
4e16d05dc4 Fixup spacing.
llvm-svn: 86792
2009-11-11 02:49:00 +00:00
Mike Stump
2b84dd39be Refine layout for indirect virtual base classes.
llvm-svn: 86116
2009-11-05 04:02:15 +00:00
Sebastian Redl
1054faed32 Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.
llvm-svn: 85055
2009-10-25 17:03:50 +00:00
Anders Carlsson
534b0639db Address comment from Daniel.
llvm-svn: 82865
2009-09-26 16:55:29 +00:00
Anders Carlsson
47680d8040 Rename NextOffset to DataSize.
llvm-svn: 82832
2009-09-26 01:34:51 +00:00
Anders Carlsson
7f78d85be4 Start at NextOffset when laying out bases as well.
llvm-svn: 82831
2009-09-26 01:29:10 +00:00
Anders Carlsson
a6d95b5a3e Use NextOffset when laying out a field.
llvm-svn: 82828
2009-09-26 01:09:35 +00:00
Anders Carlsson
d7d358a65e Even more work on empty classes.
llvm-svn: 82770
2009-09-25 15:39:00 +00:00
Anders Carlsson
e1883100a3 Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.
llvm-svn: 82746
2009-09-25 01:54:38 +00:00
Anders Carlsson
4bf82141e7 Handle array fields that contain empty structs.
llvm-svn: 82744
2009-09-25 01:23:32 +00:00
Anders Carlsson
6f95c705ea More work on empty classes.
llvm-svn: 82736
2009-09-25 00:02:51 +00:00
Anders Carlsson
bb66bc8e84 More improvements with laying out empty bases.
llvm-svn: 82682
2009-09-24 05:21:31 +00:00
Anders Carlsson
f24b18fb06 More work on empty classes.
llvm-svn: 82679
2009-09-24 03:22:10 +00:00
Anders Carlsson
6522b05db7 Scaffolding for supporting empty bases/fields.
llvm-svn: 82678
2009-09-24 03:13:30 +00:00
Anders Carlsson
55640546e4 If we already set a primary base, don't set it to the first nearly empty base class.
llvm-svn: 82563
2009-09-22 19:16:59 +00:00
Anders Carlsson
96cff1fc10 Explicitly initialize the PrimaryBase and PrimaryBaseWasVirtual members.
llvm-svn: 82560
2009-09-22 18:21:58 +00:00
Mike Stump
865715442e Yes.
llvm-svn: 82559
2009-09-22 17:38:02 +00:00
Anders Carlsson
8143069417 Store the set of indirect primary bases directly in the record layout builder.
llvm-svn: 82513
2009-09-22 03:02:06 +00:00
Anders Carlsson
d6020c321a Record layout builder cleanup.
llvm-svn: 82502
2009-09-22 00:04:45 +00:00
Anders Carlsson
93b6d5e85e Temporary band-aid for handling empty classes somewhat better.
llvm-svn: 82124
2009-09-17 04:42:56 +00:00
Mike Stump
11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Mike Stump
996576f3aa Refine vbase offset calculations. WIP.
llvm-svn: 79198
2009-08-16 19:04:13 +00:00