aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-10-12 19:59:15 +0000
committerAnders Carlsson <andersca@mac.com>2009-10-12 19:59:15 +0000
commit4a0d832ecdc15b0667616d3ec570cade4761ceaf (patch)
tree5e88c10a92b06587920f5547ebd6c483f489d906 /lib/CodeGen/CGCXX.cpp
parent87342dc37237c6efb9e311bacb12547de3ccbc0f (diff)
Even more devirtualization cleverness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index f19067941e..ff56c8c85a 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -210,10 +210,14 @@ static bool canDevirtualizeMemberFunctionCalls(const Expr *Base) {
return false;
}
- // We can always devirtualize calls on temporaries.
+ // We can always devirtualize calls on temporary object expressions.
if (isa<CXXTemporaryObjectExpr>(Base))
return true;
+ // And calls on bound temporaries.
+ if (isa<CXXBindTemporaryExpr>(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();