aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-10-12 19:51:33 +0000
committerAnders Carlsson <andersca@mac.com>2009-10-12 19:51:33 +0000
commitcf5deecd7885b544f1197846897513858863e3af (patch)
tree96bd47f7eea679fdd0e36b98bc0d1d8c5e544d07 /lib/CodeGen/CGCXX.cpp
parent76366487694e92509f938164f384bbdfad002f2b (diff)
More devirtualization improvements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83883 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index ed7ee4298c..f19067941e 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -214,6 +214,10 @@ static bool canDevirtualizeMemberFunctionCalls(const Expr *Base) {
if (isa<CXXTemporaryObjectExpr>(Base))
return true;
+ // Check if this is a call expr that returns a record type.
+ if (const CallExpr *CE = dyn_cast<CallExpr>(Base))
+ return CE->getCallReturnType()->isRecordType();
+
// We can't devirtualize the call.
return false;
}