[llvm-commits] CVS: llvm/tools/llvm-upgrade/UpgradeParser.y
Reid Spencer
reid at x10sys.com
Fri Jan 12 16:22:55 PST 2007
Changes in directory llvm/tools/llvm-upgrade:
UpgradeParser.y updated: 1.38 -> 1.39
---
Log message:
Don't attempt to upgrade argument to va.start and va.end if there are none.
---
Diffs of the changes: (+7 -5)
UpgradeParser.y | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
Index: llvm/tools/llvm-upgrade/UpgradeParser.y
diff -u llvm/tools/llvm-upgrade/UpgradeParser.y:1.38 llvm/tools/llvm-upgrade/UpgradeParser.y:1.39
--- llvm/tools/llvm-upgrade/UpgradeParser.y:1.38 Fri Jan 12 18:02:00 2007
+++ llvm/tools/llvm-upgrade/UpgradeParser.y Fri Jan 12 18:22:40 2007
@@ -1888,11 +1888,13 @@
} 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++);
More information about the llvm-commits
mailing list