summaryrefslogtreecommitdiffstats
path: root/clang/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
commita1b54fdbe1c3b7a8cab0e15083af7c97cb8d53ea (patch)
treebae61a5a33d744268aaa8426d2ef9936b59eb7f2 /clang/lib/CodeGen/CGCXX.cpp
parenta81b3256a4e34d8c1de1a5986ab2112e861e2c52 (diff)
downloadbcm5719-llvm-a1b54fdbe1c3b7a8cab0e15083af7c97cb8d53ea.tar.gz
bcm5719-llvm-a1b54fdbe1c3b7a8cab0e15083af7c97cb8d53ea.zip
Even more devirtualization cleverness.
llvm-svn: 83886
Diffstat (limited to 'clang/lib/CodeGen/CGCXX.cpp')
-rw-r--r--clang/lib/CodeGen/CGCXX.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index f19067941e7..ff56c8c85a2 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/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();
OpenPOWER on IntegriCloud