Skip to content

Commit

Permalink
fix comment & update functions after upstream rename
Browse files Browse the repository at this point in the history
  • Loading branch information
OCHyams committed Mar 15, 2024
1 parent 5714bf0 commit 9f186e5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Bitcode/LLVMBitCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ enum FunctionCodes {
// DIAssignID, DIExpression (addr), ValueAsMetadata (addr)]
FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE =
64, // [DILocation, DILocalVariable, DIExpression, Value]
FUNC_CODE_DEBUG_RECORD_LABEL = 65, // DPVALUE: [DILocation, DILabel]
FUNC_CODE_DEBUG_RECORD_LABEL = 65, // [DILocation, DILabel]
};

enum UseListCodes {
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Bitcode/Reader/BitcodeReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6406,8 +6406,8 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
return error("Invalid dbg record: missing instruction");
DILocation *DIL = cast<DILocation>(getFnMetadataByID(Record[0]));
DILabel *Label = cast<DILabel>(getFnMetadataByID(Record[1]));
Inst->getParent()->insertDPValueBefore(new DPLabel(Label, DIL),
Inst->getIterator());
Inst->getParent()->insertDbgRecordBefore(
new DPLabel(Label, DebugLoc(DIL)), Inst->getIterator());
continue; // This isn't an instruction.
}
case bitc::FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE:
Expand Down Expand Up @@ -6479,7 +6479,7 @@ Error BitcodeReader::parseFunctionBody(Function *F) {
default:
llvm_unreachable("Unknown DPValue bitcode");
}
Inst->getParent()->insertDPValueBefore(DPV, Inst->getIterator());
Inst->getParent()->insertDbgRecordBefore(DPV, Inst->getIterator());
continue; // This isn't an instruction.
}
case bitc::FUNC_CODE_INST_CALL: {
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3532,11 +3532,11 @@ void ModuleBitcodeWriter::writeFunction(
}
}

// If the instruction has DPValues attached to it, emit them. Note that
// If the instruction has DbgRecords attached to it, emit them. Note that
// they come after the instruction so that it's easy to attach them again
// when reading the bitcode, even though conceptually the debug locations
// start "before" the instruction.
if (I.hasDbgValues() && WriteNewDbgInfoFormatToBitcode) {
if (I.hasDbgRecords() && WriteNewDbgInfoFormatToBitcode) {
/// Try to push the value only (unwrapped), otherwise push the
/// metadata wrapped value. Returns true if the value was pushed
/// without the ValueAsMetadata wrapper.
Expand All @@ -3562,7 +3562,7 @@ void ModuleBitcodeWriter::writeFunction(
// Write out non-instruction debug information attached to this
// instruction. Write it after the instruction so that it's easy to
// re-attach to the instruction reading the records in.
for (DbgRecord &DR : I.DbgMarker->getDbgValueRange()) {
for (DbgRecord &DR : I.DbgMarker->getDbgRecordRange()) {
if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {
Vals.push_back(VE.getMetadataID(&*DPL->getDebugLoc()));
Vals.push_back(VE.getMetadataID(DPL->getLabel()));
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static OrderMap orderModule(const Module &M) {
}
};

for (DPValue &DPV : DPValue::filter(I.getDbgValueRange())) {
for (DPValue &DPV : filterDbgVars(I.getDbgRecordRange())) {
OrderConstantFromMetadata(DPV.getRawLocation());
if (DPV.isDbgAssign())
OrderConstantFromMetadata(DPV.getRawAddress());
Expand Down Expand Up @@ -285,7 +285,7 @@ static UseListOrderStack predictUseListOrder(const Module &M) {
predictValueUseListOrder(&A, &F, OM, Stack);
for (const BasicBlock &BB : F) {
for (const Instruction &I : BB) {
for (DPValue &DPV : DPValue::filter(I.getDbgValueRange())) {
for (DPValue &DPV : filterDbgVars(I.getDbgRecordRange())) {
PredictValueOrderFromMetadata(DPV.getRawLocation());
if (DPV.isDbgAssign())
PredictValueOrderFromMetadata(DPV.getRawAddress());
Expand Down Expand Up @@ -440,7 +440,7 @@ ValueEnumerator::ValueEnumerator(const Module &M,
EnumerateMetadata(&F, MD);
};

for (DbgRecord &DR : I.getDbgValueRange()) {
for (DbgRecord &DR : I.getDbgRecordRange()) {
if (DPLabel *DPL = dyn_cast<DPLabel>(&DR)) {
EnumerateMetadata(&F, DPL->getLabel());
EnumerateMetadata(&F, &*DPL->getDebugLoc());
Expand Down Expand Up @@ -1128,7 +1128,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) {
AddFnLocalMetadata(MD->getMetadata());
}
/// RemoveDIs: Add non-instruction function-local metadata uses.
for (DPValue &DPV : DPValue::filter(I.getDbgValueRange())) {
for (DPValue &DPV : filterDbgVars(I.getDbgRecordRange())) {
assert(DPV.getRawLocation() && "DPValue location unexpectedly null");
AddFnLocalMetadata(DPV.getRawLocation());
if (DPV.isDbgAssign()) {
Expand Down

0 comments on commit 9f186e5

Please sign in to comment.