Skip to content

Commit

Permalink
[llvm][NFC] Refactor AutoUpgrade dbg case
Browse files Browse the repository at this point in the history
Consume the dbg. prefix before looking further. Also merge the matched
path.

Differential Revision: https://reviews.llvm.org/D158341

Reviewed By: nikic
  • Loading branch information
urnathan committed Aug 20, 2023
1 parent ef38e6d commit 326280d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions llvm/lib/IR/AutoUpgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,19 +930,16 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
}
break;
}
case 'd': {
if (Name == "dbg.addr") {
rename(F);
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::dbg_value);
return true;
}
if (Name == "dbg.value" && F->arg_size() == 4) {
rename(F);
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::dbg_value);
return true;
case 'd':
if (Name.consume_front("dbg.")) {
if (Name == "addr" || (Name == "value" && F->arg_size() == 4)) {
rename(F);
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::dbg_value);
return true;
}
break; // No other 'dbg.*'.
}
break;
}
case 'e':
if (Name.consume_front("experimental.vector.")) {
Intrinsic::ID ID = StringSwitch<Intrinsic::ID>(Name)
Expand Down

0 comments on commit 326280d

Please sign in to comment.