[cfe-commits] r59887 - /cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Anders Carlsson
andersca at mac.com
Sat Nov 22 14:32:07 PST 2008
Author: andersca
Date: Sat Nov 22 16:32:07 2008
New Revision: 59887
URL: http://llvm.org/viewvc/llvm-project?rev=59887&view=rev
Log:
An expression is not foldable if it can't be fully evaluated. Fixes PR3060
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=59887&r1=59886&r2=59887&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Sat Nov 22 16:32:07 2008
@@ -197,8 +197,10 @@
// FIXME: Rename and handle conversion of other evaluatable things
// to bool.
- if (!Cond->Evaluate(V, getContext()) || !V.isInt())
- return 0; // Not foldable or not integer.
+ bool isEvaluated;
+ if (!Cond->Evaluate(V, getContext(), &isEvaluated) || !V.isInt() ||
+ !isEvaluated)
+ return 0; // Not foldable, not integer or not fully evaluatable.
if (CodeGenFunction::ContainsLabel(Cond))
return 0; // Contains a label.
More information about the cfe-commits
mailing list