llvm-project/clang/lib/AST
Reid Kleckner e7de47efbe [ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong.  This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor.  They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases.  This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors.  In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch.  Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly.  This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1066

llvm-svn: 186828
2013-07-22 13:51:44 +00:00
..
APValue.cpp Pacify compilers that think you can drop off a fully covered switch. 2013-06-03 21:26:13 +00:00
ASTConsumer.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
ASTContext.cpp ObjC migrator: finding conforming protocol 2013-07-15 21:22:08 +00:00
ASTDiagnostic.cpp If a default argument is a dependent type, get the real type from the desugared 2013-07-20 03:49:02 +00:00
ASTDumper.cpp Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily. 2013-07-04 03:08:24 +00:00
ASTImporter.cpp Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily. 2013-07-04 03:08:24 +00:00
ASTTypeTraits.cpp Add more types to ASTNodeKind. Refactor common instantiation code. 2013-07-16 15:47:24 +00:00
AttrImpl.cpp [ms-cxxabi] Give the MS inheritance attributes a base class 2013-03-26 18:30:28 +00:00
CMakeLists.txt Fix CMakeLists.txt. 2013-07-01 20:34:51 +00:00
CXXABI.h [ms-cxxabi] Correctly compute the size of member pointers 2013-03-28 20:02:56 +00:00
CXXInheritance.cpp Use SmallVectorImpl instead of SmallVector for iterators and references to avoid specifying the vector size unnecessarily. 2013-07-04 03:08:24 +00:00
Comment.cpp [comment parsing]: Removes an unsafe API whose 2013-07-05 23:20:55 +00:00
CommentBriefParser.cpp Some refactoring in my patch on document 2013-03-02 02:39:57 +00:00
CommentCommandTraits.cpp Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]). 2013-07-15 03:38:40 +00:00
CommentLexer.cpp [doc parsing]: make single character command impostures 2013-05-09 17:18:52 +00:00
CommentParser.cpp Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None 2013-05-05 00:41:58 +00:00
CommentSema.cpp Comment parsing: allow "\param ..." to describe variadic arguments 2013-06-24 04:41:32 +00:00
Decl.cpp Tighten up the set of operator new/operator delete calls we're permitted to 2013-07-21 23:12:18 +00:00
DeclBase.cpp C++ modules: Don't call DeclContext::lookup when half-way through deserializing 2013-07-13 02:00:19 +00:00
DeclCXX.cpp Improve clarity/consistency of a few UsingDecl methods and related helpers. 2013-07-22 10:54:09 +00:00
DeclFriend.cpp Lazily deserialize the "first' friend declaration when deserializing a class 2013-06-26 02:41:25 +00:00
DeclGroup.cpp Sort all of Clang's files under 'lib', and fix up the broken headers 2012-12-04 09:13:33 +00:00
DeclObjC.cpp ObjC migrator: Improve on hueristics. 2013-07-10 21:30:22 +00:00
DeclOpenMP.cpp OpenMP: basic support for #pragma omp parallel 2013-07-19 03:13:43 +00:00
DeclPrinter.cpp Improve clarity/consistency of a few UsingDecl methods and related helpers. 2013-07-22 10:54:09 +00:00
DeclTemplate.cpp Lazily deserialize function template specializations. This fixes a cycle in 2013-06-28 04:37:53 +00:00
DeclarationName.cpp Provide operator<< for stream output of DeclarationNames 2013-05-14 21:04:00 +00:00
DumpXML.cpp Revert r175912, "Add support for coldcc to clang" at John's request. 2013-02-23 00:06:18 +00:00
Expr.cpp report unused-value warning also for warn_unused types 2013-07-21 13:15:58 +00:00
ExprCXX.cpp Fix source range of CXXNewExpr with parentheses around the type. PR15569. 2013-06-17 22:35:10 +00:00
ExprClassification.cpp Make IgnoreParens() look through ChooseExprs. 2013-07-20 00:40:58 +00:00
ExprConstant.cpp Make IgnoreParens() look through ChooseExprs. 2013-07-20 00:40:58 +00:00
ExternalASTSource.cpp Simplify FindExternalVisibleDeclsByName by making it return a bool indicating 2013-02-07 03:30:24 +00:00
InheritViz.cpp Use llvm::sys::fs::createTemporaryFile. 2013-07-05 20:00:06 +00:00
ItaniumCXXABI.cpp [ms-cxxabi] Correctly compute the size of member pointers 2013-03-28 20:02:56 +00:00
ItaniumMangle.cpp Finish off mangling locals in block literals. 2013-07-10 01:33:19 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
Mangle.cpp Get rid of dead/useless code for block mangling. 2013-07-10 01:13:27 +00:00
MangleNumberingContext.cpp More local mangling fixes. 2013-07-10 00:30:46 +00:00
MicrosoftCXXABI.cpp [ms-cxxabi] Implement member pointer emission and dereferencing 2013-04-11 18:13:19 +00:00
MicrosoftMangle.cpp [ms-cxxabi] Emit linkonce complete dtors in TUs that need them 2013-07-22 13:51:44 +00:00
NSAPI.cpp Use None rather than Optional<T>() where possible. 2013-02-21 01:47:18 +00:00
NestedNameSpecifier.cpp Streamify getNameForDiagnostic and remove the string versions of PrintTemplateArgumentList. 2013-02-22 15:46:01 +00:00
ParentMap.cpp [analyzer; new edges] Simplify edges in a C++11 for-range loop. 2013-06-06 21:53:45 +00:00
RawCommentList.cpp [Doc parsing] Provide diagnostics for unknown documentation 2013-05-03 23:15:20 +00:00
RecordLayout.cpp First pass at abstracting out a class for the target C++ ABI. 2013-01-25 22:30:49 +00:00
RecordLayoutBuilder.cpp Fix alignment of class derived from empty class. 2013-07-16 00:21:28 +00:00
SelectorLocationsKind.cpp Fix crash when using archaic protocol, rdar://10238337 2011-10-05 21:28:06 +00:00
Stmt.cpp OpenMP: basic support for #pragma omp parallel 2013-07-19 03:13:43 +00:00
StmtIterator.cpp Simplify StmtIterator. 2013-06-27 20:39:04 +00:00
StmtPrinter.cpp OpenMP: basic support for #pragma omp parallel 2013-07-19 03:13:43 +00:00
StmtProfile.cpp OpenMP: basic support for #pragma omp parallel 2013-07-19 03:13:43 +00:00
StmtViz.cpp
TemplateBase.cpp Fix one place I missed that was memcpy'ing TypeLocs in a way that messes 2013-06-20 04:11:21 +00:00
TemplateName.cpp Add quotation marks to template names in diagnostics. 2013-03-05 06:21:38 +00:00
Type.cpp Create calling convention AttributedType sugar nodes 2013-07-19 19:51:03 +00:00
TypeLoc.cpp Handle all TemplateArguments in trivial TypeLocs. 2013-06-26 23:30:50 +00:00
TypePrinter.cpp Create calling convention AttributedType sugar nodes 2013-07-19 19:51:03 +00:00
VTTBuilder.cpp Remove get(V)BaseClassOffsetInBits, the CharUnit functions should be used instead. 2012-07-04 18:45:14 +00:00
VTableBuilder.cpp Use SmallVectorImpl& for function arguments instead of SmallVector. 2013-07-05 19:34:19 +00:00