summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-upgrade
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-upgrade')
-rw-r--r--llvm/tools/llvm-upgrade/UpgradeParser.cpp2
-rw-r--r--llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs2
-rw-r--r--llvm/tools/llvm-upgrade/UpgradeParser.y.cvs2
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.cpp b/llvm/tools/llvm-upgrade/UpgradeParser.cpp
index a863a8981fd..96cae3b3e60 100644
--- a/llvm/tools/llvm-upgrade/UpgradeParser.cpp
+++ b/llvm/tools/llvm-upgrade/UpgradeParser.cpp
@@ -546,7 +546,7 @@ static std::string getCastUpgrade(
SrcTy.destroy();
SrcTy.newTy = new std::string("ulong");
SrcTy.oldTy = ULongTy;
- } else if (DstTy.oldTy == BoolTy) {
+ } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
// cast ptr %x to bool was previously defined as setne ptr %x, null
// The ptrtoint semantic is to truncate, not compare so we must retain
// the original intent by replace the cast with a setne
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs b/llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs
index a863a8981fd..96cae3b3e60 100644
--- a/llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs
+++ b/llvm/tools/llvm-upgrade/UpgradeParser.cpp.cvs
@@ -546,7 +546,7 @@ static std::string getCastUpgrade(
SrcTy.destroy();
SrcTy.newTy = new std::string("ulong");
SrcTy.oldTy = ULongTy;
- } else if (DstTy.oldTy == BoolTy) {
+ } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
// cast ptr %x to bool was previously defined as setne ptr %x, null
// The ptrtoint semantic is to truncate, not compare so we must retain
// the original intent by replace the cast with a setne
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
index 126a37542e6..5a4118d8d74 100644
--- a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
+++ b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
@@ -188,7 +188,7 @@ static std::string getCastUpgrade(
SrcTy.destroy();
SrcTy.newTy = new std::string("ulong");
SrcTy.oldTy = ULongTy;
- } else if (DstTy.oldTy == BoolTy) {
+ } else if (DstTy.oldTy == BoolTy && SrcTy.oldTy != BoolTy) {
// cast ptr %x to bool was previously defined as setne ptr %x, null
// The ptrtoint semantic is to truncate, not compare so we must retain
// the original intent by replace the cast with a setne
OpenPOWER on IntegriCloud