Argyrios Kyrtzidis
3c6cd17c8a
Use a smart pointer instead of delete.
...
llvm-svn: 112005
2010-08-25 00:32:14 +00:00
Chandler Carruth
76c0cb493f
Add a virtual destructor to the base of another class hierarchy with virtual
...
methods.
llvm-svn: 111804
2010-08-23 08:37:21 +00:00
Charles Davis
6bcb07ad71
Add some enum goodness as requested by Chris. Now instead of storing the
...
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.
And yes, this time, I started from a clean build directory, and
all the tests passed. :)
llvm-svn: 111507
2010-08-19 02:18:14 +00:00
John McCall
1ed0182413
Restore the build
...
llvm-svn: 111498
2010-08-19 01:21:57 +00:00
Charles Davis
c2c576a9e7
Add a special RecordLayoutBuilder for the Microsoft C++ ABI.
...
All it does right now is add space for two vtable pointers instead of one
when a class has both virtual methods and virtual bases. This is a requirement
of the Microsoft ABI, since it has separate vtables for methods and bases. Other
stuff will come up over time, but we'll cross those bridges when we get to
them.
llvm-svn: 111493
2010-08-19 00:55:19 +00:00
Alexis Hunt
dcfba7b35b
Generate Attr subclasses with TableGen.
...
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.
Some other notes about newly-generated attribute classes:
- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td
- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).
Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.
llvm-svn: 111455
2010-08-18 23:23:40 +00:00
Daniel Dunbar
56df97761d
StringRef'ication of lots stuff, patch by Peter Davies!
...
llvm-svn: 111314
2010-08-17 22:39:59 +00:00
Argyrios Kyrtzidis
499e6e49e7
Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.
...
llvm-svn: 111101
2010-08-15 10:17:39 +00:00
Argyrios Kyrtzidis
0a33cb62a6
Add ATTRIBUTE_UNUSED to methods not supposed to be used.
...
llvm-svn: 111087
2010-08-15 01:15:27 +00:00
Daniel Dunbar
f35e76552f
Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structures
...
with bit-fields.
llvm-svn: 107185
2010-06-29 18:34:35 +00:00
Jeffrey Yasskin
bb219e01a6
Delete assert in ComputeKeyFunction. The function runs fine without it, since
...
there's an explicit guard on isPolymorphic, and virtual bases don't affect the
key function calculation. This allows people to call
ASTContext::getKeyFunction on arbitrary classes.
llvm-svn: 107143
2010-06-29 15:27:35 +00:00
Anders Carlsson
cc59cc5d80
Do the same short-circuit optimization when laying out bases.
...
llvm-svn: 105920
2010-06-13 18:00:18 +00:00
Anders Carlsson
ae111dc821
Implement part of the EmptySubobjectMap optimization described in PR6998. We still need to do this for bases.
...
llvm-svn: 105919
2010-06-13 17:49:16 +00:00
Anders Carlsson
446872069f
Correctly handle fields with virtual bases containing empty subobjects.
...
llvm-svn: 105628
2010-06-08 19:09:24 +00:00
Anders Carlsson
45c1d2898e
When checking whether we can place a base subobject at an offset, we don't need to go past the highest offset that's known to contain an empty base subobject.
...
llvm-svn: 105611
2010-06-08 16:20:35 +00:00
Anders Carlsson
cc5de097a6
Minor cleanups to the empty subobject map.
...
llvm-svn: 105608
2010-06-08 15:56:03 +00:00
Anders Carlsson
7498b32117
And now for the best part: Removing the old code.
...
llvm-svn: 105162
2010-05-30 06:56:46 +00:00
Anders Carlsson
b1fcdd063c
Turn on the new empty base subobject tracking code. It's a bit faster than the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch.
...
llvm-svn: 105161
2010-05-30 06:52:33 +00:00
Anders Carlsson
a7774a685d
Cleanup.
...
llvm-svn: 105114
2010-05-29 21:10:24 +00:00
Anders Carlsson
a60b86a3fa
Make EmptySubobjectMap::CanPlaceBaseAtOffset take a BaseSubobjectInfo as well.
...
llvm-svn: 105113
2010-05-29 20:49:49 +00:00
Anders Carlsson
d7f3fcf248
Change RecordLayoutBuilder::LayoutBase to take a BaseSubobjectInfo. No functionality change.
...
llvm-svn: 105112
2010-05-29 20:47:33 +00:00
Anders Carlsson
6b0d914ad0
Rework the way virtual primary bases are added when laying out classes. Instead of doing it as a separate step, we now use the BaseSubobjectInfo and use it when laying out the bases. This fixes a bug where we would either not add a primary virtual base at all, or add it at the wrong offset.
...
llvm-svn: 105110
2010-05-29 19:44:50 +00:00
Anders Carlsson
d6ff5d7787
Change LayoutVirtualBase to also take a BaseSubobjectInfo.
...
llvm-svn: 105104
2010-05-29 17:48:36 +00:00
Anders Carlsson
bb0e6787b0
Change RecordLayoutBuilder::LayoutNonVirtualBase to take a BaseSubobjectInfo. No functionality change.
...
llvm-svn: 105103
2010-05-29 17:42:25 +00:00
Anders Carlsson
e3c24c7033
Move computing the base subobject info for a class into the RecordLayoutBuilder because we're going to need it to be able to correctly add offsets for primary virtual bases.
...
llvm-svn: 105102
2010-05-29 17:35:14 +00:00
Anders Carlsson
a7f3cdb0f2
Rename BaseInfo to BaseSubobjectInfo.
...
llvm-svn: 105007
2010-05-28 21:24:37 +00:00
Anders Carlsson
056818f8a2
Move BaseInfo outside of the EmptySubobject class.
...
llvm-svn: 105002
2010-05-28 21:13:31 +00:00
Anders Carlsson
db319761e7
More work on the empty subobject map. This code is not yet used.
...
llvm-svn: 104861
2010-05-27 18:20:57 +00:00
Daniel Dunbar
6da1098b4b
Sema: Add initial support for '#pragma options align=mac68k'.
...
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!
llvm-svn: 104809
2010-05-27 05:45:51 +00:00
Anders Carlsson
439edd1aea
More work on the new empty subobject map.
...
llvm-svn: 104808
2010-05-27 05:41:06 +00:00
Daniel Dunbar
592a85c137
Strip trailing whitespace.
...
llvm-svn: 104801
2010-05-27 02:25:46 +00:00
Daniel Dunbar
401304462a
AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.
...
llvm-svn: 104795
2010-05-27 01:12:46 +00:00
Anders Carlsson
c121b4e59f
More work on the empty subobjects map.
...
llvm-svn: 104787
2010-05-27 00:07:01 +00:00
Anders Carlsson
c5ca1f7799
Move ComputeEmptySubobjectSizes to EmptySubobjectMap.
...
llvm-svn: 104702
2010-05-26 15:54:25 +00:00
Anders Carlsson
f58de11b61
Stub out the EmptySubobjectsMap class.
...
llvm-svn: 104701
2010-05-26 15:32:58 +00:00
Anders Carlsson
ce7f77729a
Inline the RecordLayoutBuilder constructor.
...
llvm-svn: 104700
2010-05-26 15:20:08 +00:00
Anders Carlsson
c28a6c9251
Add a Layout overload that takes a CXXRecordDecl.
...
llvm-svn: 104695
2010-05-26 15:10:00 +00:00
Benjamin Kramer
c7656cdf83
Move RecordLayoutBuilder into an anonymous namespace.
...
llvm-svn: 104693
2010-05-26 09:58:31 +00:00
Anders Carlsson
c222620adf
Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.
...
llvm-svn: 104688
2010-05-26 05:58:59 +00:00
Anders Carlsson
35a36eb78d
Move the ASTRecordLayoutBuilder class declaration into the .cpp file.
...
llvm-svn: 104686
2010-05-26 05:41:04 +00:00
Anders Carlsson
b48414f4cb
Fix thinko and remove another unused function.
...
llvm-svn: 104683
2010-05-26 05:31:23 +00:00
Anders Carlsson
1d1e4cf04d
Fix build.
...
llvm-svn: 104682
2010-05-26 05:25:15 +00:00
Anders Carlsson
d20e7cd3c6
No need to use the PrimaryBaseInfo struct in the builder.
...
llvm-svn: 104681
2010-05-26 05:20:58 +00:00
Anders Carlsson
87209bb54b
Remove FIXME.
...
llvm-svn: 104674
2010-05-26 05:11:02 +00:00
Anders Carlsson
d295486012
Fold the other Layout overload into its sole call site.
...
llvm-svn: 104673
2010-05-26 05:10:47 +00:00
Anders Carlsson
6ed3a9a494
Fold the ASTRecordLayoutBuilder::ComputeLayout overload that takes an ObjCInterfaceDecl pointer into its only callsite.
...
llvm-svn: 104672
2010-05-26 05:04:25 +00:00
Anders Carlsson
df291d8d8b
Move the relevant ASTContext member functions that deal with ASTRecordLayoutBuilder into RecordLayoutBuilder.cpp. This matches the way we interact with other builder classes (CGRecordLayoutBuilder, VTableBuilder and VTTBuilder) and it also allows for making ASTRecordLayoutBuilder a private class without a header file.
...
llvm-svn: 104671
2010-05-26 04:56:53 +00:00
Anders Carlsson
5773205a8d
When recording empty subobjects we should always look at the primary virtual base.
...
llvm-svn: 104464
2010-05-23 18:14:24 +00:00
Anders Carlsson
5f1a1704a2
Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.
...
llvm-svn: 103403
2010-05-10 15:28:59 +00:00
Anders Carlsson
d626cb74d1
More work on handling empty classes.
...
llvm-svn: 103402
2010-05-10 15:26:14 +00:00