summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/RecordLayoutBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.Anders Carlsson2010-11-241-2/+2
| | | | llvm-svn: 120133
* Use the newly added function in ASTRecordLayoutBuilder.Anders Carlsson2010-11-241-38/+3
| | | | llvm-svn: 120131
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-181-2/+1
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. llvm-svn: 119730
* Don't update empty field subobjects for bitfields. Fixes PR8519.Anders Carlsson2010-11-011-1/+3
| | | | llvm-svn: 117921
* Get rid of more calls to getBaseClassOffsetInBits.Anders Carlsson2010-11-011-10/+5
| | | | llvm-svn: 117883
* Port over a couple of getVBaseClassOffsetInBits call sites to use ↵Anders Carlsson2010-10-311-18/+18
| | | | | | getVBaseClassOffset instead. llvm-svn: 117882
* Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson2010-10-311-9/+9
| | | | | | getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
* Start converting over the RecordLayoutBuilder next.Anders Carlsson2010-10-311-20/+15
| | | | llvm-svn: 117878
* EmptyObjectMap now uses CharUnits wherever possible.Anders Carlsson2010-10-311-61/+61
| | | | llvm-svn: 117877
* More CharUnits conversion.Anders Carlsson2010-10-311-22/+44
| | | | llvm-svn: 117875
* More CharUnits conversion.Anders Carlsson2010-10-311-21/+28
| | | | llvm-svn: 117874
* Use CharUnits in the EmptyClassOffsets map.Anders Carlsson2010-10-311-3/+12
| | | | llvm-svn: 117873
* Baby steps towards using only CharUnits for base class offsets in ↵Anders Carlsson2010-10-311-4/+10
| | | | | | ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object. llvm-svn: 117869
* Move classes into anonymous namespaces.Benjamin Kramer2010-10-221-9/+11
| | | | llvm-svn: 117104
* Store in PCH the key function of C++ class to avoid deserializing the ↵Argyrios Kyrtzidis2010-10-141-3/+0
| | | | | | | | complete declaration context in order to compute it. Progress for rdar://7260160. llvm-svn: 116508
* Embrace C++ ABI 5.2.6 and consider that template instantiations don't have ↵Argyrios Kyrtzidis2010-10-131-0/+7
| | | | | | key functions (same as GCC). llvm-svn: 116391
* Implement -Wpadded and -Wpacked.Argyrios Kyrtzidis2010-09-221-22/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556) -Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect on the layout or the size of the struct. Such structs may be mis-aligned for little benefit. The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder. To avoid calculating the layouts of all structs regardless of whether they are needed or not, I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only: $ cat t.c struct S { char c; int i; }; void f(struct S* s) {} $ clang -fsyntax-only -Wpadded t.c $ clang -c -Wpadded t.c -o t.o t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded] int i; ^ 1 warning generated. This is a good tradeoff between providing the warnings and not calculating layouts for all structs in case the user has enabled a couple of rarely used warnings. llvm-svn: 114544
* Use a smart pointer instead of delete.Argyrios Kyrtzidis2010-08-251-6/+5
| | | | llvm-svn: 112005
* Add a virtual destructor to the base of another class hierarchy with virtualChandler Carruth2010-08-231-0/+2
| | | | | | methods. llvm-svn: 111804
* Add some enum goodness as requested by Chris. Now instead of storing theCharles Davis2010-08-191-5/+6
| | | | | | | | | | 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
* Restore the buildJohn McCall2010-08-191-0/+1
| | | | llvm-svn: 111498
* Add a special RecordLayoutBuilder for the Microsoft C++ ABI.Charles Davis2010-08-191-25/+73
| | | | | | | | | | 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
* Generate Attr subclasses with TableGen.Alexis Hunt2010-08-181-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* StringRef'ication of lots stuff, patch by Peter Davies!Daniel Dunbar2010-08-171-1/+1
| | | | llvm-svn: 111314
* Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.Argyrios Kyrtzidis2010-08-151-3/+2
| | | | llvm-svn: 111101
* Add ATTRIBUTE_UNUSED to methods not supposed to be used.Argyrios Kyrtzidis2010-08-151-2/+3
| | | | llvm-svn: 111087
* Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structuresDaniel Dunbar2010-06-291-1/+1
| | | | | | with bit-fields. llvm-svn: 107185
* Delete assert in ComputeKeyFunction. The function runs fine without it, sinceJeffrey Yasskin2010-06-291-2/+0
| | | | | | | | 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
* Do the same short-circuit optimization when laying out bases.Anders Carlsson2010-06-131-7/+18
| | | | llvm-svn: 105920
* Implement part of the EmptySubobjectMap optimization described in PR6998. We ↵Anders Carlsson2010-06-131-1/+16
| | | | | | still need to do this for bases. llvm-svn: 105919
* Correctly handle fields with virtual bases containing empty subobjects.Anders Carlsson2010-06-081-1/+27
| | | | llvm-svn: 105628
* When checking whether we can place a base subobject at an offset, we don't ↵Anders Carlsson2010-06-081-1/+22
| | | | | | need to go past the highest offset that's known to contain an empty base subobject. llvm-svn: 105611
* Minor cleanups to the empty subobject map.Anders Carlsson2010-06-081-8/+23
| | | | llvm-svn: 105608
* And now for the best part: Removing the old code.Anders Carlsson2010-05-301-190/+0
| | | | llvm-svn: 105162
* Turn on the new empty base subobject tracking code. It's a bit faster than ↵Anders Carlsson2010-05-301-19/+5
| | | | | | the previous code. However, it still has quadratic performance, something which I intend to fix shortly in a subsequent patch. llvm-svn: 105161
* Cleanup.Anders Carlsson2010-05-291-13/+6
| | | | llvm-svn: 105114
* Make EmptySubobjectMap::CanPlaceBaseAtOffset take a BaseSubobjectInfo as well.Anders Carlsson2010-05-291-16/+4
| | | | llvm-svn: 105113
* Change RecordLayoutBuilder::LayoutBase to take a BaseSubobjectInfo. No ↵Anders Carlsson2010-05-291-14/+14
| | | | | | functionality change. llvm-svn: 105112
* Rework the way virtual primary bases are added when laying out classes. ↵Anders Carlsson2010-05-291-52/+35
| | | | | | 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
* Change LayoutVirtualBase to also take a BaseSubobjectInfo.Anders Carlsson2010-05-291-13/+15
| | | | llvm-svn: 105104
* Change RecordLayoutBuilder::LayoutNonVirtualBase to take a ↵Anders Carlsson2010-05-291-10/+19
| | | | | | BaseSubobjectInfo. No functionality change. llvm-svn: 105103
* Move computing the base subobject info for a class into the ↵Anders Carlsson2010-05-291-94/+149
| | | | | | RecordLayoutBuilder because we're going to need it to be able to correctly add offsets for primary virtual bases. llvm-svn: 105102
* Rename BaseInfo to BaseSubobjectInfo.Anders Carlsson2010-05-281-25/+47
| | | | llvm-svn: 105007
* Move BaseInfo outside of the EmptySubobject class.Anders Carlsson2010-05-281-13/+13
| | | | llvm-svn: 105002
* More work on the empty subobject map. This code is not yet used.Anders Carlsson2010-05-271-7/+225
| | | | llvm-svn: 104861
* Sema: Add initial support for '#pragma options align=mac68k'.Daniel Dunbar2010-05-271-20/+32
| | | | | | | - 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
* More work on the new empty subobject map.Anders Carlsson2010-05-271-7/+169
| | | | llvm-svn: 104808
* Strip trailing whitespace.Daniel Dunbar2010-05-271-82/+82
| | | | llvm-svn: 104801
* AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar2010-05-271-6/+5
| | | | llvm-svn: 104795
* More work on the empty subobjects map.Anders Carlsson2010-05-271-28/+49
| | | | llvm-svn: 104787
OpenPOWER on IntegriCloud