a336c6f380 
								
							 
						 
						
							
							
								
								Additional comments and whitespace.  
							
							... 
							
							
							
							llvm-svn: 136892 
							
						 
						
							2011-08-04 17:52:43 +00:00  
				
					
						
							
							
								 
						
							
								18903ee2d3 
								
							 
						 
						
							
							
								
								Add partial support for using anonymous bitfields (e.g., int : 0) to enforce  
							
							... 
							
							
							
							alignment.  This fixes cases where the anonymous bitfield is followed by a 
non-bitfield member.  E.g.,
struct t4
{
  int foo : 1;
  long : 0;
  char bar;
};
Part of rdar://9859156
llvm-svn: 136858 
							
						 
						
							2011-08-04 01:21:14 +00:00  
				
					
						
							
							
								 
						
							
								0e62c1cc0b 
								
							 
						 
						
							
							
								
								remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports  
							
							... 
							
							
							
							them into the clang namespace.
llvm-svn: 135852 
							
						 
						
							2011-07-23 10:55:15 +00:00  
				
					
						
							
							
								 
						
							
								a91768e569 
								
							 
						 
						
							
							
								
								Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.  
							
							... 
							
							
							
							This was previously not-const only because it has to lazily construct a chain
of ivars the first time it is called (and after the chain is invalidated).
In practice, all the clients were just const_casting their const Decls;
all those now-unnecessary const_casts have been removed.
llvm-svn: 135741 
							
						 
						
							2011-07-22 02:08:32 +00:00  
				
					
						
							
							
								 
						
							
								b26d578b41 
								
							 
						 
						
							
							
								
								Eliminate most uses of ShallowCollectObjCIvars which requires  
							
							... 
							
							
							
							a vector for collection. Use iterators where needed instead.
// rdar://6817577
llvm-svn: 134015 
							
						 
						
							2011-06-28 18:05:25 +00:00  
				
					
						
							
							
								 
						
							
								300f55dcad 
								
							 
						 
						
							
							
								
								PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.  
							
							... 
							
							
							
							While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.
llvm-svn: 132861 
							
						 
						
							2011-06-10 21:53:06 +00:00  
				
					
						
							
							
								 
						
							
								783243b3ca 
								
							 
						 
						
							
							
								
								Implenment #pack pragma and ms_struct attribute layout.  
							
							... 
							
							
							
							Concludes // radar://8823265.
llvm-svn: 131188 
							
						 
						
							2011-05-11 16:58:31 +00:00  
				
					
						
							
							
								 
						
							
								07ceb0a1a4 
								
							 
						 
						
							
							
								
								Support pack pragma and ms_struct attributes. // rdar://8823265  
							
							... 
							
							
							
							llvm-svn: 131142 
							
						 
						
							2011-05-10 19:00:50 +00:00  
				
					
						
							
							
								 
						
							
								7adbed6b4d 
								
							 
						 
						
							
							
								
								'long long' requires special treatment in ms_struct  
							
							... 
							
							
							
							structs (impacts 32-bit only though).
llvm-svn: 131103 
							
						 
						
							2011-05-09 22:03:17 +00:00  
				
					
						
							
							
								 
						
							
								307eace474 
								
							 
						 
						
							
							
								
								In ms_struct structs, Establish a new alignment for a  
							
							... 
							
							
							
							non-bitfield following a bitfield if size of their types differ.
llvm-svn: 131032 
							
						 
						
							2011-05-06 22:42:22 +00:00  
				
					
						
							
							
								 
						
							
								b7a2879677 
								
							 
						 
						
							
							
								
								Establish a new alignment for an ms_struct bitfield following  
							
							... 
							
							
							
							a non-bitfield if size of their types differ.
llvm-svn: 131023 
							
						 
						
							2011-05-06 21:56:12 +00:00  
				
					
						
							
							
								 
						
							
								84335f7c8e 
								
							 
						 
						
							
							
								
								More ms_struct bitfield stuff:  
							
							... 
							
							
							
							Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.
llvm-svn: 130851 
							
						 
						
							2011-05-04 18:51:37 +00:00  
				
					
						
							
							
								 
						
							
								759e4a1add 
								
							 
						 
						
							
							
								
								Only the first zero-length bitfield decides alignment of  
							
							... 
							
							
							
							the followup data member in an ms_struct struct.
// rdar:// 8823265
llvm-svn: 130795 
							
						 
						
							2011-05-03 22:07:14 +00:00  
				
					
						
							
							
								 
						
							
								fc0fe6eb52 
								
							 
						 
						
							
							
								
								Finish off rules for z-length bitfields in ms_struct  
							
							... 
							
							
							
							structs. // rdar://8823265
llvm-svn: 130783 
							
						 
						
							2011-05-03 20:21:04 +00:00  
				
					
						
							
							
								 
						
							
								eb39741c0b 
								
							 
						 
						
							
							
								
								More rule enforcement of zero bitfields for ms_struct.  
							
							... 
							
							
							
							llvm-svn: 130696 
							
						 
						
							2011-05-02 17:20:56 +00:00  
				
					
						
							
							
								 
						
							
								595ec5d43c 
								
							 
						 
						
							
							
								
								Some refactoring of my ms_struct patch.  
							
							... 
							
							
							
							// rdar://8823265 related.
llvm-svn: 130311 
							
						 
						
							2011-04-27 17:14:21 +00:00  
				
					
						
							
							
								 
						
							
								bcb23a180b 
								
							 
						 
						
							
							
								
								With ms_struct attribut, Zero-length bitfields following  
							
							... 
							
							
							
							non-bitfield members are ignore. // rdar://8823265 wip
llvm-svn: 130257 
							
						 
						
							2011-04-26 23:52:16 +00:00  
				
					
						
							
							
								 
						
							
								022dbc1672 
								
							 
						 
						
							
							
								
								Simplify crash recovery cleanup registration.  
							
							... 
							
							
							
							llvm-svn: 128057 
							
						 
						
							2011-03-22 01:15:19 +00:00  
				
					
						
							
							
								 
						
							
								f75d089679 
								
							 
						 
						
							
							
								
								Recover memory from RecordLayoutBuilders during crashes.  
							
							... 
							
							
							
							llvm-svn: 127931 
							
						 
						
							2011-03-19 01:00:36 +00:00  
				
					
						
							
							
								 
						
							
								a1a2e8decb 
								
							 
						 
						
							
							
								
								Instead of round up sizes to '8', round them up to the alignment of the char  
							
							... 
							
							
							
							type.
llvm-svn: 127391 
							
						 
						
							2011-03-10 02:00:35 +00:00  
				
					
						
							
							
								 
						
							
								e73807538a 
								
							 
						 
						
							
							
								
								Round up the non-virtual size to the next char instead of rounding down.  
							
							... 
							
							
							
							llvm-svn: 127390 
							
						 
						
							2011-03-10 01:53:59 +00:00  
				
					
						
							
							
								 
						
							
								dbe37f38d0 
								
							 
						 
						
							
							
								
								Use CharUnits for TypeAlign variable in LayoutWideBitField(). No change in  
							
							... 
							
							
							
							functionality intended.
llvm-svn: 126730 
							
						 
						
							2011-03-01 01:36:00 +00:00  
				
					
						
							
							
								 
						
							
								aab635e67a 
								
							 
						 
						
							
							
								
								Change the return type of GetVirtualPointersSize() to CharUnits. No change  
							
							... 
							
							
							
							in functionality intended.
llvm-svn: 126727 
							
						 
						
							2011-03-01 01:22:45 +00:00  
				
					
						
							
							
								 
						
							
								1b4420ed42 
								
							 
						 
						
							
							
								
								Retry r126357. Use CharUnits for the Size and DataSize calculations when  
							
							... 
							
							
							
							they are known to be exact multiples of the width of the char type. Add a
test case to CodeGen/union.c that would have caught the problem with the
previous attempt. No change in functionality intended.
llvm-svn: 126628 
							
						 
						
							2011-02-28 02:01:38 +00:00  
				
					
						
							
							
								 
						
							
								30cdc7022b 
								
							 
						 
						
							
							
								
								Revert "Use CharUnits values for Size and DataSize outside of the bitfield  
							
							... 
							
							
							
							layout", it broke some GCC tests.
llvm-svn: 126386 
							
						 
						
							2011-02-24 16:40:53 +00:00  
				
					
						
							
							
								 
						
							
								8e74e79145 
								
							 
						 
						
							
							
								
								Use CharUnits values for Size and DataSize outside of the bitfield layout  
							
							... 
							
							
							
							methods, when they are known to be exact multiples of the width of the char
type. 
llvm-svn: 126357 
							
						 
						
							2011-02-24 02:12:14 +00:00  
				
					
						
							
							
								 
						
							
								3c215f2fd1 
								
							 
						 
						
							
							
								
								Use Context.getCharWidth() in place of literal '8's in assertions.  
							
							... 
							
							
							
							llvm-svn: 126356 
							
						 
						
							2011-02-24 01:33:05 +00:00  
				
					
						
							
							
								 
						
							
								ecfc75529f 
								
							 
						 
						
							
							
								
								Make the Size and DataSize members more CharUnits-friendly by wrapping them  
							
							... 
							
							
							
							with getter and setter methods in both bit units and CharUnits. This will help
simplify some of the unit mismatch in the parts of the code where sizes are
known to be exact multiples of the width of the char type.
Assertions in the getters help guard against accidentally converting to
CharUnits when sizes are not exact multiples of the char width.
llvm-svn: 126354 
							
						 
						
							2011-02-24 01:13:28 +00:00  
				
					
						
							
							
								 
						
							
								6d90e8937c 
								
							 
						 
						
							
							
								
								Expand use of CharUnits  in LayoutField(). No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 126066 
							
						 
						
							2011-02-20 02:06:09 +00:00  
				
					
						
							
							
								 
						
							
								85ef0431a7 
								
							 
						 
						
							
							
								
								Expand use of CharUnits for alignments further. No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 126034 
							
						 
						
							2011-02-19 18:58:07 +00:00  
				
					
						
							
							
								 
						
							
								02ced6fd19 
								
							 
						 
						
							
							
								
								Convert MaxFieldAlignment to CharUnits from bits. No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 125704 
							
						 
						
							2011-02-17 01:49:42 +00:00  
				
					
						
							
							
								 
						
							
								1300b3b357 
								
							 
						 
						
							
							
								
								Convert the UnpackedAlignment field to CharUnits from bits. No change in  
							
							... 
							
							
							
							functionality intended.
llvm-svn: 125643 
							
						 
						
							2011-02-16 02:11:31 +00:00  
				
					
						
							
							
								 
						
							
								4731d5b65a 
								
							 
						 
						
							
							
								
								Convert Alignment member to CharUnits from bits. No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 125641 
							
						 
						
							2011-02-16 02:05:21 +00:00  
				
					
						
							
							
								 
						
							
								af1c83fbe7 
								
							 
						 
						
							
							
								
								Convert NonVirtualSize to CharUnits from bits. No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 125639 
							
						 
						
							2011-02-16 01:52:01 +00:00  
				
					
						
							
							
								 
						
							
								a2d3dda041 
								
							 
						 
						
							
							
								
								Convert NonVirtualAlignment to CharUnits. No change in functionality  
							
							... 
							
							
							
							intended.
llvm-svn: 125638 
							
						 
						
							2011-02-16 01:43:15 +00:00  
				
					
						
							
							
								 
						
							
								7ad11e70b6 
								
							 
						 
						
							
							
								
								Convert RecordLayout::Alignment to CharUnits from bit units. No change in  
							
							... 
							
							
							
							functionality intended. 
llvm-svn: 125549 
							
						 
						
							2011-02-15 02:32:40 +00:00  
				
					
						
							
							
								 
						
							
								d5090c16f8 
								
							 
						 
						
							
							
								
								Convert RecordLayout::DataSize to CharUnits from bits, eliminating two  
							
							... 
							
							
							
							unnecessary calls to RoundUpToAlignment. No changes to functionality
intended.
llvm-svn: 125356 
							
						 
						
							2011-02-11 02:20:09 +00:00  
				
					
						
							
							
								 
						
							
								b0fcc59e19 
								
							 
						 
						
							
							
								
								Add a helper function, ASTContext::toBits(), that converts sizes in  
							
							... 
							
							
							
							CharUnits to sizes in bits, and use it to tidy up the places where the
conversion was done explicitly.
llvm-svn: 125332 
							
						 
						
							2011-02-11 01:54:29 +00:00  
				
					
						
							
							
								 
						
							
								c8ae55050d 
								
							 
						 
						
							
							
								
								Convert RecordLayout::Size to CharUnits from bits. No changes to  
							
							... 
							
							
							
							functionality intended.
llvm-svn: 125156 
							
						 
						
							2011-02-09 01:59:34 +00:00  
				
					
						
							
							
								 
						
							
								bec0285d7f 
								
							 
						 
						
							
							
								
								Convert RecordLayout::NonVirtualAlign to CharUnits. No change in  
							
							... 
							
							
							
							functionality intended.
llvm-svn: 125069 
							
						 
						
							2011-02-08 02:02:47 +00:00  
				
					
						
							
							
								 
						
							
								09b2331cf7 
								
							 
						 
						
							
							
								
								For gcc compatibility, size of a class which is zero  
							
							... 
							
							
							
							but has non-empty data fields, such as array of zero length,
remains zero.
// rdar://8945175
llvm-svn: 124741 
							
						 
						
							2011-02-02 19:36:18 +00:00  
				
					
						
							
							
								 
						
							
								dbe3927026 
								
							 
						 
						
							
							
								
								Basic support for -mms-bitfields, from Carl Norum!  
							
							... 
							
							
							
							llvm-svn: 124661 
							
						 
						
							2011-02-01 15:15:22 +00:00  
				
					
						
							
							
								 
						
							
								316d6f69bc 
								
							 
						 
						
							
							
								
								Convert RecordLayout::NonVirtualSize from bit units to CharUnits.  
							
							... 
							
							
							
							llvm-svn: 124646 
							
						 
						
							2011-02-01 01:52:10 +00:00  
				
					
						
							
							
								 
						
							
								7c4026bea7 
								
							 
						 
						
							
							
								
								Remove private toCharUnits() helper method, replacing with calls to  
							
							... 
							
							
							
							ASTContext::toCharUnitsFromBits().
llvm-svn: 124092 
							
						 
						
							2011-01-24 01:28:50 +00:00  
				
					
						
							
							
								 
						
							
								86a7fcc19c 
								
							 
						 
						
							
							
								
								Replace calls to CharUnits::fromQuantity() with ones  
							
							... 
							
							
							
							ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.
llvm-svn: 123715 
							
						 
						
							2011-01-18 01:56:16 +00:00  
				
					
						
							
							
								 
						
							
								39c7980772 
								
							 
						 
						
							
							
								
								PR3558: mark "logically const" accessor methods in ASTContext as const,  
							
							... 
							
							
							
							and mark the fields they use as mutable. This allows us to remove a few
const_casts.
llvm-svn: 123314 
							
						 
						
							2011-01-12 09:06:06 +00:00  
				
					
						
							
							
								 
						
							
								7bcde197d7 
								
							 
						 
						
							
							
								
								Fix PR8796.  
							
							... 
							
							
							
							The problem was that we were asserting the we never added an empty class
to the same offset twice. This is not true for unions, where two members, empty
or not, can have the some offset.
llvm-svn: 122633 
							
						 
						
							2010-12-29 23:02:58 +00:00  
				
					
						
							
							
								 
						
							
								d62c9be4fc 
								
							 
						 
						
							
							
								
								Fix another unnecessary-struct-padding issue.  
							
							... 
							
							
							
							llvm-svn: 121352 
							
						 
						
							2010-12-09 02:47:58 +00:00  
				
					
						
							
							
								 
						
							
								8b54274fcf 
								
							 
						 
						
							
							
								
								Before determining the effect the alignment of base struct will have in the aligment of the sub-struct,  
							
							... 
							
							
							
							take into account if the sub-struct is packed and its maximum field alignment.
Fixes rdar://8745206
llvm-svn: 121335 
							
						 
						
							2010-12-09 00:35:20 +00:00  
				
					
						
							
							
								 
						
							
								60a6263ee8 
								
							 
						 
						
							
							
								
								Move isNearlyEmpty out into the ASTContext so it can be called from CodeGen as well.  
							
							... 
							
							
							
							llvm-svn: 120137 
							
						 
						
							2010-11-25 01:51:53 +00:00  
				
					
						
							
							
								 
						
							
								7f95cd1817 
								
							 
						 
						
							
							
								
								Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.  
							
							... 
							
							
							
							llvm-svn: 120133 
							
						 
						
							2010-11-24 23:12:57 +00:00  
				
					
						
							
							
								 
						
							
								5adde29d86 
								
							 
						 
						
							
							
								
								Use the newly added function in ASTRecordLayoutBuilder.  
							
							... 
							
							
							
							llvm-svn: 120131 
							
						 
						
							2010-11-24 22:55:48 +00:00  
				
					
						
							
							
								 
						
							
								d004064864 
								
							 
						 
						
							
							
								
								Refactoring of Diagnostic class.  
							
							... 
							
							
							
							-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 
							
						 
						
							2010-11-18 20:06:41 +00:00  
				
					
						
							
							
								 
						
							
								09814d3f3a 
								
							 
						 
						
							
							
								
								Don't update empty field subobjects for bitfields. Fixes PR8519.  
							
							... 
							
							
							
							llvm-svn: 117921 
							
						 
						
							2010-11-01 15:14:51 +00:00  
				
					
						
							
							
								 
						
							
								0a14ee9ed8 
								
							 
						 
						
							
							
								
								Get rid of more calls to getBaseClassOffsetInBits.  
							
							... 
							
							
							
							llvm-svn: 117883 
							
						 
						
							2010-11-01 00:21:58 +00:00  
				
					
						
							
							
								 
						
							
								3f01871647 
								
							 
						 
						
							
							
								
								Port over a couple of getVBaseClassOffsetInBits call sites to use getVBaseClassOffset instead.  
							
							... 
							
							
							
							llvm-svn: 117882 
							
						 
						
							2010-10-31 23:45:59 +00:00  
				
					
						
							
							
								 
						
							
								fd88a6160d 
								
							 
						 
						
							
							
								
								Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.  
							
							... 
							
							
							
							llvm-svn: 117881 
							
						 
						
							2010-10-31 23:22:37 +00:00  
				
					
						
							
							
								 
						
							
								a2f8e41a0a 
								
							 
						 
						
							
							
								
								Start converting over the RecordLayoutBuilder next.  
							
							... 
							
							
							
							llvm-svn: 117878 
							
						 
						
							2010-10-31 22:20:42 +00:00  
				
					
						
							
							
								 
						
							
								28466ab8f4 
								
							 
						 
						
							
							
								
								EmptyObjectMap now uses CharUnits wherever possible.  
							
							... 
							
							
							
							llvm-svn: 117877 
							
						 
						
							2010-10-31 22:13:23 +00:00  
				
					
						
							
							
								 
						
							
								233e272775 
								
							 
						 
						
							
							
								
								More CharUnits conversion.  
							
							... 
							
							
							
							llvm-svn: 117875 
							
						 
						
							2010-10-31 21:54:55 +00:00  
				
					
						
							
							
								 
						
							
								725190ff3f 
								
							 
						 
						
							
							
								
								More CharUnits conversion.  
							
							... 
							
							
							
							llvm-svn: 117874 
							
						 
						
							2010-10-31 21:39:24 +00:00  
				
					
						
							
							
								 
						
							
								f8f756d1d5 
								
							 
						 
						
							
							
								
								Use CharUnits in the EmptyClassOffsets map.  
							
							... 
							
							
							
							llvm-svn: 117873 
							
						 
						
							2010-10-31 21:22:43 +00:00  
				
					
						
							
							
								 
						
							
								22f5720c27 
								
							 
						 
						
							
							
								
								Baby steps towards using only CharUnits for base class offsets in ASTRecordLayout. Start by storing the offsets in CharUnits in the ASTRecordLayout object.  
							
							... 
							
							
							
							llvm-svn: 117869 
							
						 
						
							2010-10-31 21:01:46 +00:00  
				
					
						
							
							
								 
						
							
								2fc373e155 
								
							 
						 
						
							
							
								
								Move classes into anonymous namespaces.  
							
							... 
							
							
							
							llvm-svn: 117104 
							
						 
						
							2010-10-22 16:33:16 +00:00  
				
					
						
							
							
								 
						
							
								6843141d39 
								
							 
						 
						
							
							
								
								Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.  
							
							... 
							
							
							
							Progress for rdar://7260160.
llvm-svn: 116508 
							
						 
						
							2010-10-14 20:14:38 +00:00  
				
					
						
							
							
								 
						
							
								8c64bbe032 
								
							 
						 
						
							
							
								
								Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).  
							
							... 
							
							
							
							llvm-svn: 116391 
							
						 
						
							2010-10-13 02:39:41 +00:00  
				
					
						
							
							
								 
						
							
								ca0d0cd3b9 
								
							 
						 
						
							
							
								
								Implement -Wpadded and -Wpacked.  
							
							... 
							
							
							
							-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 
							
						 
						
							2010-09-22 14:32:24 +00:00  
				
					
						
							
							
								 
						
							
								3c6cd17c8a 
								
							 
						 
						
							
							
								
								Use a smart pointer instead of delete.  
							
							... 
							
							
							
							llvm-svn: 112005 
							
						 
						
							2010-08-25 00:32:14 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								1ed0182413 
								
							 
						 
						
							
							
								
								Restore the build  
							
							... 
							
							
							
							llvm-svn: 111498 
							
						 
						
							2010-08-19 01:21:57 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								56df97761d 
								
							 
						 
						
							
							
								
								StringRef'ication of lots stuff, patch by Peter Davies!  
							
							... 
							
							
							
							llvm-svn: 111314 
							
						 
						
							2010-08-17 22:39:59 +00:00  
				
					
						
							
							
								 
						
							
								499e6e49e7 
								
							 
						 
						
							
							
								
								Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.  
							
							... 
							
							
							
							llvm-svn: 111101 
							
						 
						
							2010-08-15 10:17:39 +00:00  
				
					
						
							
							
								 
						
							
								0a33cb62a6 
								
							 
						 
						
							
							
								
								Add ATTRIBUTE_UNUSED to methods not supposed to be used.  
							
							... 
							
							
							
							llvm-svn: 111087 
							
						 
						
							2010-08-15 01:15:27 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								cc59cc5d80 
								
							 
						 
						
							
							
								
								Do the same short-circuit optimization when laying out bases.  
							
							... 
							
							
							
							llvm-svn: 105920 
							
						 
						
							2010-06-13 18:00:18 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								446872069f 
								
							 
						 
						
							
							
								
								Correctly handle fields with virtual bases containing empty subobjects.  
							
							... 
							
							
							
							llvm-svn: 105628 
							
						 
						
							2010-06-08 19:09:24 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								cc5de097a6 
								
							 
						 
						
							
							
								
								Minor cleanups to the empty subobject map.  
							
							... 
							
							
							
							llvm-svn: 105608 
							
						 
						
							2010-06-08 15:56:03 +00:00  
				
					
						
							
							
								 
						
							
								7498b32117 
								
							 
						 
						
							
							
								
								And now for the best part: Removing the old code.  
							
							... 
							
							
							
							llvm-svn: 105162 
							
						 
						
							2010-05-30 06:56:46 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								a7774a685d 
								
							 
						 
						
							
							
								
								Cleanup.  
							
							... 
							
							
							
							llvm-svn: 105114 
							
						 
						
							2010-05-29 21:10:24 +00:00  
				
					
						
							
							
								 
						
							
								a60b86a3fa 
								
							 
						 
						
							
							
								
								Make EmptySubobjectMap::CanPlaceBaseAtOffset take a BaseSubobjectInfo as well.  
							
							... 
							
							
							
							llvm-svn: 105113 
							
						 
						
							2010-05-29 20:49:49 +00:00  
				
					
						
							
							
								 
						
							
								d7f3fcf248 
								
							 
						 
						
							
							
								
								Change RecordLayoutBuilder::LayoutBase to take a BaseSubobjectInfo. No functionality change.  
							
							... 
							
							
							
							llvm-svn: 105112 
							
						 
						
							2010-05-29 20:47:33 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								d6ff5d7787 
								
							 
						 
						
							
							
								
								Change LayoutVirtualBase to also take a BaseSubobjectInfo.  
							
							... 
							
							
							
							llvm-svn: 105104 
							
						 
						
							2010-05-29 17:48:36 +00:00  
				
					
						
							
							
								 
						
							
								bb0e6787b0 
								
							 
						 
						
							
							
								
								Change RecordLayoutBuilder::LayoutNonVirtualBase to take a BaseSubobjectInfo. No functionality change.  
							
							... 
							
							
							
							llvm-svn: 105103 
							
						 
						
							2010-05-29 17:42:25 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								a7f3cdb0f2 
								
							 
						 
						
							
							
								
								Rename BaseInfo to BaseSubobjectInfo.  
							
							... 
							
							
							
							llvm-svn: 105007 
							
						 
						
							2010-05-28 21:24:37 +00:00  
				
					
						
							
							
								 
						
							
								056818f8a2 
								
							 
						 
						
							
							
								
								Move BaseInfo outside of the EmptySubobject class.  
							
							... 
							
							
							
							llvm-svn: 105002 
							
						 
						
							2010-05-28 21:13:31 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								439edd1aea 
								
							 
						 
						
							
							
								
								More work on the new empty subobject map.  
							
							... 
							
							
							
							llvm-svn: 104808 
							
						 
						
							2010-05-27 05:41:06 +00:00  
				
					
						
							
							
								 
						
							
								592a85c137 
								
							 
						 
						
							
							
								
								Strip trailing whitespace.  
							
							... 
							
							
							
							llvm-svn: 104801 
							
						 
						
							2010-05-27 02:25:46 +00:00  
				
					
						
							
							
								 
						
							
								401304462a 
								
							 
						 
						
							
							
								
								AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.  
							
							... 
							
							
							
							llvm-svn: 104795 
							
						 
						
							2010-05-27 01:12:46 +00:00  
				
					
						
							
							
								 
						
							
								c121b4e59f 
								
							 
						 
						
							
							
								
								More work on the empty subobjects map.  
							
							... 
							
							
							
							llvm-svn: 104787 
							
						 
						
							2010-05-27 00:07:01 +00:00  
				
					
						
							
							
								 
						
							
								c5ca1f7799 
								
							 
						 
						
							
							
								
								Move ComputeEmptySubobjectSizes to EmptySubobjectMap.  
							
							... 
							
							
							
							llvm-svn: 104702 
							
						 
						
							2010-05-26 15:54:25 +00:00  
				
					
						
							
							
								 
						
							
								f58de11b61 
								
							 
						 
						
							
							
								
								Stub out the EmptySubobjectsMap class.  
							
							... 
							
							
							
							llvm-svn: 104701 
							
						 
						
							2010-05-26 15:32:58 +00:00  
				
					
						
							
							
								 
						
							
								ce7f77729a 
								
							 
						 
						
							
							
								
								Inline the RecordLayoutBuilder constructor.  
							
							... 
							
							
							
							llvm-svn: 104700 
							
						 
						
							2010-05-26 15:20:08 +00:00  
				
					
						
							
							
								 
						
							
								c28a6c9251 
								
							 
						 
						
							
							
								
								Add a Layout overload that takes a CXXRecordDecl.  
							
							... 
							
							
							
							llvm-svn: 104695 
							
						 
						
							2010-05-26 15:10:00 +00:00  
				
					
						
							
							
								 
						
							
								c7656cdf83 
								
							 
						 
						
							
							
								
								Move RecordLayoutBuilder into an anonymous namespace.  
							
							... 
							
							
							
							llvm-svn: 104693 
							
						 
						
							2010-05-26 09:58:31 +00:00  
				
					
						
							
							
								 
						
							
								c222620adf 
								
							 
						 
						
							
							
								
								Rename ASTRecordLayoutBuilder to RecordLayoutBuilder.  
							
							... 
							
							
							
							llvm-svn: 104688 
							
						 
						
							2010-05-26 05:58:59 +00:00  
				
					
						
							
							
								 
						
							
								35a36eb78d 
								
							 
						 
						
							
							
								
								Move the ASTRecordLayoutBuilder class declaration into the .cpp file.  
							
							... 
							
							
							
							llvm-svn: 104686 
							
						 
						
							2010-05-26 05:41:04 +00:00  
				
					
						
							
							
								 
						
							
								b48414f4cb 
								
							 
						 
						
							
							
								
								Fix thinko and remove another unused function.  
							
							... 
							
							
							
							llvm-svn: 104683 
							
						 
						
							2010-05-26 05:31:23 +00:00  
				
					
						
							
							
								 
						
							
								1d1e4cf04d 
								
							 
						 
						
							
							
								
								Fix build.  
							
							... 
							
							
							
							llvm-svn: 104682 
							
						 
						
							2010-05-26 05:25:15 +00:00  
				
					
						
							
							
								 
						
							
								d20e7cd3c6 
								
							 
						 
						
							
							
								
								No need to use the PrimaryBaseInfo struct in the builder.  
							
							... 
							
							
							
							llvm-svn: 104681 
							
						 
						
							2010-05-26 05:20:58 +00:00  
				
					
						
							
							
								 
						
							
								87209bb54b 
								
							 
						 
						
							
							
								
								Remove FIXME.  
							
							... 
							
							
							
							llvm-svn: 104674 
							
						 
						
							2010-05-26 05:11:02 +00:00  
				
					
						
							
							
								 
						
							
								d295486012 
								
							 
						 
						
							
							
								
								Fold the other Layout overload into its sole call site.  
							
							... 
							
							
							
							llvm-svn: 104673 
							
						 
						
							2010-05-26 05:10:47 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								5f1a1704a2 
								
							 
						 
						
							
							
								
								Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.  
							
							... 
							
							
							
							llvm-svn: 103403 
							
						 
						
							2010-05-10 15:28:59 +00:00  
				
					
						
							
							
								 
						
							
								d626cb74d1 
								
							 
						 
						
							
							
								
								More work on handling empty classes.  
							
							... 
							
							
							
							llvm-svn: 103402 
							
						 
						
							2010-05-10 15:26:14 +00:00  
				
					
						
							
							
								 
						
							
								82828a31f6 
								
							 
						 
						
							
							
								
								Cleanup.  
							
							... 
							
							
							
							llvm-svn: 103370 
							
						 
						
							2010-05-09 05:03:38 +00:00  
				
					
						
							
							
								 
						
							
								15837f8f63 
								
							 
						 
						
							
							
								
								Actually compute the empty subobject sizes. No functionality change yet.  
							
							... 
							
							
							
							llvm-svn: 103363 
							
						 
						
							2010-05-08 23:06:26 +00:00  
				
					
						
							
							
								 
						
							
								2357bfd9d0 
								
							 
						 
						
							
							
								
								Add a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this will hold the largest empty subobject or 0 if the class doesn't have any empty subobjects.  
							
							... 
							
							
							
							llvm-svn: 103359 
							
						 
						
							2010-05-08 22:35:05 +00:00  
				
					
						
							
							
								 
						
							
								ccabe48235 
								
							 
						 
						
							
							
								
								AST: Dump ASTRecordLayout objects when they are created with -fdump-record-layouts.  
							
							... 
							
							
							
							llvm-svn: 101815 
							
						 
						
							2010-04-19 20:44:53 +00:00  
				
					
						
							
							
								 
						
							
								145f3f1e83 
								
							 
						 
						
							
							
								
								Fix -Wcast-qual warnings.  
							
							... 
							
							
							
							llvm-svn: 101786 
							
						 
						
							2010-04-19 16:39:44 +00:00  
				
					
						
							
							
								 
						
							
								aad5fa85d0 
								
							 
						 
						
							
							
								
								If a wide bit-field is inside a union its offset should always be 0.  
							
							... 
							
							
							
							llvm-svn: 101668 
							
						 
						
							2010-04-17 20:21:41 +00:00  
				
					
						
							
							
								 
						
							
								b11416d061 
								
							 
						 
						
							
							
								
								Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.  
							
							... 
							
							
							
							The next step is to print the name directly into the stream, avoiding a temporary std::string copy.
llvm-svn: 101632 
							
						 
						
							2010-04-17 09:33:03 +00:00  
				
					
						
							
							
								 
						
							
								d9abbe56a5 
								
							 
						 
						
							
							
								
								Remove printfs.  
							
							... 
							
							
							
							llvm-svn: 101470 
							
						 
						
							2010-04-16 15:59:41 +00:00  
				
					
						
							
							
								 
						
							
								5723516ce9 
								
							 
						 
						
							
							
								
								More work on wide bit-fields, WIP.  
							
							... 
							
							
							
							llvm-svn: 101467 
							
						 
						
							2010-04-16 15:57:11 +00:00  
				
					
						
							
							
								 
						
							
								5efc56e36b 
								
							 
						 
						
							
							
								
								Rename the ASTContext member 'Context'.  
							
							... 
							
							
							
							llvm-svn: 101462 
							
						 
						
							2010-04-16 15:07:51 +00:00  
				
					
						
							
							
								 
						
							
								ea7b18298e 
								
							 
						 
						
							
							
								
								Split adding the primary virtual base offsets out into a separate pass. This fixes a bug where we would lay out virtual bases in the wrong order.  
							
							... 
							
							
							
							llvm-svn: 101373 
							
						 
						
							2010-04-15 16:12:58 +00:00  
				
					
						
							
							
								 
						
							
								1da6511b99 
								
							 
						 
						
							
							
								
								Tweak spelling (Bitfield -> BitField)  
							
							... 
							
							
							
							llvm-svn: 101369 
							
						 
						
							2010-04-15 15:06:18 +00:00  
				
					
						
							
							
								 
						
							
								3d9289c736 
								
							 
						 
						
							
							
								
								Add TargetInfo::useBitfieldTypeAlignment().  
							
							... 
							
							
							
							- Used to determine whether the alignment of the type in a bit-field is
   respected when laying out structures. The default is true, targets can
   override this as needed.
 - This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in
   gcc. The AST/Sema implementation only affects one line, unless I have
   forgotten something. I'd appreciate further review.
 - IRgen still needs to be updated to fully support this (which is effectively
   PR5591).
llvm-svn: 101356 
							
						 
						
							2010-04-15 06:18:39 +00:00  
				
					
						
							
							
								 
						
							
								fe53aaef51 
								
							 
						 
						
							
							
								
								Remove unnecessary cast.  
							
							... 
							
							
							
							llvm-svn: 101176 
							
						 
						
							2010-04-13 20:52:05 +00:00  
				
					
						
							
							
								 
						
							
								7a148f7141 
								
							 
						 
						
							
							
								
								Fix another vbase layout bug.  
							
							... 
							
							
							
							llvm-svn: 100952 
							
						 
						
							2010-04-10 21:35:33 +00:00  
				
					
						
							
							
								 
						
							
								5b441d73b7 
								
							 
						 
						
							
							
								
								Add a simple debug-only verification pass to the record layout builder.  
							
							... 
							
							
							
							llvm-svn: 100951 
							
						 
						
							2010-04-10 21:24:48 +00:00  
				
					
						
							
							
								 
						
							
								291279e3a6 
								
							 
						 
						
							
							
								
								Simplify the virtual base layout code and fix a bug where we wouldn't store the offset for a virtual base.  
							
							... 
							
							
							
							llvm-svn: 100940 
							
						 
						
							2010-04-10 18:42:27 +00:00  
				
					
						
							
							
								 
						
							
								aa423afffc 
								
							 
						 
						
							
							
								
								AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.  
							
							... 
							
							
							
							llvm-svn: 100746 
							
						 
						
							2010-04-08 02:59:49 +00:00  
				
					
						
							
							
								 
						
							
								fe9009635d 
								
							 
						 
						
							
							
								
								More record layout builder cleanup and simplification.  
							
							... 
							
							
							
							llvm-svn: 98238 
							
						 
						
							2010-03-11 05:42:17 +00:00  
				
					
						
							
							
								 
						
							
								de710c9125 
								
							 
						 
						
							
							
								
								Get rid of the PrimaryBase parameter from LayoutVirtualBases.  
							
							... 
							
							
							
							llvm-svn: 98233 
							
						 
						
							2010-03-11 04:33:54 +00:00  
				
					
						
							
							
								 
						
							
								f7b7a1e781 
								
							 
						 
						
							
							
								
								More cleanup towards fixing the real bug.  
							
							... 
							
							
							
							llvm-svn: 98232 
							
						 
						
							2010-03-11 04:24:02 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								f2fa75bdbb 
								
							 
						 
						
							
							
								
								More cleanup.  
							
							... 
							
							
							
							llvm-svn: 98230 
							
						 
						
							2010-03-11 03:39:12 +00:00  
				
					
						
							
							
								 
						
							
								c4c00ec41b 
								
							 
						 
						
							
							
								
								More record layout builder cleanup.  
							
							... 
							
							
							
							llvm-svn: 98229 
							
						 
						
							2010-03-11 02:41:30 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								8630b5b09b 
								
							 
						 
						
							
							
								
								More cleanup and simplification of the record layout builder.  
							
							... 
							
							
							
							llvm-svn: 98208 
							
						 
						
							2010-03-11 00:15:35 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								09ffa32b92 
								
							 
						 
						
							
							
								
								More shuffling.  
							
							... 
							
							
							
							llvm-svn: 98197 
							
						 
						
							2010-03-10 22:21:28 +00:00  
				
					
						
							
							
								 
						
							
								f08e681ba8 
								
							 
						 
						
							
							
								
								Cleanups, no functionality change yet.  
							
							... 
							
							
							
							llvm-svn: 98196 
							
						 
						
							2010-03-10 22:16:06 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								ec345b7ecb 
								
							 
						 
						
							
							
								
								Simplify code. If we can reach here, the base must be virtual.  
							
							... 
							
							
							
							llvm-svn: 96211 
							
						 
						
							2010-02-15 04:28:35 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								f2c79b6b9c 
								
							 
						 
						
							
							
								
								Misc key function fixes.  
							
							... 
							
							
							
							llvm-svn: 90831 
							
						 
						
							2009-12-08 03:56:49 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								5ebf8b44e9 
								
							 
						 
						
							
							
								
								Move key functions to a separate map.  
							
							... 
							
							
							
							llvm-svn: 90745 
							
						 
						
							2009-12-07 04:35:11 +00:00  
				
					
						
							
							
								 
						
							
								71a26d8f82 
								
							 
						 
						
							
							
								
								Move helper onto CXXMethodDecl.  
							
							... 
							
							
							
							llvm-svn: 90716 
							
						 
						
							2009-12-06 20:50:05 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								a30c0d3ace 
								
							 
						 
						
							
							
								
								Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data structures!  
							
							... 
							
							
							
							llvm-svn: 90020 
							
						 
						
							2009-11-27 22:14:40 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								072094407d 
								
							 
						 
						
							
							
								
								Move bit-field layout out into a separate function. No functionality change.  
							
							... 
							
							
							
							llvm-svn: 89604 
							
						 
						
							2009-11-22 17:37:31 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								4e16d05dc4 
								
							 
						 
						
							
							
								
								Fixup spacing.  
							
							... 
							
							
							
							llvm-svn: 86792 
							
						 
						
							2009-11-11 02:49:00 +00:00  
				
					
						
							
							
								 
						
							
								2b84dd39be 
								
							 
						 
						
							
							
								
								Refine layout for indirect virtual base classes.  
							
							... 
							
							
							
							llvm-svn: 86116 
							
						 
						
							2009-11-05 04:02:15 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								534b0639db 
								
							 
						 
						
							
							
								
								Address comment from Daniel.  
							
							... 
							
							
							
							llvm-svn: 82865 
							
						 
						
							2009-09-26 16:55:29 +00:00  
				
					
						
							
							
								 
						
							
								47680d8040 
								
							 
						 
						
							
							
								
								Rename NextOffset to DataSize.  
							
							... 
							
							
							
							llvm-svn: 82832 
							
						 
						
							2009-09-26 01:34:51 +00:00  
				
					
						
							
							
								 
						
							
								7f78d85be4 
								
							 
						 
						
							
							
								
								Start at NextOffset when laying out bases as well.  
							
							... 
							
							
							
							llvm-svn: 82831 
							
						 
						
							2009-09-26 01:29:10 +00:00  
				
					
						
							
							
								 
						
							
								a6d95b5a3e 
								
							 
						 
						
							
							
								
								Use NextOffset when laying out a field.  
							
							... 
							
							
							
							llvm-svn: 82828 
							
						 
						
							2009-09-26 01:09:35 +00:00  
				
					
						
							
							
								 
						
							
								d7d358a65e 
								
							 
						 
						
							
							
								
								Even more work on empty classes.  
							
							... 
							
							
							
							llvm-svn: 82770 
							
						 
						
							2009-09-25 15:39:00 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								4bf82141e7 
								
							 
						 
						
							
							
								
								Handle array fields that contain empty structs.  
							
							... 
							
							
							
							llvm-svn: 82744 
							
						 
						
							2009-09-25 01:23:32 +00:00  
				
					
						
							
							
								 
						
							
								6f95c705ea 
								
							 
						 
						
							
							
								
								More work on empty classes.  
							
							... 
							
							
							
							llvm-svn: 82736 
							
						 
						
							2009-09-25 00:02:51 +00:00  
				
					
						
							
							
								 
						
							
								bb66bc8e84 
								
							 
						 
						
							
							
								
								More improvements with laying out empty bases.  
							
							... 
							
							
							
							llvm-svn: 82682 
							
						 
						
							2009-09-24 05:21:31 +00:00  
				
					
						
							
							
								 
						
							
								f24b18fb06 
								
							 
						 
						
							
							
								
								More work on empty classes.  
							
							... 
							
							
							
							llvm-svn: 82679 
							
						 
						
							2009-09-24 03:22:10 +00:00  
				
					
						
							
							
								 
						
							
								6522b05db7 
								
							 
						 
						
							
							
								
								Scaffolding for supporting empty bases/fields.  
							
							... 
							
							
							
							llvm-svn: 82678 
							
						 
						
							2009-09-24 03:13:30 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								96cff1fc10 
								
							 
						 
						
							
							
								
								Explicitly initialize the PrimaryBase and PrimaryBaseWasVirtual members.  
							
							... 
							
							
							
							llvm-svn: 82560 
							
						 
						
							2009-09-22 18:21:58 +00:00  
				
					
						
							
							
								 
						
							
								865715442e 
								
							 
						 
						
							
							
								
								Yes.  
							
							... 
							
							
							
							llvm-svn: 82559 
							
						 
						
							2009-09-22 17:38:02 +00:00  
				
					
						
							
							
								 
						
							
								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  
				
					
						
							
							
								 
						
							
								d6020c321a 
								
							 
						 
						
							
							
								
								Record layout builder cleanup.  
							
							... 
							
							
							
							llvm-svn: 82502 
							
						 
						
							2009-09-22 00:04:45 +00:00  
				
					
						
							
							
								 
						
							
								93b6d5e85e 
								
							 
						 
						
							
							
								
								Temporary band-aid for handling empty classes somewhat better.  
							
							... 
							
							
							
							llvm-svn: 82124 
							
						 
						
							2009-09-17 04:42:56 +00:00  
				
					
						
							
							
								 
						
							
								11289f4280 
								
							 
						 
						
							
							
								
								Remove tabs, and whitespace cleanups.  
							
							... 
							
							
							
							llvm-svn: 81346 
							
						 
						
							2009-09-09 15:08:12 +00:00  
				
					
						
							
							
								 
						
							
								996576f3aa 
								
							 
						 
						
							
							
								
								Refine vbase offset calculations.  WIP.  
							
							... 
							
							
							
							llvm-svn: 79198 
							
						 
						
							2009-08-16 19:04:13 +00:00  
				
					
						
							
							
								 
						
							
								22ea1f8a30 
								
							 
						 
						
							
							
								
								Cleanups and fixups for calculating the virtual base offsets.  WIP.  
							
							... 
							
							
							
							llvm-svn: 79156 
							
						 
						
							2009-08-16 01:46:26 +00:00  
				
					
						
							
							
								 
						
							
								bcf756cbac 
								
							 
						 
						
							
							
								
								Deconflate virtual base offsets from non-virtual base offsets.  
							
							... 
							
							
							
							Deconflate a virtual base primary from a non-virtual base.
llvm-svn: 78971 
							
						 
						
							2009-08-14 01:44:03 +00:00  
				
					
						
							
							
								 
						
							
								590a7c780c 
								
							 
						 
						
							
							
								
								We can't avoid doing the work to find all the indirect primary virtual  
							
							... 
							
							
							
							base classes as we'll need that to layout the virtual bases...
llvm-svn: 78954 
							
						 
						
							2009-08-13 23:26:06 +00:00  
				
					
						
							
							
								 
						
							
								c2f591b1e6 
								
							 
						 
						
							
							
								
								Refine vtable layout for virtual bases and keep better track of  
							
							... 
							
							
							
							primaries.  WIP.
llvm-svn: 78950 
							
						 
						
							2009-08-13 22:53:07 +00:00  
				
					
						
							
							
								 
						
							
								1300754fdd 
								
							 
						 
						
							
							
								
								Prep for vbase layout refinements.  WIP.  
							
							... 
							
							
							
							llvm-svn: 78882 
							
						 
						
							2009-08-13 02:02:14 +00:00  
				
					
						
							
							
								 
						
							
								6bb66bbd06 
								
							 
						 
						
							
							
								
								Refine virtual base layout.  WIP.  
							
							... 
							
							
							
							llvm-svn: 78873 
							
						 
						
							2009-08-13 00:34:14 +00:00  
				
					
						
							
							
								 
						
							
								cb2752bb5d 
								
							 
						 
						
							
							
								
								Remove another done audit FIXME.  
							
							... 
							
							
							
							llvm-svn: 78847 
							
						 
						
							2009-08-12 22:10:00 +00:00  
				
					
						
							
							
								 
						
							
								aa08da7906 
								
							 
						 
						
							
							
								
								Refactor a bit and remove some FIXME audit markers, now that the code  
							
							... 
							
							
							
							has been audited for correctness.
llvm-svn: 78846 
							
						 
						
							2009-08-12 22:06:55 +00:00  
				
					
						
							
							
								 
						
							
								6f3793b406 
								
							 
						 
						
							
							
								
								Refine primary vbase selection ordering.  WIP.  
							
							... 
							
							
							
							llvm-svn: 78844 
							
						 
						
							2009-08-12 21:50:08 +00:00  
				
					
						
							
							
								 
						
							
								78696a70bf 
								
							 
						 
						
							
							
								
								Implement more of the inductive case for vtable layout involving  
							
							... 
							
							
							
							virtual base primaries and improve the layout of classes with virtual
bases.  WIP.
Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between.  Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?
// CHECK: 1
// CHECK: 2
// CHECK: 3
// CHECK: 4
// CHECK: 5
// CHECK: 6
would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.
llvm-svn: 78638 
							
						 
						
							2009-08-11 04:03:59 +00:00  
				
					
						
							
							
								 
						
							
								28a5fa29f3 
								
							 
						 
						
							
							
								
								Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.  
							
							... 
							
							
							
							llvm-svn: 78490 
							
						 
						
							2009-08-08 19:38:24 +00:00  
				
					
						
							
							
								 
						
							
								68e0b68289 
								
							 
						 
						
							
							
								
								Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).  
							
							... 
							
							
							
							This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.
llvm-svn: 78483 
							
						 
						
							2009-08-08 18:23:56 +00:00  
				
					
						
							
							
								 
						
							
								c266c6d797 
								
							 
						 
						
							
							
								
								Add ability to generate vcall offsets for primary virtual base.  
							
							... 
							
							
							
							llvm-svn: 78396 
							
						 
						
							2009-08-07 19:00:50 +00:00  
				
					
						
							
							
								 
						
							
								6b2556f829 
								
							 
						 
						
							
							
								
								Layout virtual bases.  Work in progress.  
							
							... 
							
							
							
							llvm-svn: 78308 
							
						 
						
							2009-08-06 13:41:24 +00:00  
				
					
						
							
							
								 
						
							
								e9c85a7f58 
								
							 
						 
						
							
							
								
								Fix spell-o.  
							
							... 
							
							
							
							llvm-svn: 78303 
							
						 
						
							2009-08-06 12:52:13 +00:00  
				
					
						
							
							
								 
						
							
								2509480813 
								
							 
						 
						
							
							
								
								Fixup object layout when we have a primary base (it goes first).  Start preping for  
							
							... 
							
							
							
							virtual base layout.
llvm-svn: 78265 
							
						 
						
							2009-08-06 00:38:46 +00:00  
				
					
						
							
							
								 
						
							
								d8fe7b2792 
								
							 
						 
						
							
							
								
								Calculate the primary base class better and use that when laying down  
							
							... 
							
							
							
							the vtable.  Still a work in progress.
llvm-svn: 78252 
							
						 
						
							2009-08-05 22:37:18 +00:00  
				
					
						
							
							
								 
						
							
								bc78a728ee 
								
							 
						 
						
							
							
								
								Add code to setup the vtable pointer in the constructor.  Work in progress.  
							
							... 
							
							
							
							llvm-svn: 77699 
							
						 
						
							2009-07-31 18:25:34 +00:00  
				
					
						
							
							
								 
						
							
								57724c2f7e 
								
							 
						 
						
							
							
								
								Update based upon comments.  Explain why we have an assert.  
							
							... 
							
							
							
							llvm-svn: 77612 
							
						 
						
							2009-07-30 18:01:44 +00:00  
				
					
						
							
							
								 
						
							
								44b8e90369 
								
							 
						 
						
							
							
								
								We'll also need a vtable pointer if we have virtual bases.  
							
							... 
							
							
							
							llvm-svn: 77610 
							
						 
						
							2009-07-30 17:53:53 +00:00  
				
					
						
							
							
								 
						
							
								3dc7eb9440 
								
							 
						 
						
							
							
								
								Add ability to layout the vtable pointer in trivial cases.  I noticed  
							
							... 
							
							
							
							that we would silently do bad things with virtual bases in the layout
code, so, we just turn them off.  When people do better things with
them, we can turn them back on.
llvm-svn: 77556 
							
						 
						
							2009-07-30 00:22:38 +00:00  
				
					
						
							
							
								 
						
							
								c23c7e6a51 
								
							 
						 
						
							
							
								
								Change uses of:  
							
							... 
							
							
							
							Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510 
							
						 
						
							2009-07-29 21:53:49 +00:00  
				
					
						
							
							
								 
						
							
								7be1ad814b 
								
							 
						 
						
							
							
								
								No longer need to keep base class offsets in the offset  
							
							... 
							
							
							
							table as it has its own place now.
llvm-svn: 77491 
							
						 
						
							2009-07-29 18:50:06 +00:00  
				
					
						
							
							
								 
						
							
								fc8cfa8b9f 
								
							 
						 
						
							
							
								
								Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.  
							
							... 
							
							
							
							llvm-svn: 77352 
							
						 
						
							2009-07-28 19:24:15 +00:00  
				
					
						
							
							
								 
						
							
								dedf1e4b1a 
								
							 
						 
						
							
							
								
								ir-gen for non-virtual base class initialization  
							
							... 
							
							
							
							in constructors.
llvm-svn: 77087 
							
						 
						
							2009-07-25 21:12:28 +00:00  
				
					
						
							
							
								 
						
							
								6d9f6f326d 
								
							 
						 
						
							
							
								
								Handle layout of non-virtual base classes.  
							
							... 
							
							
							
							llvm-svn: 76348 
							
						 
						
							2009-07-19 00:18:47 +00:00  
				
					
						
							
							
								 
						
							
								118ce16bf5 
								
							 
						 
						
							
							
								
								Refactor field layout into a separate function.  
							
							... 
							
							
							
							llvm-svn: 76343 
							
						 
						
							2009-07-18 21:48:39 +00:00  
				
					
						
							
							
								 
						
							
								27b50135ee 
								
							 
						 
						
							
							
								
								Rename NextOffset to DataSize, which better matches the Itanium C++ ABI  
							
							... 
							
							
							
							llvm-svn: 76339 
							
						 
						
							2009-07-18 21:26:44 +00:00  
				
					
						
							
							
								 
						
							
								4f51628b02 
								
							 
						 
						
							
							
								
								More layout builder work.  
							
							... 
							
							
							
							llvm-svn: 76333 
							
						 
						
							2009-07-18 20:50:59 +00:00  
				
					
						
							
							
								 
						
							
								7947433411 
								
							 
						 
						
							
							
								
								Add a new ASTRecordLayoutBuilder class. Not used yet.  
							
							... 
							
							
							
							llvm-svn: 76330 
							
						 
						
							2009-07-18 20:20:21 +00:00