]> granicus.if.org Git - clang/commitdiff
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
authorAnders Carlsson <andersca@mac.com>
Sat, 3 Oct 2009 19:56:56 +0000 (19:56 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 3 Oct 2009 19:56:56 +0000 (19:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGExprConstant.cpp

index 1dd97d6a228bd1bc3c805760a900df394cb1f7bc..82ec4fd0b7be822caf365cda27ea6f03d4bb3870 100644 (file)
@@ -298,7 +298,7 @@ void AggExprEmitter::VisitUnaryAddrOf(const UnaryOperator *E) {
   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 {
index a742355f74d58090c9f5d3de18dee11061688524..0fd765235c9673b51aed706a7c5de9639ee523b4 100644 (file)
@@ -413,7 +413,7 @@ public:
     
     // 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 {