From a1b54fdbe1c3b7a8cab0e15083af7c97cb8d53ea Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 12 Oct 2009 19:59:15 +0000 Subject: Even more devirtualization cleverness. llvm-svn: 83886 --- clang/lib/CodeGen/CGCXX.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib') 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(Base)) return true; + // And calls on bound temporaries. + if (isa(Base)) + return true; + // Check if this is a call expr that returns a record type. if (const CallExpr *CE = dyn_cast(Base)) return CE->getCallReturnType()->isRecordType(); -- cgit v1.2.3