aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/Decl.cpp4
-rw-r--r--lib/CodeGen/CGCXX.cpp3
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 25d3d44cc8..24dd3e5e3d 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -653,6 +653,10 @@ FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) {
}
}
+const FunctionDecl *FunctionDecl::getCanonicalDecl() const {
+ return getFirstDeclaration();
+}
+
FunctionDecl *FunctionDecl::getCanonicalDecl() {
return getFirstDeclaration();
}
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index 4c1f6ad4cd..e37b4a8548 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -221,7 +221,8 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE) {
// virtual call mechanism.
llvm::Value *Callee;
if (MD->isVirtual() && !ME->hasQualifier())
- Callee = BuildVirtualCall(MD, This, Ty);
+ // FIXME: push getCanonicalDecl as a conversion using the static type system (CanCXXMethodDecl).
+ Callee = BuildVirtualCall(MD->getCanonicalDecl(), This, Ty);
else if (const CXXDestructorDecl *Destructor
= dyn_cast<CXXDestructorDecl>(MD))
Callee = CGM.GetAddrOfFunction(GlobalDecl(Destructor, Dtor_Complete), Ty);