-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[RemoveDIs][NFC] Rename DPValue -> DbgVariableRecord #85216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-clang @llvm/pr-subscribers-coroutines Author: Stephen Tozer (SLTozer) ChangesThis 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:
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 described sed-style as: s/DPValue/DbgVariableRecord/ 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 existing DPValue class. The idea behind this patch is therefore that pure string substitution is correct in all cases as long as these assumptions hold. Patch is 366.00 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/85216.diff 77 Files Affected:
diff --git a/llvm/docs/RemoveDIsDebugInfo.md b/llvm/docs/RemoveDIsDebugInfo.md
index df66c26308a3c6..5ce3a1e4bfbf32 100644
--- a/llvm/docs/RemoveDIsDebugInfo.md
+++ b/llvm/docs/RemoveDIsDebugInfo.md
@@ -43,10 +43,10 @@ This will all happen transparently without needing to think about it!
We're using a dedicated C++ class called `DbgRecord` to store debug info, with a one-to-one relationship between each instance of a debug intrinsic and each `DbgRecord` object in any LLVM IR program; these `DbgRecord`s are represented in the IR as non-instruction debug records, as described in the [Source Level Debugging](project:SourceLevelDebugging.rst#Debug Records) document. This class has a set of subclasses that store exactly the same information as is stored in debugging intrinsics. Each one also has almost entirely the same set of methods, that behave in the same way:
https://llvm.org/docs/doxygen/classllvm_1_1DbgRecord.html
- https://llvm.org/docs/doxygen/classllvm_1_1DPValue.html
+ https://llvm.org/docs/doxygen/classllvm_1_1DbgVariableRecord.html
https://llvm.org/docs/doxygen/classllvm_1_1DPLabel.html
-This allows you to treat a `DPValue` as if it's a `dbg.value`/`dbg.declare`/`dbg.assign` intrinsic most of the time, for example in generic (auto-param) lambdas, and the same for `DPLabel` and `dbg.label`s.
+This allows you to treat a `DbgVariableRecord` as if it's a `dbg.value`/`dbg.declare`/`dbg.assign` intrinsic most of the time, for example in generic (auto-param) lambdas, and the same for `DPLabel` and `dbg.label`s.
## How do these `DbgRecords` fit into the instruction stream?
@@ -74,13 +74,13 @@ Like so:
Each instruction has a pointer to a `DPMarker` (which will become optional), that contains a list of `DbgRecord` objects. No debugging records appear in the instruction list at all. `DbgRecord`s have a parent pointer to their owning `DPMarker`, and each `DPMarker` has a pointer back to it's owning instruction.
-Not shown are the links from DbgRecord to other parts of the `Value`/`Metadata` hierachy: `DbgRecord` subclasses have tracking pointers to the DIMetadata that they use, and `DPValue` has references to `Value`s that are stored in a `DebugValueUser` base class. This refers to a `ValueAsMetadata` object referring to `Value`s, via the `TrackingMetadata` facility.
+Not shown are the links from DbgRecord to other parts of the `Value`/`Metadata` hierachy: `DbgRecord` subclasses have tracking pointers to the DIMetadata that they use, and `DbgVariableRecord` has references to `Value`s that are stored in a `DebugValueUser` base class. This refers to a `ValueAsMetadata` object referring to `Value`s, via the `TrackingMetadata` facility.
-The various kinds of debug intrinsic (value, declare, assign, label) are all stored in `DbgRecord` subclasses, with a "RecordKind" field distinguishing `DPLabel`s from `DPValue`s, and a `LocationType` field in the `DPValue` class further disambiguating the various debug variable intrinsics it can represent.
+The various kinds of debug intrinsic (value, declare, assign, label) are all stored in `DbgRecord` subclasses, with a "RecordKind" field distinguishing `DPLabel`s from `DbgVariableRecord`s, and a `LocationType` field in the `DbgVariableRecord` class further disambiguating the various debug variable intrinsics it can represent.
## Finding debug info records
-Utilities such as `findDbgUsers` and the like now have an optional argument that will return the set of `DPValue` records that refer to a `Value`. You should be able to treat them the same as intrinsics.
+Utilities such as `findDbgUsers` and the like now have an optional argument that will return the set of `DbgVariableRecord` records that refer to a `Value`. You should be able to treat them the same as intrinsics.
## Examining debug info records at positions
diff --git a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
index 31af3014afe4e7..45a47d7333e35a 100644
--- a/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -191,7 +191,7 @@ class FunctionLoweringInfo {
/// Collection of dbg.declare instructions handled after argument
/// lowering and before ISel proper.
SmallPtrSet<const DbgDeclareInst *, 8> PreprocessedDbgDeclares;
- SmallPtrSet<const DPValue *, 8> PreprocessedDPVDeclares;
+ SmallPtrSet<const DbgVariableRecord *, 8> PreprocessedDVRDeclares;
/// set - Initialize this FunctionLoweringInfo with the given Function
/// and its associated MachineFunction.
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 71c1a8394896b7..1b5843262cdbdd 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -38,7 +38,7 @@ class LLVMContext;
class Module;
class PHINode;
class ValueSymbolTable;
-class DPValue;
+class DbgVariableRecord;
class DPMarker;
/// LLVM Basic Block Representation
@@ -121,10 +121,10 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
DPMarker *getNextMarker(Instruction *I);
/// Insert a DbgRecord into a block at the position given by \p I.
- void insertDbgRecordAfter(DbgRecord *DPV, Instruction *I);
+ void insertDbgRecordAfter(DbgRecord *DVR, Instruction *I);
/// Insert a DbgRecord into a block at the position given by \p Here.
- void insertDbgRecordBefore(DbgRecord *DPV, InstListType::iterator Here);
+ void insertDbgRecordBefore(DbgRecord *DVR, InstListType::iterator Here);
/// Eject any debug-info trailing at the end of a block. DbgRecords can
/// transiently be located "off the end" of a block if the blocks terminator
diff --git a/llvm/include/llvm/IR/DIBuilder.h b/llvm/include/llvm/IR/DIBuilder.h
index 94af17af8160e9..4f0874fea483c9 100644
--- a/llvm/include/llvm/IR/DIBuilder.h
+++ b/llvm/include/llvm/IR/DIBuilder.h
@@ -101,9 +101,10 @@ namespace llvm {
DbgInstPtr insertLabel(DILabel *LabelInfo, const DILocation *DL,
BasicBlock *InsertBB, Instruction *InsertBefore);
- /// Internal helper. Track metadata if untracked and insert \p DPV.
- void insertDPValue(DPValue *DPV, BasicBlock *InsertBB,
- Instruction *InsertBefore, bool InsertAtHead = false);
+ /// Internal helper. Track metadata if untracked and insert \p DVR.
+ void insertDbgVariableRecord(DbgVariableRecord *DVR, BasicBlock *InsertBB,
+ Instruction *InsertBefore,
+ bool InsertAtHead = false);
/// Internal helper with common code used by insertDbg{Value,Addr}Intrinsic.
Instruction *insertDbgIntrinsic(llvm::Function *Intrinsic, llvm::Value *Val,
diff --git a/llvm/include/llvm/IR/DebugInfo.h b/llvm/include/llvm/IR/DebugInfo.h
index 6673908d3ed355..53cede5409e260 100644
--- a/llvm/include/llvm/IR/DebugInfo.h
+++ b/llvm/include/llvm/IR/DebugInfo.h
@@ -34,23 +34,25 @@ namespace llvm {
class DbgDeclareInst;
class DbgValueInst;
class DbgVariableIntrinsic;
-class DPValue;
+class DbgVariableRecord;
class Instruction;
class Module;
/// Finds dbg.declare intrinsics declaring local variables as living in the
/// memory that 'V' points to.
TinyPtrVector<DbgDeclareInst *> findDbgDeclares(Value *V);
-/// As above, for DPVDeclares.
-TinyPtrVector<DPValue *> findDPVDeclares(Value *V);
+/// As above, for DVRDeclares.
+TinyPtrVector<DbgVariableRecord *> findDVRDeclares(Value *V);
/// Finds the llvm.dbg.value intrinsics describing a value.
-void findDbgValues(SmallVectorImpl<DbgValueInst *> &DbgValues,
- Value *V, SmallVectorImpl<DPValue *> *DPValues = nullptr);
+void findDbgValues(
+ SmallVectorImpl<DbgValueInst *> &DbgValues, Value *V,
+ SmallVectorImpl<DbgVariableRecord *> *DbgVariableRecords = nullptr);
/// Finds the debug info intrinsics describing a value.
-void findDbgUsers(SmallVectorImpl<DbgVariableIntrinsic *> &DbgInsts,
- Value *V, SmallVectorImpl<DPValue *> *DPValues = nullptr);
+void findDbgUsers(
+ SmallVectorImpl<DbgVariableIntrinsic *> &DbgInsts, Value *V,
+ SmallVectorImpl<DbgVariableRecord *> *DbgVariableRecords = nullptr);
/// Find subprogram that is enclosing this scope.
DISubprogram *getDISubprogram(const MDNode *Scope);
@@ -58,7 +60,7 @@ DISubprogram *getDISubprogram(const MDNode *Scope);
/// Produce a DebugLoc to use for each dbg.declare that is promoted to a
/// dbg.value.
DebugLoc getDebugValueLoc(DbgVariableIntrinsic *DII);
-DebugLoc getDebugValueLoc(DPValue *DPV);
+DebugLoc getDebugValueLoc(DbgVariableRecord *DVR);
/// Strip debug info in the module if it exists.
///
@@ -109,7 +111,8 @@ class DebugInfoFinder {
void processVariable(const Module &M, const DILocalVariable *DVI);
/// Process debug info location.
void processLocation(const Module &M, const DILocation *Loc);
- /// Process a DbgRecord (e.g, treat a DPValue like a DbgVariableIntrinsic).
+ /// Process a DbgRecord (e.g, treat a DbgVariableRecord like a
+ /// DbgVariableIntrinsic).
void processDbgRecord(const Module &M, const DbgRecord &DR);
/// Process subprogram.
@@ -193,10 +196,10 @@ inline AssignmentInstRange getAssignmentInsts(const DbgAssignIntrinsic *DAI) {
return getAssignmentInsts(DAI->getAssignID());
}
-inline AssignmentInstRange getAssignmentInsts(const DPValue *DPV) {
- assert(DPV->isDbgAssign() &&
- "Can't get assignment instructions for non-assign DPV!");
- return getAssignmentInsts(DPV->getAssignID());
+inline AssignmentInstRange getAssignmentInsts(const DbgVariableRecord *DVR) {
+ assert(DVR->isDbgAssign() &&
+ "Can't get assignment instructions for non-assign DVR!");
+ return getAssignmentInsts(DVR->getAssignID());
}
//
@@ -231,9 +234,10 @@ inline AssignmentMarkerRange getAssignmentMarkers(const Instruction *Inst) {
return make_range(Value::user_iterator(), Value::user_iterator());
}
-inline SmallVector<DPValue *> getDPVAssignmentMarkers(const Instruction *Inst) {
+inline SmallVector<DbgVariableRecord *>
+getDVRAssignmentMarkers(const Instruction *Inst) {
if (auto *ID = Inst->getMetadata(LLVMContext::MD_DIAssignID))
- return cast<DIAssignID>(ID)->getAllDPValueUsers();
+ return cast<DIAssignID>(ID)->getAllDbgVariableRecordUsers();
return {};
}
@@ -261,7 +265,7 @@ bool calculateFragmentIntersect(
std::optional<DIExpression::FragmentInfo> &Result);
bool calculateFragmentIntersect(
const DataLayout &DL, const Value *Dest, uint64_t SliceOffsetInBits,
- uint64_t SliceSizeInBits, const DPValue *DPVAssign,
+ uint64_t SliceSizeInBits, const DbgVariableRecord *DVRAssign,
std::optional<DIExpression::FragmentInfo> &Result);
/// Helper struct for trackAssignments, below. We don't use the similar
@@ -276,8 +280,8 @@ struct VarRecord {
VarRecord(DbgVariableIntrinsic *DVI)
: Var(DVI->getVariable()), DL(getDebugValueLoc(DVI)) {}
- VarRecord(DPValue *DPV)
- : Var(DPV->getVariable()), DL(getDebugValueLoc(DPV)) {}
+ VarRecord(DbgVariableRecord *DVR)
+ : Var(DVR->getVariable()), DL(getDebugValueLoc(DVR)) {}
VarRecord(DILocalVariable *Var, DILocation *DL) : Var(Var), DL(DL) {}
friend bool operator<(const VarRecord &LHS, const VarRecord &RHS) {
return std::tie(LHS.Var, LHS.DL) < std::tie(RHS.Var, RHS.DL);
diff --git a/llvm/include/llvm/IR/DebugInfoMetadata.h b/llvm/include/llvm/IR/DebugInfoMetadata.h
index 156f6eb49253de..11fa8c5b20235f 100644
--- a/llvm/include/llvm/IR/DebugInfoMetadata.h
+++ b/llvm/include/llvm/IR/DebugInfoMetadata.h
@@ -65,7 +65,7 @@ enum Tag : uint16_t;
}
class DbgVariableIntrinsic;
-class DPValue;
+class DbgVariableRecord;
extern cl::opt<bool> EnableFSDiscriminator;
@@ -323,8 +323,8 @@ class DIAssignID : public MDNode {
// This node has no operands to replace.
void replaceOperandWith(unsigned I, Metadata *New) = delete;
- SmallVector<DPValue *> getAllDPValueUsers() {
- return Context.getReplaceableUses()->getAllDPValueUsers();
+ SmallVector<DbgVariableRecord *> getAllDbgVariableRecordUsers() {
+ return Context.getReplaceableUses()->getAllDbgVariableRecordUsers();
}
static DIAssignID *getDistinct(LLVMContext &Context) {
@@ -3788,8 +3788,8 @@ class DIArgList : public Metadata, ReplaceableMetadataImpl {
return MD->getMetadataID() == DIArgListKind;
}
- SmallVector<DPValue *> getAllDPValueUsers() {
- return ReplaceableMetadataImpl::getAllDPValueUsers();
+ SmallVector<DbgVariableRecord *> getAllDbgVariableRecordUsers() {
+ return ReplaceableMetadataImpl::getAllDbgVariableRecordUsers();
}
void handleChangedOperand(void *Ref, Metadata *New);
@@ -3819,7 +3819,7 @@ class DebugVariable {
public:
DebugVariable(const DbgVariableIntrinsic *DII);
- DebugVariable(const DPValue *DPV);
+ DebugVariable(const DbgVariableRecord *DVR);
DebugVariable(const DILocalVariable *Var,
std::optional<FragmentInfo> FragmentInfo,
diff --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h
index 971c22fa9aa22a..1067729ed1226c 100644
--- a/llvm/include/llvm/IR/DebugProgramInstruction.h
+++ b/llvm/include/llvm/IR/DebugProgramInstruction.h
@@ -27,12 +27,13 @@
// %bar = void call @ext(%foo)
// ; bar->DbgMarker = {
// ; StoredDbgRecords = {
-// ; DPValue(metadata i32 %foo, ...)
+// ; DbgVariableRecord(metadata i32 %foo, ...)
// ; }
// ; }
// ;; There is a debug-info record in front of the %bar instruction,
// ;; thus it points at a DPMarker object. That DPMarker contains a
-// ;; DPValue in it's ilist, storing the equivalent information to the
+// ;; DbgVariableRecord in it's ilist, storing the equivalent information
+// to the
// ;; dbg.value above: the Value, DILocalVariable, etc.
//
// This structure separates the two concerns of the position of the debug-info
@@ -66,7 +67,7 @@ class DbgInfoIntrinsic;
class DbgLabelInst;
class DIAssignID;
class DPMarker;
-class DPValue;
+class DbgVariableRecord;
class raw_ostream;
/// A typed tracking MDNode reference that does not require a definition for its
@@ -219,7 +220,8 @@ inline raw_ostream &operator<<(raw_ostream &OS, const DbgRecord &R) {
/// Records a position in IR for a source label (DILabel). Corresponds to the
/// llvm.dbg.label intrinsic.
-/// FIXME: Rename DbgLabelRecord when DPValue is renamed to DbgVariableRecord.
+/// FIXME: Rename DbgLabelRecord when DbgVariableRecord is renamed to
+/// DbgVariableRecord.
class DPLabel : public DbgRecord {
DbgRecordParamRef<DILabel> Label;
@@ -257,7 +259,7 @@ class DPLabel : public DbgRecord {
///
/// This class inherits from DebugValueUser to allow LLVM's metadata facilities
/// to update our references to metadata beneath our feet.
-class DPValue : public DbgRecord, protected DebugValueUser {
+class DbgVariableRecord : public DbgRecord, protected DebugValueUser {
friend class DebugValueUser;
public:
@@ -269,9 +271,10 @@ class DPValue : public DbgRecord, protected DebugValueUser {
End, ///< Marks the end of the concrete types.
Any, ///< To indicate all LocationTypes in searches.
};
- /// Classification of the debug-info record that this DPValue represents.
- /// Essentially, "is this a dbg.value or dbg.declare?". dbg.declares are not
- /// currently supported, but it would be trivial to do so.
+ /// Classification of the debug-info record that this DbgVariableRecord
+ /// represents. Essentially, "is this a dbg.value or dbg.declare?".
+ /// dbg.declares are not currently supported, but it would be trivial to do
+ /// so.
/// FIXME: We could use spare padding bits from DbgRecord for this.
LocationType Type;
@@ -284,63 +287,69 @@ class DPValue : public DbgRecord, protected DebugValueUser {
DbgRecordParamRef<DIExpression> AddressExpression;
public:
- /// Create a new DPValue representing the intrinsic \p DVI, for example the
- /// assignment represented by a dbg.value.
- DPValue(const DbgVariableIntrinsic *DVI);
- DPValue(const DPValue &DPV);
- /// Directly construct a new DPValue representing a dbg.value intrinsic
- /// assigning \p Location to the DV / Expr / DI variable.
- DPValue(Metadata *Location, DILocalVariable *DV, DIExpression *Expr,
- const DILocation *DI, LocationType Type = LocationType::Value);
- DPValue(Metadata *Value, DILocalVariable *Variable, DIExpression *Expression,
- DIAssignID *AssignID, Metadata *Address,
- DIExpression *AddressExpression, const DILocation *DI);
+ /// Create a new DbgVariableRecord representing the intrinsic \p DVI, for
+ /// example the assignment represented by a dbg.value.
+ DbgVariableRecord(const DbgVariableIntrinsic *DVI);
+ DbgVariableRecord(const DbgVariableRecord &DVR);
+ /// Directly construct a new DbgVariableRecord representing a dbg.value
+ /// intrinsic assigning \p Location to the DV / Expr / DI variable.
+ DbgVariableRecord(Metadata *Location, DILocalVariable *DV, DIExpression *Expr,
+ const DILocation *DI,
+ LocationType Type = LocationType::Value);
+ DbgVariableRecord(Metadata *Value, DILocalVariable *Variable,
+ DIExpression *Expression, DIAssignID *AssignID,
+ Metadata *Address, DIExpression *AddressExpression,
+ const DILocation *DI);
private:
/// Private constructor for creating new instances during parsing only. Only
- /// called through `createUnresolvedDPValue` below, which makes clear that
- /// this is used for parsing only, and will later return a subclass depending
- /// on which Type is passed.
- DPValue(LocationType Type, Metadata *Val, MDNode *Variable,
- MDNode *Expression, MDNode *AssignID, Metadata *Address,
- MDNode *AddressExpression, MDNode *DI);
+ /// called through `createUnresolvedDbgVariableRecord` below, which makes
+ /// clear that this is used for parsing only, and will later return a subclass
+ /// depending on which Type is passed.
+ DbgVariableRecord(LocationType Type, Metadata *Val, MDNode *Variable,
+ MDNode *Expression, MDNode *AssignID, Metadata *Address,
+ MDNode *AddressExpression, MDNode *DI);
public:
- /// Used to create DPValues during parsing, where some metadata references may
- /// still be unresolved. Although for some fields a generic `Metadata*`
- /// argument is accepted for forward type-references, the verifier and
- /// accessors will reject incorrect types later on. The function is used for
- /// all types of DPValues for simplicity while parsing, but asserts if any
- /// necessary fields are empty or unused fields are not empty, i.e. if the
- /// #dbg_assign fields are used for a non-dbg-assign type.
- static DPValue *createUnresolvedDPValue(LocationType Type, Metadata *Val,
- MDNode *Variable, MDNode *Expression,
- MDNode *AssignID, Metadata *Address,
- MDNode *AddressExpression,
- MDNode *DI);
-
- static DPValue *createDPVAssign(Value *Val, DILocalVariable *Variable,
- DIExpression *Expression,
- DIAssignID *AssignID, Value *Address,
- DIExpression *AddressExpression,
- const DILocation *DI);
- static DPValue *createLinkedDPVAssign(Instruction *LinkedInstr, Value *Val,
- DILocalVariable *Variable,
- DIExpression *Expression,
- Value *Address,
- DIExpression *AddressExpression,
- const DILocation *DI);
-
- static DPValue *createDPValue(Value *Location, DILocalVariable *DV,
- DIExpression *Expr, const DILocation *DI);
- static DPValue *createDPValue(Value *Location, DILocalVariable *DV,
- DIExpression *Expr, const DILocation *DI,
- DPValue &InsertBefore);
- static DPValue *createDPVDeclare(Value *Address, DILocalVariable *DV,
- DIExpression *Expr, co...
[truncated]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits, but looks fine to merge once those are fixed.
llvm/include/llvm/IR/BasicBlock.h
Outdated
@@ -121,10 +121,10 @@ class BasicBlock final : public Value, // Basic blocks are data objects also | |||
DPMarker *getNextMarker(Instruction *I); | |||
|
|||
/// Insert a DbgRecord into a block at the position given by \p I. | |||
void insertDbgRecordAfter(DbgRecord *DPV, Instruction *I); | |||
void insertDbgRecordAfter(DbgRecord *DVR, Instruction *I); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This should probably be DR
not DVR
? Same below.
llvm/lib/CodeGen/CodeGenPrepare.cpp
Outdated
// Similar story with DbgVariableRecords, the non-instruction | ||
// representation of dbg.values. | ||
for (DbgVariableRecord *DVR : | ||
DbgVariableRecords) // tested by transaction-test I'm adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// tested by transaction-test I'm adding
looks like a comment someone's added accidentally. IMO better to move it above the loop or delete it, to prevent the weird formatting that happens as a result of lengthening the line with the rename. YMMV.
llvm/lib/IR/AsmWriter.cpp
Outdated
void printDPValue(const DPValue &DPI); | ||
void printDbgVariableRecord(const DbgVariableRecord &DPI); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth renaming DPI
?
@@ -276,8 +276,8 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, | |||
// attached debug-info records. | |||
for (Instruction &II : *BB) { | |||
RemapInstruction(&II, VMap, RemapFlag, TypeMapper, Materializer); | |||
RemapDPValueRange(II.getModule(), II.getDbgRecordRange(), VMap, RemapFlag, | |||
TypeMapper, Materializer); | |||
RemapDbgVariableRecordRange(II.getModule(), II.getDbgRecordRange(), VMap, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RemapDbgVariableRecordRange
maybe should be RemapDbgRecordRange
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, but the problem is that it actually is just operating on DbgVariableRecords, even if it does so by taking a DbgRecordRange, so the name feels more correct this way.
7355223
to
44a9dde
Compare
Rebased onto current main following recent pushes, and addressed review comments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I haven't looked at the recent changes as closely as I did for the original patch, as they've been folded into the rebase (and the patch is 80 files), but I've given it a quick scan and it still SGTM.
44a9dde
to
399fc66
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
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 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 described sed-style as: s/DPValue/DbgVariableRecord/ s/DPVal/DbgVarRec/ s/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 DbgRecords.
0eac23f
to
e7b5f42
Compare
Looks like one of the buildbots is failing after this landed: https://lab.llvm.org/buildbot/#/builders/193/builds/48663 I'm going to wait and see if it continues, because this patch should be NFC, and I can't see an obvious way it'd lead to errors on that build for those tests specifically. |
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.
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
andDPV
are almost exclusively used for DbgRecords, except for:DPValue
here that refers to debug info, which I've manually updated.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:
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.