forked from OSchip/llvm-project
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
llvm-svn: 83272
This commit is contained in:
parent
2ee3c011d9
commit
d5931cd2b7
|
@ -298,7 +298,7 @@ void AggExprEmitter::VisitUnaryAddrOf(const UnaryOperator *E) {
|
||||||
llvm::Value *FuncPtr;
|
llvm::Value *FuncPtr;
|
||||||
|
|
||||||
if (MD->isVirtual()) {
|
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);
|
FuncPtr = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -413,7 +413,7 @@ public:
|
||||||
|
|
||||||
// Get the function pointer (or index if this is a virtual function).
|
// Get the function pointer (or index if this is a virtual function).
|
||||||
if (MD->isVirtual()) {
|
if (MD->isVirtual()) {
|
||||||
uint64_t Index = CGM.GetVtableIndex(MD);
|
uint64_t Index = CGM.GetVtableIndex(MD->getCanonicalDecl());
|
||||||
|
|
||||||
Values[0] = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
|
Values[0] = llvm::ConstantInt::get(PtrDiffTy, Index + 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue