[cfe-commits] r81398 - /cfe/trunk/lib/CodeGen/CGCXX.cpp

Anders Carlsson andersca at mac.com
Wed Sep 9 16:17:19 PDT 2009


Author: andersca
Date: Wed Sep  9 18:17:18 2009
New Revision: 81398

URL: http://llvm.org/viewvc/llvm-project?rev=81398&view=rev
Log:
Use the right GlobalDecl type for destructors.

Modified:
    cfe/trunk/lib/CodeGen/CGCXX.cpp

Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=81398&r1=81397&r2=81398&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Sep  9 18:17:18 2009
@@ -972,7 +972,13 @@
   }
 
   void AddMethod(const CXXMethodDecl *MD, bool MorallyVirtual, Index_t Offset) {
-    llvm::Constant *m = wrap(CGM.GetAddrOfFunction(GlobalDecl(MD), Ptr8Ty));
+    GlobalDecl GD;
+    if (const CXXDestructorDecl *Dtor = dyn_cast<CXXDestructorDecl>(MD))
+      GD = GlobalDecl(Dtor, Dtor_Complete);
+    else
+      GD = GlobalDecl(MD);
+
+    llvm::Constant *m = wrap(CGM.GetAddrOfFunction(GD, Ptr8Ty));
     // If we can find a previously allocated slot for this, reuse it.
     if (OverrideMethod(MD, m, MorallyVirtual, Offset))
       return;





More information about the cfe-commits mailing list