[cfe-commits] r80181 - in /cfe/trunk: lib/CodeGen/CGCXX.cpp test/CodeGenCXX/virt.cpp
Mike Stump
mrs at apple.com
Wed Aug 26 16:38:08 PDT 2009
Author: mrs
Date: Wed Aug 26 18:38:08 2009
New Revision: 80181
URL: http://llvm.org/viewvc/llvm-project?rev=80181&view=rev
Log:
Fixup codegen for static dispatch to a virtual function that was
almost correct. :-)
Modified:
cfe/trunk/lib/CodeGen/CGCXX.cpp
cfe/trunk/test/CodeGenCXX/virt.cpp
Modified: cfe/trunk/lib/CodeGen/CGCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXX.cpp?rev=80181&r1=80180&r2=80181&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXX.cpp Wed Aug 26 18:38:08 2009
@@ -216,7 +216,7 @@
// 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);
Modified: cfe/trunk/test/CodeGenCXX/virt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virt.cpp?rev=80181&r1=80180&r2=80181&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virt.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/virt.cpp Wed Aug 26 18:38:08 2009
@@ -137,8 +137,9 @@
// 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 @@
// 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(); };
More information about the cfe-commits
mailing list