LLVM/project bdc77d1llvm/docs RemoveDIsDebugInfo.md, llvm/include/llvm/IR DebugProgramInstruction.h

[RemoveDIs][NFC] Rename DPLabel->DbgLabelRecord (#85918)

This patch renames DPLabel to DbgLabelRecord, in accordance with the
ongoing DbgRecord rename. This rename was fairly trivial, since DPLabel
isn't as widely used as DPValue and has no real conflicts in either its
full or abbreviated name. As usual, the entire replacement was done
automatically, with `s/DPLabel/DbgLabelRecord/` and `s/DPL/DLR/`.
DeltaFile
+17-14llvm/lib/IR/DebugProgramInstruction.cpp
+12-12llvm/lib/IR/Verifier.cpp
+12-10llvm/include/llvm/IR/DebugProgramInstruction.h
+10-10llvm/lib/IR/AsmWriter.cpp
+8-7llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+5-5llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+5-5llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+4-4llvm/lib/IR/DIBuilder.cpp
+3-3llvm/docs/RemoveDIsDebugInfo.md
+3-3llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+3-3llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+3-2llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+2-2llvm/unittests/IR/IRBuilderTest.cpp
+2-2llvm/lib/Transforms/Utils/CodeExtractor.cpp
+2-2llvm/lib/Transforms/Utils/ValueMapper.cpp
+2-1llvm/lib/IR/BasicBlock.cpp
+1-1llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
+1-1llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+1-1llvm/lib/AsmParser/LLParser.cpp
+1-1llvm/lib/IR/AutoUpgrade.cpp
+97-8920 files

UnifiedSplitRaw

llvm/docs/RemoveDIsDebugInfo.md
@@ -65,9 +65,9 @@ We're using a dedicated C++ class called `DbgRecord` to store debug info, with a
https://llvm.org/docs/doxygen/classllvm_1_1DbgRecord.html https://llvm.org/docs/doxygen/classllvm_1_1DbgRecord.html
https://llvm.org/docs/doxygen/classllvm_1_1DbgVariableRecord.html https://llvm.org/docs/doxygen/classllvm_1_1DbgVariableRecord.html
- https://llvm.org/docs/doxygen/classllvm_1_1DPLabel.html+ https://llvm.org/docs/doxygen/classllvm_1_1DbgLabelRecord.html
-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.+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 `DbgLabelRecord` and `dbg.label`s.
## How do these `DbgRecords` fit into the instruction stream? ## How do these `DbgRecords` fit into the instruction stream?
@@ -97,7 +97,7 @@ Each instruction has a pointer to a `DPMarker` (which will become optional), tha
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. 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 `DbgVariableRecord`s, and a `LocationType` field in the `DbgVariableRecord` 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 `DbgLabelRecord`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 ## Finding debug info records
llvm/include/llvm/IR/DebugProgramInstruction.h
@@ -222,23 +222,25 @@ inline raw_ostream &operator<<(raw_ostream &OS, const DbgRecord &R) {
/// llvm.dbg.label intrinsic. /// llvm.dbg.label intrinsic.
/// FIXME: Rename DbgLabelRecord when DbgVariableRecord is renamed to /// FIXME: Rename DbgLabelRecord when DbgVariableRecord is renamed to
/// DbgVariableRecord. /// DbgVariableRecord.
-class DPLabel : public DbgRecord {+class DbgLabelRecord : public DbgRecord {
DbgRecordParamRef<DILabel> Label; DbgRecordParamRef<DILabel> Label;
/// This constructor intentionally left private, so that it is only called via /// This constructor intentionally left private, so that it is only called via
- /// "createUnresolvedDPLabel", which clearly expresses that it is for parsing+ /// "createUnresolvedDbgLabelRecord", which clearly expresses that it is for
- /// only.+ /// parsing only.
- DPLabel(MDNode *Label, MDNode *DL);+ DbgLabelRecord(MDNode *Label, MDNode *DL);
public: public:
- DPLabel(DILabel *Label, DebugLoc DL);+ DbgLabelRecord(DILabel *Label, DebugLoc DL);
- /// For use during parsing; creates a DPLabel from as-of-yet unresolved+ /// For use during parsing; creates a DbgLabelRecord from as-of-yet unresolved
- /// MDNodes. Trying to access the resulting DPLabel's fields before they are+ /// MDNodes. Trying to access the resulting DbgLabelRecord's fields before
- /// resolved, or if they resolve to the wrong type, will result in a crash.+ /// they are resolved, or if they resolve to the wrong type, will result in a
- static DPLabel *createUnresolvedDPLabel(MDNode *Label, MDNode *DL);+ /// crash.
+ static DbgLabelRecord *createUnresolvedDbgLabelRecord(MDNode *Label,
+ MDNode *DL);
- DPLabel *clone() const;+ DbgLabelRecord *clone() const;
void print(raw_ostream &O, bool IsForDebug = false) const; void print(raw_ostream &O, bool IsForDebug = false) const;
void print(raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const; void print(raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const;
DbgLabelInst *createDebugIntrinsic(Module *M, DbgLabelInst *createDebugIntrinsic(Module *M,
llvm/lib/AsmParser/LLParser.cpp
@@ -6607,7 +6607,7 @@ bool LLParser::parseDebugRecord(DbgRecord *&DR, PerFunctionState &PFS) {
return true; return true;
if (parseToken(lltok::rparen, "Expected ')' here")) if (parseToken(lltok::rparen, "Expected ')' here"))
return true; return true;
- DR = DPLabel::createUnresolvedDPLabel(Label, DbgLoc);+ DR = DbgLabelRecord::createUnresolvedDbgLabelRecord(Label, DbgLoc);
return false; return false;
} }
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -6426,14 +6426,15 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
break; break;
} }
case bitc::FUNC_CODE_DEBUG_RECORD_LABEL: { case bitc::FUNC_CODE_DEBUG_RECORD_LABEL: {
- // DPLabels are placed after the Instructions that they are attached to.+ // DbgLabelRecords are placed after the Instructions that they are
+ // attached to.
Instruction *Inst = getLastInstruction(); Instruction *Inst = getLastInstruction();
if (!Inst) if (!Inst)
return error("Invalid dbg record: missing instruction"); return error("Invalid dbg record: missing instruction");
DILocation *DIL = cast<DILocation>(getFnMetadataByID(Record[0])); DILocation *DIL = cast<DILocation>(getFnMetadataByID(Record[0]));
DILabel *Label = cast<DILabel>(getFnMetadataByID(Record[1])); DILabel *Label = cast<DILabel>(getFnMetadataByID(Record[1]));
Inst->getParent()->insertDbgRecordBefore( Inst->getParent()->insertDbgRecordBefore(
- new DPLabel(Label, DebugLoc(DIL)), Inst->getIterator());+ new DbgLabelRecord(Label, DebugLoc(DIL)), Inst->getIterator());
continue; // This isn't an instruction. continue; // This isn't an instruction.
} }
case bitc::FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE: case bitc::FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE:
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -3570,9 +3570,9 @@ void ModuleBitcodeWriter::writeFunction(
// instruction. Write it after the instruction so that it's easy to // instruction. Write it after the instruction so that it's easy to
// re-attach to the instruction reading the records in. // re-attach to the instruction reading the records in.
for (DbgRecord &DR : I.DbgMarker->getDbgRecordRange()) { for (DbgRecord &DR : I.DbgMarker->getDbgRecordRange()) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- Vals.push_back(VE.getMetadataID(&*DPL->getDebugLoc()));+ Vals.push_back(VE.getMetadataID(&*DLR->getDebugLoc()));
- Vals.push_back(VE.getMetadataID(DPL->getLabel()));+ Vals.push_back(VE.getMetadataID(DLR->getLabel()));
Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_LABEL, Vals); Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_RECORD_LABEL, Vals);
Vals.clear(); Vals.clear();
continue; continue;
llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -441,9 +441,9 @@ ValueEnumerator::ValueEnumerator(const Module &M,
}; };
for (DbgRecord &DR : I.getDbgRecordRange()) { for (DbgRecord &DR : I.getDbgRecordRange()) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- EnumerateMetadata(&F, DPL->getLabel());+ EnumerateMetadata(&F, DLR->getLabel());
- EnumerateMetadata(&F, &*DPL->getDebugLoc());+ EnumerateMetadata(&F, &*DLR->getDebugLoc());
continue; continue;
} }
// Enumerate non-local location metadata. // Enumerate non-local location metadata.
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -3376,13 +3376,13 @@ void IRTranslator::translateDbgDeclareRecord(Value *Address, bool HasArgList,
void IRTranslator::translateDbgInfo(const Instruction &Inst, void IRTranslator::translateDbgInfo(const Instruction &Inst,
MachineIRBuilder &MIRBuilder) { MachineIRBuilder &MIRBuilder) {
for (DbgRecord &DR : Inst.getDbgRecordRange()) { for (DbgRecord &DR : Inst.getDbgRecordRange()) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- MIRBuilder.setDebugLoc(DPL->getDebugLoc());+ MIRBuilder.setDebugLoc(DLR->getDebugLoc());
- assert(DPL->getLabel() && "Missing label");+ assert(DLR->getLabel() && "Missing label");
- assert(DPL->getLabel()->isValidLocationForIntrinsic(+ assert(DLR->getLabel()->isValidLocationForIntrinsic(
MIRBuilder.getDebugLoc()) && MIRBuilder.getDebugLoc()) &&
"Expected inlined-at fields to agree"); "Expected inlined-at fields to agree");
- MIRBuilder.buildDbgLabel(DPL->getLabel());+ MIRBuilder.buildDbgLabel(DLR->getLabel());
continue; continue;
} }
DbgVariableRecord &DVR = cast<DbgVariableRecord>(DR); DbgVariableRecord &DVR = cast<DbgVariableRecord>(DR);
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -1192,16 +1192,16 @@ void FastISel::handleDbgInfo(const Instruction *II) {
flushLocalValueMap(); flushLocalValueMap();
recomputeInsertPt(); recomputeInsertPt();
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- assert(DPL->getLabel() && "Missing label");+ assert(DLR->getLabel() && "Missing label");
if (!FuncInfo.MF->getMMI().hasDebugInfo()) { if (!FuncInfo.MF->getMMI().hasDebugInfo()) {
- LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DPL << "\n");+ LLVM_DEBUG(dbgs() << "Dropping debug info for " << *DLR << "\n");
continue; continue;
} }
- BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DPL->getDebugLoc(),+ BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DLR->getDebugLoc(),
TII.get(TargetOpcode::DBG_LABEL)) TII.get(TargetOpcode::DBG_LABEL))
- .addMetadata(DPL->getLabel());+ .addMetadata(DLR->getLabel());
continue; continue;
} }
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -1248,18 +1248,19 @@ void SelectionDAGBuilder::visitDbgInfo(const Instruction &I) {
// We must skip DbgVariableRecords if they've already been processed above as // We must skip DbgVariableRecords if they've already been processed above as
// we have just emitted the debug values resulting from assignment tracking // we have just emitted the debug values resulting from assignment tracking
// analysis, making any existing DbgVariableRecords redundant (and probably // analysis, making any existing DbgVariableRecords redundant (and probably
- // less correct). We still need to process DPLabels. This does sink DPLabels+ // less correct). We still need to process DbgLabelRecords. This does sink
- // to the bottom of the group of debug records. That sholdn't be important+ // DbgLabelRecords to the bottom of the group of debug records. That sholdn't
- // as it does so deterministcally and ordering between DPLabels and+ // be important as it does so deterministcally and ordering between
- // DbgVariableRecords is immaterial (other than for MIR/IR printing).+ // DbgLabelRecords and DbgVariableRecords is immaterial (other than for MIR/IR
+ // printing).
bool SkipDbgVariableRecords = DAG.getFunctionVarLocs(); bool SkipDbgVariableRecords = DAG.getFunctionVarLocs();
// Is there is any debug-info attached to this instruction, in the form of // Is there is any debug-info attached to this instruction, in the form of
// DbgRecord non-instruction debug-info records. // DbgRecord non-instruction debug-info records.
for (DbgRecord &DR : I.getDbgRecordRange()) { for (DbgRecord &DR : I.getDbgRecordRange()) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- assert(DPL->getLabel() && "Missing label");+ assert(DLR->getLabel() && "Missing label");
SDDbgLabel *SDV = SDDbgLabel *SDV =
- DAG.getDbgLabel(DPL->getLabel(), DPL->getDebugLoc(), SDNodeOrder);+ DAG.getDbgLabel(DLR->getLabel(), DLR->getDebugLoc(), SDNodeOrder);
DAG.AddDbgLabel(SDV); DAG.AddDbgLabel(SDV);
continue; continue;
} }
llvm/lib/IR/AsmWriter.cpp
@@ -1152,8 +1152,8 @@ void SlotTracker::processDbgRecordMetadata(const DbgRecord &DR) {
if (auto *Empty = dyn_cast<MDNode>(DVR->getRawAddress())) if (auto *Empty = dyn_cast<MDNode>(DVR->getRawAddress()))
CreateMetadataSlot(Empty); CreateMetadataSlot(Empty);
} }
- } else if (const DPLabel *DPL = dyn_cast<const DPLabel>(&DR)) {+ } else if (const DbgLabelRecord *DLR = dyn_cast<const DbgLabelRecord>(&DR)) {
- CreateMetadataSlot(DPL->getRawLabel());+ CreateMetadataSlot(DLR->getRawLabel());
} else { } else {
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
} }
@@ -2719,7 +2719,7 @@ public:
void printInstruction(const Instruction &I); void printInstruction(const Instruction &I);
void printDPMarker(const DPMarker &DPI); void printDPMarker(const DPMarker &DPI);
void printDbgVariableRecord(const DbgVariableRecord &DVR); void printDbgVariableRecord(const DbgVariableRecord &DVR);
- void printDPLabel(const DPLabel &DPL);+ void printDbgLabelRecord(const DbgLabelRecord &DLR);
void printDbgRecord(const DbgRecord &DR); void printDbgRecord(const DbgRecord &DR);
void printDbgRecordLine(const DbgRecord &DR); void printDbgRecordLine(const DbgRecord &DR);
@@ -4621,8 +4621,8 @@ void AssemblyWriter::printDPMarker(const DPMarker &Marker) {
void AssemblyWriter::printDbgRecord(const DbgRecord &DR) { void AssemblyWriter::printDbgRecord(const DbgRecord &DR) {
if (auto *DVR = dyn_cast<DbgVariableRecord>(&DR)) if (auto *DVR = dyn_cast<DbgVariableRecord>(&DR))
printDbgVariableRecord(*DVR); printDbgVariableRecord(*DVR);
- else if (auto *DPL = dyn_cast<DPLabel>(&DR))+ else if (auto *DLR = dyn_cast<DbgLabelRecord>(&DR))
- printDPLabel(*DPL);+ printDbgLabelRecord(*DLR);
else else
llvm_unreachable("Unexpected DbgRecord kind"); llvm_unreachable("Unexpected DbgRecord kind");
} }
@@ -4672,7 +4672,7 @@ void AssemblyWriter::printDbgRecordLine(const DbgRecord &DR) {
Out << '\n'; Out << '\n';
} }
-void AssemblyWriter::printDPLabel(const DPLabel &Label) {+void AssemblyWriter::printDbgLabelRecord(const DbgLabelRecord &Label) {
auto WriterCtx = getContext(); auto WriterCtx = getContext();
Out << "#dbg_label("; Out << "#dbg_label(";
WriteAsOperandInternal(Out, Label.getRawLabel(), WriterCtx, true); WriteAsOperandInternal(Out, Label.getRawLabel(), WriterCtx, true);
@@ -4934,7 +4934,7 @@ void DPMarker::print(raw_ostream &ROS, ModuleSlotTracker &MST,
W.printDPMarker(*this); W.printDPMarker(*this);
} }
-void DPLabel::print(raw_ostream &ROS, bool IsForDebug) const {+void DbgLabelRecord::print(raw_ostream &ROS, bool IsForDebug) const {
ModuleSlotTracker MST(getModuleFromDPI(this), true); ModuleSlotTracker MST(getModuleFromDPI(this), true);
print(ROS, MST, IsForDebug); print(ROS, MST, IsForDebug);
@@ -4957,8 +4957,8 @@ void DbgVariableRecord::print(raw_ostream &ROS, ModuleSlotTracker &MST,
W.printDbgVariableRecord(*this); W.printDbgVariableRecord(*this);
} }
-void DPLabel::print(raw_ostream &ROS, ModuleSlotTracker &MST,+void DbgLabelRecord::print(raw_ostream &ROS, ModuleSlotTracker &MST,
- bool IsForDebug) const {+ bool IsForDebug) const {
formatted_raw_ostream OS(ROS); formatted_raw_ostream OS(ROS);
SlotTracker EmptySlotTable(static_cast<const Module *>(nullptr)); SlotTracker EmptySlotTable(static_cast<const Module *>(nullptr));
SlotTracker &SlotTable = SlotTracker &SlotTable =
@@ -4970,7 +4970,7 @@ void DPLabel::print(raw_ostream &ROS, ModuleSlotTracker &MST,
incorporateFunction(Marker->getParent() ? Marker->getParent()->getParent() incorporateFunction(Marker->getParent() ? Marker->getParent()->getParent()
: nullptr); : nullptr);
AssemblyWriter W(OS, SlotTable, getModuleFromDPI(this), nullptr, IsForDebug); AssemblyWriter W(OS, SlotTable, getModuleFromDPI(this), nullptr, IsForDebug);
- W.printDPLabel(*this);+ W.printDbgLabelRecord(*this);
} }
void Value::print(raw_ostream &ROS, bool IsForDebug) const { void Value::print(raw_ostream &ROS, bool IsForDebug) const {
llvm/lib/IR/AutoUpgrade.cpp
@@ -2358,7 +2358,7 @@ static MDType *unwrapMAVOp(CallBase *CI, unsigned Op) {
static void upgradeDbgIntrinsicToDbgRecord(StringRef Name, CallBase *CI) { static void upgradeDbgIntrinsicToDbgRecord(StringRef Name, CallBase *CI) {
DbgRecord *DR = nullptr; DbgRecord *DR = nullptr;
if (Name == "label") { if (Name == "label") {
- DR = new DPLabel(unwrapMAVOp<DILabel>(CI, 0), CI->getDebugLoc());+ DR = new DbgLabelRecord(unwrapMAVOp<DILabel>(CI, 0), CI->getDebugLoc());
} else if (Name == "assign") { } else if (Name == "assign") {
DR = new DbgVariableRecord( DR = new DbgVariableRecord(
unwrapMAVOp<Metadata>(CI, 0), unwrapMAVOp<DILocalVariable>(CI, 1), unwrapMAVOp<Metadata>(CI, 0), unwrapMAVOp<DILocalVariable>(CI, 1),
llvm/lib/IR/BasicBlock.cpp
@@ -83,7 +83,8 @@ void BasicBlock::convertToNewDbgValues() {
} }
if (DbgLabelInst *DLI = dyn_cast<DbgLabelInst>(&I)) { if (DbgLabelInst *DLI = dyn_cast<DbgLabelInst>(&I)) {
- DbgVarRecs.push_back(new DPLabel(DLI->getLabel(), DLI->getDebugLoc()));+ DbgVarRecs.push_back(
+ new DbgLabelRecord(DLI->getLabel(), DLI->getDebugLoc()));
DLI->eraseFromParent(); DLI->eraseFromParent();
continue; continue;
} }
llvm/lib/IR/DIBuilder.cpp
@@ -1155,12 +1155,12 @@ DbgInstPtr DIBuilder::insertLabel(DILabel *LabelInfo, const DILocation *DL,
trackIfUnresolved(LabelInfo); trackIfUnresolved(LabelInfo);
if (M.IsNewDbgInfoFormat) { if (M.IsNewDbgInfoFormat) {
- DPLabel *DPL = new DPLabel(LabelInfo, DL);+ DbgLabelRecord *DLR = new DbgLabelRecord(LabelInfo, DL);
if (InsertBB && InsertBefore) if (InsertBB && InsertBefore)
- InsertBB->insertDbgRecordBefore(DPL, InsertBefore->getIterator());+ InsertBB->insertDbgRecordBefore(DLR, InsertBefore->getIterator());
else if (InsertBB) else if (InsertBB)
- InsertBB->insertDbgRecordBefore(DPL, InsertBB->end());+ InsertBB->insertDbgRecordBefore(DLR, InsertBB->end());
- return DPL;+ return DLR;
} }
if (!LabelFn) if (!LabelFn)
llvm/lib/IR/DebugProgramInstruction.cpp
@@ -82,7 +82,7 @@ void DbgRecord::deleteRecord() {
delete cast<DbgVariableRecord>(this); delete cast<DbgVariableRecord>(this);
return; return;
case LabelKind: case LabelKind:
- delete cast<DPLabel>(this);+ delete cast<DbgLabelRecord>(this);
return; return;
} }
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
@@ -94,7 +94,7 @@ void DbgRecord::print(raw_ostream &O, bool IsForDebug) const {
cast<DbgVariableRecord>(this)->print(O, IsForDebug); cast<DbgVariableRecord>(this)->print(O, IsForDebug);
return; return;
case LabelKind: case LabelKind:
- cast<DPLabel>(this)->print(O, IsForDebug);+ cast<DbgLabelRecord>(this)->print(O, IsForDebug);
return; return;
}; };
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
@@ -107,7 +107,7 @@ void DbgRecord::print(raw_ostream &O, ModuleSlotTracker &MST,
cast<DbgVariableRecord>(this)->print(O, MST, IsForDebug); cast<DbgVariableRecord>(this)->print(O, MST, IsForDebug);
return; return;
case LabelKind: case LabelKind:
- cast<DPLabel>(this)->print(O, MST, IsForDebug);+ cast<DbgLabelRecord>(this)->print(O, MST, IsForDebug);
return; return;
}; };
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
@@ -121,7 +121,8 @@ bool DbgRecord::isIdenticalToWhenDefined(const DbgRecord &R) const {
return cast<DbgVariableRecord>(this)->isIdenticalToWhenDefined( return cast<DbgVariableRecord>(this)->isIdenticalToWhenDefined(
*cast<DbgVariableRecord>(&R)); *cast<DbgVariableRecord>(&R));
case LabelKind: case LabelKind:
- return cast<DPLabel>(this)->getLabel() == cast<DPLabel>(R).getLabel();+ return cast<DbgLabelRecord>(this)->getLabel() ==
+ cast<DbgLabelRecord>(R).getLabel();
}; };
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
} }
@@ -136,24 +137,25 @@ DbgRecord::createDebugIntrinsic(Module *M, Instruction *InsertBefore) const {
case ValueKind: case ValueKind:
return cast<DbgVariableRecord>(this)->createDebugIntrinsic(M, InsertBefore); return cast<DbgVariableRecord>(this)->createDebugIntrinsic(M, InsertBefore);
case LabelKind: case LabelKind:
- return cast<DPLabel>(this)->createDebugIntrinsic(M, InsertBefore);+ return cast<DbgLabelRecord>(this)->createDebugIntrinsic(M, InsertBefore);
}; };
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
} }
-DPLabel::DPLabel(MDNode *Label, MDNode *DL)+DbgLabelRecord::DbgLabelRecord(MDNode *Label, MDNode *DL)
: DbgRecord(LabelKind, DebugLoc(DL)), Label(Label) { : DbgRecord(LabelKind, DebugLoc(DL)), Label(Label) {
assert(Label && "Unexpected nullptr"); assert(Label && "Unexpected nullptr");
assert((isa<DILabel>(Label) || Label->isTemporary()) && assert((isa<DILabel>(Label) || Label->isTemporary()) &&
"Label type must be or resolve to a DILabel"); "Label type must be or resolve to a DILabel");
} }
-DPLabel::DPLabel(DILabel *Label, DebugLoc DL)+DbgLabelRecord::DbgLabelRecord(DILabel *Label, DebugLoc DL)
: DbgRecord(LabelKind, DL), Label(Label) { : DbgRecord(LabelKind, DL), Label(Label) {
assert(Label && "Unexpected nullptr"); assert(Label && "Unexpected nullptr");
} }
-DPLabel *DPLabel::createUnresolvedDPLabel(MDNode *Label, MDNode *DL) {+DbgLabelRecord *DbgLabelRecord::createUnresolvedDbgLabelRecord(MDNode *Label,
- return new DPLabel(Label, DL);+ MDNode *DL) {
+ return new DbgLabelRecord(Label, DL);
} }
DbgVariableRecord::DbgVariableRecord(DbgVariableRecord::LocationType Type, DbgVariableRecord::DbgVariableRecord(DbgVariableRecord::LocationType Type,
@@ -380,7 +382,7 @@ DbgRecord *DbgRecord::clone() const {
case ValueKind: case ValueKind:
return cast<DbgVariableRecord>(this)->clone(); return cast<DbgVariableRecord>(this)->clone();
case LabelKind: case LabelKind:
- return cast<DPLabel>(this)->clone();+ return cast<DbgLabelRecord>(this)->clone();
}; };
llvm_unreachable("unsupported DbgRecord kind"); llvm_unreachable("unsupported DbgRecord kind");
} }
@@ -389,8 +391,8 @@ DbgVariableRecord *DbgVariableRecord::clone() const {
return new DbgVariableRecord(*this); return new DbgVariableRecord(*this);
} }
-DPLabel *DPLabel::clone() const {+DbgLabelRecord *DbgLabelRecord::clone() const {
- return new DPLabel(getLabel(), getDebugLoc());+ return new DbgLabelRecord(getLabel(), getDebugLoc());
} }
DbgVariableIntrinsic * DbgVariableIntrinsic *
@@ -450,8 +452,9 @@ DbgVariableRecord::createDebugIntrinsic(Module *M,
return DVI; return DVI;
} }
-DbgLabelInst *DPLabel::createDebugIntrinsic(Module *M,+DbgLabelInst *
- Instruction *InsertBefore) const {+DbgLabelRecord::createDebugIntrinsic(Module *M,
+ Instruction *InsertBefore) const {
auto *LabelFn = Intrinsic::getDeclaration(M, Intrinsic::dbg_label); auto *LabelFn = Intrinsic::getDeclaration(M, Intrinsic::dbg_label);
Value *Args[] = { Value *Args[] = {
MetadataAsValue::get(getDebugLoc()->getContext(), getLabel())}; MetadataAsValue::get(getDebugLoc()->getContext(), getLabel())};
llvm/lib/IR/Verifier.cpp
@@ -544,7 +544,7 @@ private:
void visitTemplateParams(const MDNode &N, const Metadata &RawParams); void visitTemplateParams(const MDNode &N, const Metadata &RawParams);
- void visit(DPLabel &DPL);+ void visit(DbgLabelRecord &DLR);
void visit(DbgVariableRecord &DVR); void visit(DbgVariableRecord &DVR);
// InstVisitor overrides... // InstVisitor overrides...
using InstVisitor<Verifier>::visit; using InstVisitor<Verifier>::visit;
@@ -696,8 +696,8 @@ void Verifier::visitDbgRecords(Instruction &I) {
// intrinsic behaviour. // intrinsic behaviour.
verifyFragmentExpression(*DVR); verifyFragmentExpression(*DVR);
verifyNotEntryValue(*DVR); verifyNotEntryValue(*DVR);
- } else if (auto *DPL = dyn_cast<DPLabel>(&DR)) {+ } else if (auto *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- visit(*DPL);+ visit(*DLR);
} }
} }
} }
@@ -6244,22 +6244,22 @@ static DISubprogram *getSubprogram(Metadata *LocalScope) {
return nullptr; return nullptr;
} }
-void Verifier::visit(DPLabel &DPL) {+void Verifier::visit(DbgLabelRecord &DLR) {
- CheckDI(isa<DILabel>(DPL.getRawLabel()),+ CheckDI(isa<DILabel>(DLR.getRawLabel()),
- "invalid #dbg_label intrinsic variable", &DPL, DPL.getRawLabel());+ "invalid #dbg_label intrinsic variable", &DLR, DLR.getRawLabel());
// Ignore broken !dbg attachments; they're checked elsewhere. // Ignore broken !dbg attachments; they're checked elsewhere.
- if (MDNode *N = DPL.getDebugLoc().getAsMDNode())+ if (MDNode *N = DLR.getDebugLoc().getAsMDNode())
if (!isa<DILocation>(N)) if (!isa<DILocation>(N))
return; return;
- BasicBlock *BB = DPL.getParent();+ BasicBlock *BB = DLR.getParent();
Function *F = BB ? BB->getParent() : nullptr; Function *F = BB ? BB->getParent() : nullptr;
// The scopes for variables and !dbg attachments must agree. // The scopes for variables and !dbg attachments must agree.
- DILabel *Label = DPL.getLabel();+ DILabel *Label = DLR.getLabel();
- DILocation *Loc = DPL.getDebugLoc();+ DILocation *Loc = DLR.getDebugLoc();
- CheckDI(Loc, "#dbg_label record requires a !dbg attachment", &DPL, BB, F);+ CheckDI(Loc, "#dbg_label record requires a !dbg attachment", &DLR, BB, F);
DISubprogram *LabelSP = getSubprogram(Label->getRawScope()); DISubprogram *LabelSP = getSubprogram(Label->getRawScope());
DISubprogram *LocSP = getSubprogram(Loc->getRawScope()); DISubprogram *LocSP = getSubprogram(Loc->getRawScope());
@@ -6268,7 +6268,7 @@ void Verifier::visit(DPLabel &DPL) {
CheckDI(LabelSP == LocSP, CheckDI(LabelSP == LocSP,
"mismatched subprogram between #dbg_label label and !dbg attachment", "mismatched subprogram between #dbg_label label and !dbg attachment",
- &DPL, BB, F, Label, Label->getScope()->getSubprogram(), Loc,+ &DLR, BB, F, Label, Label->getScope()->getSubprogram(), Loc,
Loc->getScope()->getSubprogram()); Loc->getScope()->getSubprogram());
} }
llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp
@@ -292,7 +292,7 @@ bool SpeculativeExecutionPass::considerHoistingFromTo(
InstructionCost TotalSpeculationCost = 0; InstructionCost TotalSpeculationCost = 0;
unsigned NotHoistedInstCount = 0; unsigned NotHoistedInstCount = 0;
for (const auto &I : FromBlock) { for (const auto &I : FromBlock) {
- // Make note of any DbgVariableRecords that need hoisting. DPLabels+ // Make note of any DbgVariableRecords that need hoisting. DbgLabelRecords
// get left behind just like llvm.dbg.labels. // get left behind just like llvm.dbg.labels.
for (DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) { for (DbgVariableRecord &DVR : filterDbgVars(I.getDbgRecordRange())) {
if (HasNoUnhoistedInstr(DVR.location_ops())) if (HasNoUnhoistedInstr(DVR.location_ops()))
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -388,7 +388,7 @@ DbgVariableRecordsRemoveRedundantDbgInstrsUsingBackwardScan(BasicBlock *BB) {
SmallDenseSet<DebugVariable> VariableSet; SmallDenseSet<DebugVariable> VariableSet;
for (auto &I : reverse(*BB)) { for (auto &I : reverse(*BB)) {
for (DbgRecord &DR : reverse(I.getDbgRecordRange())) { for (DbgRecord &DR : reverse(I.getDbgRecordRange())) {
- if (isa<DPLabel>(DR)) {+ if (isa<DbgLabelRecord>(DR)) {
// Emulate existing behaviour (see comment below for dbg.declares). // Emulate existing behaviour (see comment below for dbg.declares).
// FIXME: Don't do this. // FIXME: Don't do this.
VariableSet.clear(); VariableSet.clear();
llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -1619,8 +1619,8 @@ static void fixupDebugInfoPostExtraction(Function &OldFunc, Function &NewFunc,
auto UpdateDbgRecordsOnInst = [&](Instruction &I) -> void { auto UpdateDbgRecordsOnInst = [&](Instruction &I) -> void {
for (DbgRecord &DR : I.getDbgRecordRange()) { for (DbgRecord &DR : I.getDbgRecordRange()) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- UpdateDbgLabel(DPL);+ UpdateDbgLabel(DLR);
continue; continue;
} }
llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -538,8 +538,8 @@ Value *Mapper::mapValue(const Value *V) {
} }
void Mapper::remapDbgRecord(DbgRecord &DR) { void Mapper::remapDbgRecord(DbgRecord &DR) {
- if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {+ if (DbgLabelRecord *DLR = dyn_cast<DbgLabelRecord>(&DR)) {
- DPL->setLabel(cast<DILabel>(mapMetadata(DPL->getLabel())));+ DLR->setLabel(cast<DILabel>(mapMetadata(DLR->getLabel())));
return; return;
} }
llvm/unittests/IR/IRBuilderTest.cpp
@@ -922,7 +922,7 @@ TEST_F(IRBuilderTest, DIBuilder) {
DILabel *Label = DILabel *Label =
DIB.createLabel(BarScope, "badger", File, 1, /*AlwaysPreserve*/ false); DIB.createLabel(BarScope, "badger", File, 1, /*AlwaysPreserve*/ false);
- { /* dbg.label | DPLabel */+ { /* dbg.label | DbgLabelRecord */
// Insert before I and check order. // Insert before I and check order.
ExpectOrder(DIB.insertLabel(Label, LabelLoc, I), I->getIterator()); ExpectOrder(DIB.insertLabel(Label, LabelLoc, I), I->getIterator());
@@ -931,7 +931,7 @@ TEST_F(IRBuilderTest, DIBuilder) {
// inserted into the block untill another instruction is added. // inserted into the block untill another instruction is added.
DbgInstPtr LabelRecord = DIB.insertLabel(Label, LabelLoc, BB); DbgInstPtr LabelRecord = DIB.insertLabel(Label, LabelLoc, BB);
// Specifically do not insert a terminator, to check this works. `I` // Specifically do not insert a terminator, to check this works. `I`
- // should have absorbed the DPLabel in the new debug info mode.+ // should have absorbed the DbgLabelRecord in the new debug info mode.
I = Builder.CreateAlloca(Builder.getInt32Ty()); I = Builder.CreateAlloca(Builder.getInt32Ty());
ExpectOrder(LabelRecord, I->getIterator()); ExpectOrder(LabelRecord, I->getIterator());
} }