diff options
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/virt.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index c72eca278c..3c7115d683 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -216,7 +216,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE) { // Explicit qualification with the scope operator (5.1) suppresses the // virtual call mechanism. llvm::Value *Callee; - if (MD->isVirtual() && !isa<CXXQualifiedMemberExpr>(CE)) { + if (MD->isVirtual() && !isa<CXXQualifiedMemberExpr>(ME)) { Callee = BuildVirtualCall(MD, This, Ty); } else Callee = CGM.GetAddrOfFunction(GlobalDecl(MD), Ty); diff --git a/test/CodeGenCXX/virt.cpp b/test/CodeGenCXX/virt.cpp index 4d63ab0a36..cf7bbc17f8 100644 --- a/test/CodeGenCXX/virt.cpp +++ b/test/CodeGenCXX/virt.cpp @@ -137,8 +137,9 @@ void test12_foo() { // CHECK-LPOPT32-NEXT: movl (%eax), %ecx // CHECK-LPOPT32-NEXT: movl %eax, (%esp) // CHECK-LPOPT32-NEXT: call *4(%ecx) -// FIXME: See EmitCXXMemberCallExpr -// CHECK-LPOPT32-NEXT call __ZN8test12_A3fooEv +// CHECK-LPOPT32-NEXT: movl _test12_pa, %eax +// CHECK-LPOPT32-NEXT: movl %eax, (%esp) +// CHECK-LPOPT32-NEXT: call L__ZN8test12_A3fooEv$stub // CHECK-LPOPT64:__Z10test12_foov: // CHECK-LPOPT64: movq _test12_pa(%rip), %rdi @@ -159,8 +160,8 @@ void test12_foo() { // CHECK-LPOPT64-NEXT: movq _test12_pd(%rip), %rdi // CHECK-LPOPT64-NEXT: movq (%rdi), %rax // CHECK-LPOPT64-NEXT: call *8(%rax) -// FIXME: See EmitCXXMemberCallExpr -// CHECK-LPOPT64-NEXT call __ZN8test12_A3fooEv +// CHECK-LPOPT64-NEXT: movq _test12_pa(%rip), %rdi +// CHECK-LPOPT64-NEXT: call __ZN8test12_A3fooEv struct test6_B2 { virtual void funcB2(); char b[1000]; }; struct test6_B1 : virtual test6_B2 { virtual void funcB1(); }; |