<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Mar 6, 2015 at 10:53 AM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: majnemer<br>
Date: Fri Mar  6 12:53:55 2015<br>
New Revision: 231499<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=231499&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=231499&view=rev</a><br>
Log:<br>
MS ABI: Insert copy-constructors into the CatchableType<br>
<br>
Find all unambiguous public classes of the exception object's class type<br>
and reference all of their copy constructors.  Yes, this is not<br>
conforming but it is necessary in order to implement their ABI.  This is<br>
because the copy constructor is actually referenced by the metadata<br>
describing which catch handlers are eligible to handle the exception<br>
object.<br>
<br>
N.B.  This doesn't yet handle the copy constructor closure case yet,<br>
that work is ongoing.<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D8101" target="_blank">http://reviews.llvm.org/D8101</a><br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/ASTContext.h<br>
    cfe/trunk/include/clang/AST/Mangle.h<br>
    cfe/trunk/lib/AST/ASTContext.cpp<br>
    cfe/trunk/lib/AST/CXXABI.h<br>
    cfe/trunk/lib/AST/ItaniumCXXABI.cpp<br>
    cfe/trunk/lib/AST/MicrosoftCXXABI.cpp<br>
    cfe/trunk/lib/AST/MicrosoftMangle.cpp<br>
    cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
    cfe/trunk/lib/Sema/SemaExprCXX.cpp<br>
    cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp<br>
<br>
Modified: cfe/trunk/include/clang/AST/ASTContext.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/ASTContext.h (original)<br>
+++ cfe/trunk/include/clang/AST/ASTContext.h Fri Mar  6 12:53:55 2015<br>
@@ -2193,6 +2193,12 @@ public:<br>
   /// it is not used.<br>
   bool DeclMustBeEmitted(const Decl *D);<br>
<br>
+  const CXXConstructorDecl *<br>
+  getCopyConstructorForExceptionObject(CXXRecordDecl *RD);<br>
+<br>
+  void addCopyConstructorForExceptionObject(CXXRecordDecl *RD,<br>
+                                            CXXConstructorDecl *CD);<br>
+<br>
   void setManglingNumber(const NamedDecl *ND, unsigned Number);<br>
   unsigned getManglingNumber(const NamedDecl *ND) const;<br>
<br>
<br>
Modified: cfe/trunk/include/clang/AST/Mangle.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Mangle.h?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Mangle.h?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/Mangle.h (original)<br>
+++ cfe/trunk/include/clang/AST/Mangle.h Fri Mar  6 12:53:55 2015<br>
@@ -203,8 +203,8 @@ public:<br>
   virtual void mangleCXXCatchableTypeArray(QualType T, uint32_t NumEntries,<br>
                                            raw_ostream &Out) = 0;<br>
<br>
-  virtual void mangleCXXCatchableType(QualType T, uint32_t Size,<br>
-                                      raw_ostream &Out) = 0;<br>
+  virtual void mangleCXXCatchableType(QualType T, const CXXConstructorDecl *CD,<br>
+                                      uint32_t Size, raw_ostream &Out) = 0;<br>
<br>
   virtual void mangleCXXRTTIBaseClassDescriptor(<br>
       const CXXRecordDecl *Derived, uint32_t NVOffset, int32_t VBPtrOffset,<br>
<br>
Modified: cfe/trunk/lib/AST/ASTContext.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ASTContext.cpp (original)<br>
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Mar  6 12:53:55 2015<br>
@@ -8189,6 +8189,19 @@ MangleNumberingContext *ASTContext::crea<br>
   return ABI->createMangleNumberingContext();<br>
 }<br>
<br>
+const CXXConstructorDecl *<br>
+ASTContext::getCopyConstructorForExceptionObject(CXXRecordDecl *RD) {<br>
+  return ABI->getCopyConstructorForExceptionObject(<br>
+      cast<CXXRecordDecl>(RD->getFirstDecl()));<br>
+}<br>
+<br>
+void ASTContext::addCopyConstructorForExceptionObject(CXXRecordDecl *RD,<br>
+                                                      CXXConstructorDecl *CD) {<br>
+  return ABI->addCopyConstructorForExceptionObject(<br>
+      cast<CXXRecordDecl>(RD->getFirstDecl()),<br>
+      cast<CXXConstructorDecl>(CD->getFirstDecl()));<br>
+}<br>
+<br>
 void ASTContext::setParameterIndex(const ParmVarDecl *D, unsigned int index) {<br>
   ParamIndices[D] = index;<br>
 }<br>
<br>
Modified: cfe/trunk/lib/AST/CXXABI.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CXXABI.h?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CXXABI.h?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/CXXABI.h (original)<br>
+++ cfe/trunk/lib/AST/CXXABI.h Fri Mar  6 12:53:55 2015<br>
@@ -20,6 +20,7 @@<br>
 namespace clang {<br>
<br>
 class ASTContext;<br>
+class CXXConstructorDecl;<br>
 class MemberPointerType;<br>
 class MangleNumberingContext;<br>
<br>
@@ -41,6 +42,14 @@ public:<br>
<br>
   /// Returns a new mangling number context for this C++ ABI.<br>
   virtual MangleNumberingContext *createMangleNumberingContext() const = 0;<br>
+<br>
+  /// Adds a mapping from class to copy constructor for this C++ ABI.<br>
+  virtual void addCopyConstructorForExceptionObject(CXXRecordDecl *,<br>
+                                                    CXXConstructorDecl *) = 0;<br>
+<br>
+  /// Retrieves the mapping from class to copy constructor for this C++ ABI.<br>
+  virtual const CXXConstructorDecl *<br>
+  getCopyConstructorForExceptionObject(CXXRecordDecl *) = 0;<br>
 };<br>
<br>
 /// Creates an instance of a C++ ABI class.<br>
<br>
Modified: cfe/trunk/lib/AST/ItaniumCXXABI.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ItaniumCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/ItaniumCXXABI.cpp (original)<br>
+++ cfe/trunk/lib/AST/ItaniumCXXABI.cpp Fri Mar  6 12:53:55 2015<br>
@@ -133,6 +133,14 @@ public:<br>
     return Layout.getNonVirtualSize() == PointerSize;<br>
   }<br>
<br>
+  const CXXConstructorDecl *<br>
+  getCopyConstructorForExceptionObject(CXXRecordDecl *RD) override {<br>
+    return nullptr;<br>
+  }<br>
+<br>
+  void addCopyConstructorForExceptionObject(CXXRecordDecl *RD,<br>
+                                            CXXConstructorDecl *CD) override {}<br>
+<br>
   MangleNumberingContext *createMangleNumberingContext() const override {<br>
     return new ItaniumNumberingContext();<br>
   }<br>
<br>
Modified: cfe/trunk/lib/AST/MicrosoftCXXABI.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/MicrosoftCXXABI.cpp (original)<br>
+++ cfe/trunk/lib/AST/MicrosoftCXXABI.cpp Fri Mar  6 12:53:55 2015<br>
@@ -63,6 +63,8 @@ public:<br>
<br>
 class MicrosoftCXXABI : public CXXABI {<br>
   ASTContext &Context;<br>
+  llvm::SmallDenseMap<CXXRecordDecl *, CXXConstructorDecl *> RecordToCopyCtor;<br>
+<br>
 public:<br>
   MicrosoftCXXABI(ASTContext &Ctx) : Context(Ctx) { }<br>
<br>
@@ -82,13 +84,26 @@ public:<br>
       return false;<br>
<br>
     const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);<br>
-<br>
+<br>
     // In the Microsoft ABI, classes can have one or two vtable pointers.<br>
-    CharUnits PointerSize =<br>
-      Context.toCharUnitsFromBits(Context.getTargetInfo().getPointerWidth(0));<br>
+    CharUnits PointerSize =<br>
+        Context.toCharUnitsFromBits(Context.getTargetInfo().getPointerWidth(0));<br>
     return Layout.getNonVirtualSize() == PointerSize ||<br>
       Layout.getNonVirtualSize() == PointerSize * 2;<br>
-  }<br>
+  }<br>
+<br>
+  const CXXConstructorDecl *<br>
+  getCopyConstructorForExceptionObject(CXXRecordDecl *RD) override {<br>
+    return RecordToCopyCtor[RD];<br>
+  }<br>
+<br>
+  void<br>
+  addCopyConstructorForExceptionObject(CXXRecordDecl *RD,<br>
+                                       CXXConstructorDecl *CD) override {<br>
+    assert(CD != nullptr);<br>
+    assert(RecordToCopyCtor[RD] == nullptr || RecordToCopyCtor[RD] == CD);<br>
+    RecordToCopyCtor[RD] = CD;<br>
+  }<br>
<br>
   MangleNumberingContext *createMangleNumberingContext() const override {<br>
     return new MicrosoftNumberingContext();<br>
<br>
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)<br>
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Fri Mar  6 12:53:55 2015<br>
@@ -114,8 +114,8 @@ public:<br>
                           uint32_t NumEntries, raw_ostream &Out) override;<br>
   void mangleCXXCatchableTypeArray(QualType T, uint32_t NumEntries,<br>
                                    raw_ostream &Out) override;<br>
-  void mangleCXXCatchableType(QualType T, uint32_t Size,<br>
-                              raw_ostream &Out) override;<br>
+  void mangleCXXCatchableType(QualType T, const CXXConstructorDecl *CD,<br>
+                              uint32_t Size, raw_ostream &Out) override;<br>
   void mangleCXXRTTI(QualType T, raw_ostream &Out) override;<br>
   void mangleCXXRTTIName(QualType T, raw_ostream &Out) override;<br>
   void mangleCXXRTTIBaseClassDescriptor(const CXXRecordDecl *Derived,<br>
@@ -2307,13 +2307,25 @@ void MicrosoftMangleContextImpl::mangleC<br>
   Mangler.mangleType(T, SourceRange(), MicrosoftCXXNameMangler::QMM_Result);<br>
 }<br>
<br>
-void MicrosoftMangleContextImpl::mangleCXXCatchableType(QualType T,<br>
-                                                        uint32_t Size,<br>
-                                                        raw_ostream &Out) {<br>
+void MicrosoftMangleContextImpl::mangleCXXCatchableType(<br>
+    QualType T, const CXXConstructorDecl *CD, uint32_t Size, raw_ostream &Out) {<br>
   MicrosoftCXXNameMangler Mangler(*this, Out);<br>
-  Mangler.getStream() << "_CT??_R0";<br>
-  Mangler.mangleType(T, SourceRange(), MicrosoftCXXNameMangler::QMM_Result);<br>
-  Mangler.getStream() << "@8";<br>
+  Mangler.getStream() << "_CT";<br>
+<br>
+  llvm::SmallString<64> RTTIMangling;<br>
+  {<br>
+    llvm::raw_svector_ostream Stream(RTTIMangling);<br>
+    mangleCXXRTTI(T, Stream);<br>
+  }<br>
+  Mangler.getStream() << RTTIMangling.substr(1);<br>
+<br>
+  llvm::SmallString<64> CopyCtorMangling;<br>
+  if (CD) {<br>
+    llvm::raw_svector_ostream Stream(CopyCtorMangling);<br>
+    mangleCXXCtor(CD, Ctor_Complete, Stream);<br>
+  }<br>
+  Mangler.getStream() << CopyCtorMangling.substr(1);<br>
+<br>
   Mangler.getStream() << Size;<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Fri Mar  6 12:53:55 2015<br>
@@ -17,6 +17,7 @@<br>
 #include "CGCXXABI.h"<br>
 #include "CGVTables.h"<br>
 #include "CodeGenModule.h"<br>
+#include "CodeGenTypes.h"<br>
 #include "TargetInfo.h"<br>
 #include "clang/AST/Decl.h"<br>
 #include "clang/AST/DeclCXX.h"<br>
@@ -3225,11 +3226,14 @@ llvm::Constant *MicrosoftCXXABI::getCatc<br>
                                                   uint32_t VBIndex) {<br>
   assert(!T->isReferenceType());<br>
<br>
+  CXXRecordDecl *RD = T->getAsCXXRecordDecl();<br>
+  const CXXConstructorDecl *CD =<br>
+      RD ? CGM.getContext().getCopyConstructorForExceptionObject(RD) : nullptr;<br>
   uint32_t Size = getContext().getTypeSizeInChars(T).getQuantity();<br>
   SmallString<256> MangledName;<br>
   {<br>
     llvm::raw_svector_ostream Out(MangledName);<br>
-    getMangleContext().mangleCXXCatchableType(T, Size, Out);<br>
+    getMangleContext().mangleCXXCatchableType(T, CD, Size, Out);<br>
   }<br>
   if (llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(MangledName))<br>
     return getImageRelativeConstant(GV);<br>
@@ -3241,16 +3245,15 @@ llvm::Constant *MicrosoftCXXABI::getCatc<br>
   // The runtime is responsible for calling the copy constructor if the<br>
   // exception is caught by value.<br>
   llvm::Constant *CopyCtor =<br>
-      getImageRelativeConstant(llvm::Constant::getNullValue(CGM.Int8PtrTy));<br>
+      CD ? llvm::ConstantExpr::getBitCast(<br>
+               CGM.getAddrOfCXXStructor(CD, StructorType::Complete),<br>
+               CGM.Int8PtrTy)<br>
+         : llvm::Constant::getNullValue(CGM.Int8PtrTy);<br>
+  CopyCtor = getImageRelativeConstant(CopyCtor);<br>
<br>
-  bool IsScalar = true;<br>
+  bool IsScalar = !RD;<br>
   bool HasVirtualBases = false;<br>
   bool IsStdBadAlloc = false; // std::bad_alloc is special for some reason.<br>
-  if (T->getAsCXXRecordDecl()) {<br>
-    IsScalar = false;<br>
-    // TODO: Fill in the CopyCtor here!  This is not trivial due to<br>
-    // copy-constructors possessing things like default arguments.<br>
-  }<br>
   QualType PointeeType = T;<br>
   if (T->isPointerType())<br>
     PointeeType = T->getPointeeType();<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Fri Mar  6 12:53:55 2015<br>
@@ -657,6 +657,55 @@ ExprResult Sema::BuildCXXThrow(SourceLoc<br>
       CXXThrowExpr(Ex, Context.VoidTy, OpLoc, IsThrownVarInScope);<br>
 }<br>
<br>
+static void<br>
+collectPublicBases(CXXRecordDecl *RD,<br>
+                   llvm::DenseMap<CXXRecordDecl *, unsigned> &SubobjectsSeen,<br>
+                   llvm::SmallPtrSetImpl<CXXRecordDecl *> &VBases,<br>
+                   llvm::SetVector<CXXRecordDecl *> &PublicSubobjectsSeen,<br>
+                   bool ParentIsPublic) {<br>
+  for (const CXXBaseSpecifier &BS : RD->bases()) {<br>
+    CXXRecordDecl *BaseDecl = BS.getType()->getAsCXXRecordDecl();<br>
+    bool NewSubobject;<br>
+    // Virtual bases constitute the same subobject.  Non-virtual bases are<br>
+    // always distinct subobjects.<br>
+    if (BS.isVirtual())<br>
+      NewSubobject = VBases.insert(BaseDecl).second;<br>
+    else<br>
+      NewSubobject = true;<br>
+<br>
+    if (NewSubobject)<br>
+      ++SubobjectsSeen[BaseDecl];<br>
+<br>
+    // Only add subobjects which have public access throughout the entire chain.<br>
+    bool PublicPath = ParentIsPublic && BS.getAccessSpecifier() == AS_public;<br>
+    if (PublicPath)<br>
+      PublicSubobjectsSeen.insert(BaseDecl);<br>
+<br>
+    // Recurse on to each base subobject.<br>
+    collectPublicBases(BaseDecl, SubobjectsSeen, VBases, PublicSubobjectsSeen,<br>
+                       PublicPath);<br>
+  }<br>
+}<br>
+<br>
+static void getUnambiguousPublicSubobjects(<br>
+    CXXRecordDecl *RD, llvm::SmallVectorImpl<CXXRecordDecl *> &Objects) {<br>
+  llvm::DenseMap<CXXRecordDecl *, unsigned> SubobjectsSeen;<br>
+  llvm::SmallSet<CXXRecordDecl *, 2> VBases;<br>
+  llvm::SetVector<CXXRecordDecl *> PublicSubobjectsSeen;<br>
+  SubobjectsSeen[RD] = 1;<br>
+  PublicSubobjectsSeen.insert(RD);<br>
+  collectPublicBases(RD, SubobjectsSeen, VBases, PublicSubobjectsSeen,<br>
+                     /*ParentIsPublic=*/true);<br>
+<br>
+  for (CXXRecordDecl *PublicSubobject : PublicSubobjectsSeen) {<br>
+    // Skip ambiguous objects.<br>
+    if (SubobjectsSeen[PublicSubobject] > 1)<br>
+      continue;<br>
+<br>
+    Objects.push_back(PublicSubobject);<br>
+  }<br>
+}<br>
+<br>
 /// CheckCXXThrowOperand - Validate the operand of a throw.<br>
 ExprResult Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc, Expr *E,<br>
                                       bool IsThrownVarInScope) {<br>
@@ -723,18 +772,29 @@ ExprResult Sema::CheckCXXThrowOperand(So<br>
     return E;<br>
<br>
   // If the class has a destructor, we must be able to call it.<br>
-  if (RD->hasIrrelevantDestructor())<br>
-    return E;<br>
+  if (!RD->hasIrrelevantDestructor()) {<br>
+    if (CXXDestructorDecl *Destructor = LookupDestructor(RD)) {<br>
+      MarkFunctionReferenced(E->getExprLoc(), Destructor);<br>
+      CheckDestructorAccess(E->getExprLoc(), Destructor,<br>
+                            PDiag(diag::err_access_dtor_exception) << Ty);<br>
+      if (DiagnoseUseOfDecl(Destructor, E->getExprLoc()))<br>
+        return ExprError();<br>
+    }<br>
+  }<br>
<br>
-  CXXDestructorDecl *Destructor = LookupDestructor(RD);<br>
-  if (!Destructor)<br>
-    return E;<br>
+  if (Context.getTargetInfo().getCXXABI().isMicrosoft()) {<br>
+    llvm::SmallVector<CXXRecordDecl *, 2> UnambiguousPublicSubobjects;<br>
+    getUnambiguousPublicSubobjects(RD, UnambiguousPublicSubobjects);<br>
+    for (CXXRecordDecl *Subobject : UnambiguousPublicSubobjects) {<br>
+      if (CXXConstructorDecl *CD = LookupCopyingConstructor(Subobject, 0)) {<br>
+        if (CD->isTrivial())<br>
+          continue;<br></blockquote><div><br></div><div>Is this necessary? MarkFunctionReferenced checks this for constructors already. If it is necessary, do yo need to check for || hasAttr<DLLExportAttr> here? Same question for destructors above (think of an explicit defaulted protected dtor, which is trivial but not irrelevant.)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+        MarkFunctionReferenced(E->getExprLoc(), CD);<br>
+        Context.addCopyConstructorForExceptionObject(Subobject, CD);<br>
+      }<br>
+    }<br>
+  }<br>
<br>
-  MarkFunctionReferenced(E->getExprLoc(), Destructor);<br>
-  CheckDestructorAccess(E->getExprLoc(), Destructor,<br>
-                        PDiag(diag::err_access_dtor_exception) << Ty);<br>
-  if (DiagnoseUseOfDecl(Destructor, E->getExprLoc()))<br>
-    return ExprError();<br>
   return E;<br>
 }<br>
<br>
<br>
Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp?rev=231499&r1=231498&r2=231499&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp?rev=231499&r1=231498&r2=231499&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp (original)<br>
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-throw.cpp Fri Mar  6 12:53:55 2015<br>
@@ -1,16 +1,16 @@<br>
 // RUN: %clang_cc1 -emit-llvm -o - -triple=i386-pc-win32 %s -fcxx-exceptions | FileCheck %s<br>
<br>
 // CHECK-DAG: @"\01??_R0?AUY@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUY@@\00" }, comdat<br>
-// CHECK-DAG: @"_CT??_R0?AUY@@@88" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUY@@@8" to i8*), i32 0, i32 -1, i32 0, i32 8, i8* null }, comdat<br>
+// CHECK-DAG: @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUY@@@8" to i8*), i32 0, i32 -1, i32 0, i32 8, i8* bitcast (%struct.Y* (%struct.Y*, %struct.Y*, i32)* @"\01??0Y@@QAE@ABU0@@Z" to i8*) }, comdat<br>
 // CHECK-DAG: @"\01??_R0?AUZ@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUZ@@\00" }, comdat<br>
 // CHECK-DAG: @"_CT??_R0?AUZ@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUZ@@@8" to i8*), i32 0, i32 -1, i32 0, i32 1, i8* null }, comdat<br>
 // CHECK-DAG: @"\01??_R0?AUW@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUW@@\00" }, comdat<br>
-// CHECK-DAG: @"_CT??_R0?AUW@@@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUW@@@8" to i8*), i32 4, i32 -1, i32 0, i32 4, i8* null }, comdat<br>
+// CHECK-DAG: @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z4" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 4, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUW@@@8" to i8*), i32 4, i32 -1, i32 0, i32 4, i8* bitcast (%struct.W* (%struct.W*, %struct.W*, i32)* @"\01??0W@@QAE@ABU0@@Z" to i8*) }, comdat<br>
 // CHECK-DAG: @"\01??_R0?AUM@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUM@@\00" }, comdat<br>
 // CHECK-DAG: @"_CT??_R0?AUM@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUM@@@8" to i8*), i32 8, i32 -1, i32 0, i32 1, i8* null }, comdat<br>
 // CHECK-DAG: @"\01??_R0?AUV@@@8" = linkonce_odr global %rtti.TypeDescriptor7 { i8** @"\01??_7type_info@@6B@", i8* null, [8 x i8] c".?AUV@@\00" }, comdat<br>
 // CHECK-DAG: @"_CT??_R0?AUV@@@81" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 0, i8* bitcast (%rtti.TypeDescriptor7* @"\01??_R0?AUV@@@8" to i8*), i32 0, i32 4, i32 4, i32 1, i8* null }, comdat<br>
-// CHECK-DAG: @"_CTA5?AUY@@" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.5 { i32 5, [5 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0?AUY@@@88", %eh.CatchableType* @"_CT??_R0?AUZ@@@81", %eh.CatchableType* @"_CT??_R0?AUW@@@84", %eh.CatchableType* @"_CT??_R0?AUM@@@81", %eh.CatchableType* @"_CT??_R0?AUV@@@81"] }, comdat<br>
+// CHECK-DAG: @"_CTA5?AUY@@" = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.5 { i32 5, [5 x %eh.CatchableType*] [%eh.CatchableType* @"_CT??_R0?AUY@@@8??0Y@@QAE@ABU0@@Z8", %eh.CatchableType* @"_CT??_R0?AUZ@@@81", %eh.CatchableType* @"_CT??_R0?AUW@@@8??0W@@QAE@ABU0@@Z4", %eh.CatchableType* @"_CT??_R0?AUM@@@81", %eh.CatchableType* @"_CT??_R0?AUV@@@81"] }, comdat<br>
 // CHECK-DAG: @"_TI5?AUY@@" = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i8* bitcast (void (%struct.Y*)* @"\01??_DY@@QAE@XZ" to i8*), i8* null, i8* bitcast (%eh.CatchableTypeArray.5* @"_CTA5?AUY@@" to i8*) }, comdat<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>