diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-13 00:22:40 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-13 00:22:40 +0000 |
commit | 2b2176155677a0442e46c8c6b9246581cc0b39d2 (patch) | |
tree | 49b1848b5c695b25865cb2eddc3487c1e227eb50 /tools | |
parent | b3258a3c0f6e01459874ecaad31adbe88acc3d8b (diff) | |
download | external_llvm-2b2176155677a0442e46c8c6b9246581cc0b39d2.zip external_llvm-2b2176155677a0442e46c8c6b9246581cc0b39d2.tar.gz external_llvm-2b2176155677a0442e46c8c6b9246581cc0b39d2.tar.bz2 |
Don't attempt to upgrade argument to va.start and va.end if there are none.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.y | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y index 2b2d1ec..ed70cbbf 100644 --- a/tools/llvm-upgrade/UpgradeParser.y +++ b/tools/llvm-upgrade/UpgradeParser.y @@ -1888,11 +1888,13 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { } else { static unsigned upgradeCount = 1; if (*$4.val == "%llvm.va_start" || *$4.val == "%llvm.va_end") { - std::string name("%va_upgrade"); - name += llvm::utostr(upgradeCount++); - $1->insert(0, name + " = bitcast " + *(*$6)[0].val + " to i8*\n "); - *(*$6)[0].val = "i8* " + name; - (*$6)[0].type = TypeInfo::get("i8", UByteTy)->getPointerType(); + if (!$6->empty()) { + std::string name("%va_upgrade"); + name += llvm::utostr(upgradeCount++); + $1->insert(0, name + " = bitcast " + *(*$6)[0].val + " to i8*\n "); + *(*$6)[0].val = "i8* " + name; + (*$6)[0].type = TypeInfo::get("i8", UByteTy)->getPointerType(); + } } else if (*$4.val == "%llvm.va_copy") { std::string name0("%va_upgrade"); name0 += llvm::utostr(upgradeCount++); |