Changes in directory llvm/tools/llvm-upgrade:
UpgradeParser.y updated: 1.22 -> 1.23 --- Log message: When upgrading cast to bool to a setne, generate icmp ne instead. --- Diffs of the changes: (+10 -4) UpgradeParser.y | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) Index: llvm/tools/llvm-upgrade/UpgradeParser.y diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.22 llvm/tools/llvm-upgrade/UpgradeParser.y:1.23 --- llvm/tools/llvm-upgrade/UpgradeParser.y:1.22 Wed Dec 6 22:22:23 2006 +++ llvm/tools/llvm-upgrade/UpgradeParser.y Sat Dec 9 10:56:55 2006 @@ -194,10 +194,16 @@ // the original intent by replace the cast with a setne const char* comparator = SrcTy.isPointer() ? ", null" : (SrcTy.isFloatingPoint() ? ", 0.0" : ", 0"); - if (isConst) - Result = "setne (" + Source + comparator + ")"; - else - Result = "setne " + Source + comparator; +#if UPGRADE_SETCOND_OPS + const char* compareOp = SrcTy.isFloatingPoint() ? "setne " : "icmp ne "; +#else + const char* compareOp = "setne"; +#endif + if (isConst) { + Result = "(" + Source + comparator + ")"; + Result = compareOp + Result; + } else + Result = compareOp + Source + comparator; return Result; // skip cast processing below } ResolveType(SrcTy); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits