aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-19 20:07:07 +0000
committerGitHub <noreply@github.com>2024-03-19 20:07:07 +0000
commitffd08c7759000f55332f1657a1fab64a7adc03fd (patch)
treeffc35f7afc77e9aa3ff89031c72a9ec8e7321b2b /llvm/lib/IR/AutoUpgrade.cpp
parent3cd9dccbb4235e057d0e53ab0b9673f3766800d4 (diff)
downloadllvm-ffd08c7759000f55332f1657a1fab64a7adc03fd.zip
llvm-ffd08c7759000f55332f1657a1fab64a7adc03fd.tar.gz
llvm-ffd08c7759000f55332f1657a1fab64a7adc03fd.tar.bz2
[RemoveDIs][NFC] Rename DPValue -> DbgVariableRecord (#85216)
This is the major rename patch that prior patches have built towards. The DPValue class is being renamed to DbgVariableRecord, which reflects the updated terminology for the "final" implementation of the RemoveDI feature. This is a pure string substitution + clang-format patch. The only manual component of this patch was determining where to perform these string substitutions: `DPValue` and `DPV` are almost exclusively used for DbgRecords, *except* for: - llvm/lib/target, where 'DP' is used to mean double-precision, and so appears as part of .td files and in variable names. NB: There is a single existing use of `DPValue` here that refers to debug info, which I've manually updated. - llvm/tools/gold, where 'LDPV' is used as a prefix for symbol visibility enums. Outside of these places, I've applied several basic string substitutions, with the intent that they only affect DbgRecord-related identifiers; I've checked them as I went through to verify this, with reasonable confidence that there are no unintended changes that slipped through the cracks. The substitutions applied are all case-sensitive, and are applied in the order shown: ``` DPValue -> DbgVariableRecord DPVal -> DbgVarRec DPV -> DVR ``` Following the previous rename patches, it should be the case that there are no instances of any of these strings that are meant to refer to the general case of DbgRecords, or anything other than the DPValue class. The idea behind this patch is therefore that pure string substitution is correct in all cases as long as these assumptions hold.
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/IR/AutoUpgrade.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index c28a291..7d954f9 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1067,7 +1067,7 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
}
}
// Update llvm.dbg.addr intrinsics even in "new debug mode"; they'll get
- // converted to DPValues later.
+ // converted to DbgVariableRecords later.
if (Name == "addr" || (Name == "value" && F->arg_size() == 4)) {
rename(F);
NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::dbg_value);
@@ -2360,23 +2360,23 @@ static void upgradeDbgIntrinsicToDbgRecord(StringRef Name, CallBase *CI) {
if (Name == "label") {
DR = new DPLabel(unwrapMAVOp<DILabel>(CI, 0), CI->getDebugLoc());
} else if (Name == "assign") {
- DR = new DPValue(
+ DR = new DbgVariableRecord(
unwrapMAVOp<Metadata>(CI, 0), unwrapMAVOp<DILocalVariable>(CI, 1),
unwrapMAVOp<DIExpression>(CI, 2), unwrapMAVOp<DIAssignID>(CI, 3),
unwrapMAVOp<Metadata>(CI, 4), unwrapMAVOp<DIExpression>(CI, 5),
CI->getDebugLoc());
} else if (Name == "declare") {
- DR = new DPValue(unwrapMAVOp<Metadata>(CI, 0),
- unwrapMAVOp<DILocalVariable>(CI, 1),
- unwrapMAVOp<DIExpression>(CI, 2), CI->getDebugLoc(),
- DPValue::LocationType::Declare);
+ DR = new DbgVariableRecord(
+ unwrapMAVOp<Metadata>(CI, 0), unwrapMAVOp<DILocalVariable>(CI, 1),
+ unwrapMAVOp<DIExpression>(CI, 2), CI->getDebugLoc(),
+ DbgVariableRecord::LocationType::Declare);
} else if (Name == "addr") {
// Upgrade dbg.addr to dbg.value with DW_OP_deref.
DIExpression *Expr = unwrapMAVOp<DIExpression>(CI, 2);
Expr = DIExpression::append(Expr, dwarf::DW_OP_deref);
- DR = new DPValue(unwrapMAVOp<Metadata>(CI, 0),
- unwrapMAVOp<DILocalVariable>(CI, 1), Expr,
- CI->getDebugLoc());
+ DR = new DbgVariableRecord(unwrapMAVOp<Metadata>(CI, 0),
+ unwrapMAVOp<DILocalVariable>(CI, 1), Expr,
+ CI->getDebugLoc());
} else if (Name == "value") {
// An old version of dbg.value had an extra offset argument.
unsigned VarOp = 1;
@@ -2389,9 +2389,9 @@ static void upgradeDbgIntrinsicToDbgRecord(StringRef Name, CallBase *CI) {
VarOp = 2;
ExprOp = 3;
}
- DR = new DPValue(unwrapMAVOp<Metadata>(CI, 0),
- unwrapMAVOp<DILocalVariable>(CI, VarOp),
- unwrapMAVOp<DIExpression>(CI, ExprOp), CI->getDebugLoc());
+ DR = new DbgVariableRecord(
+ unwrapMAVOp<Metadata>(CI, 0), unwrapMAVOp<DILocalVariable>(CI, VarOp),
+ unwrapMAVOp<DIExpression>(CI, ExprOp), CI->getDebugLoc());
}
assert(DR && "Unhandled intrinsic kind in upgrade to DbgRecord");
CI->getParent()->insertDbgRecordBefore(DR, CI->getIterator());