diff options
author | Mike Stump <mrs@apple.com> | 2009-08-26 23:38:08 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-08-26 23:38:08 +0000 |
commit | 63bb7c2b281c62a30233b1638ecd8fb4048a38c4 (patch) | |
tree | 67b307b0b6b0b1e3c90379b5705c4818813a30c8 | |
parent | 76c5b55a5e4a02abc930067c23b87530036b7b37 (diff) |
Fixup codegen for static dispatch to a virtual function that was
almost correct. :-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80181 91177308-0d34-0410-b5e6-96231b3b80d8
-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(); }; |