Author: andersca
Date: Sat Oct  3 14:56:56 2009
New Revision: 83272

URL: http://llvm.org/viewvc/llvm-project?rev=83272&view=rev
Log:
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.

Modified:
    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
    cfe/trunk/lib/CodeGen/CGExprConstant.cpp

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Sat Oct  3 14:56:56 2009
@@ -298,7 +298,7 @@
   llvm::Value *FuncPtr;
   
   if (MD->isVirtual()) {
-    uint64_t Index = CGF.CGM.GetVtableIndex(MD);
+    uint64_t Index = CGF.CGM.GetVtableIndex(MD->getCanonicalDecl());
     
     FuncPtr = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
   } else {

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Sat Oct  3 14:56:56 2009
@@ -413,7 +413,7 @@
     
     // Get the function pointer (or index if this is a virtual function).
     if (MD->isVirtual()) {
-      uint64_t Index = CGM.GetVtableIndex(MD);
+      uint64_t Index = CGM.GetVtableIndex(MD->getCanonicalDecl());
       
       Values[0] = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
     } else {


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to