[llvm] [RemoveDIs][DebugInfo][IR] Add parsing for non-intrinsic debug values (PR #79818)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 07:04:17 PST 2024
================
@@ -6406,11 +6446,103 @@ bool LLParser::parseBasicBlock(PerFunctionState &PFS) {
// Set the name on the instruction.
if (PFS.setInstName(NameID, NameStr, NameLoc, Inst))
return true;
+
+ // Attach any preceding debug values to this instruction.
+ for (std::unique_ptr<DPValue> &DPV : TrailingDPValues) {
+ BB->insertDPValueBefore(DPV.release(), Inst->getIterator());
+ }
+ TrailingDPValues.clear();
} while (!Inst->isTerminator());
+ assert(TrailingDPValues.empty() &&
+ "All debug values should have been attached to an instruction.");
+
return false;
}
+/// parseDebugProgramValue
+/// ::= #dbg_Type { (ValueAsMetadata|DIArgList|MDNode), MetadataID,
+/// DIExpression, DILocation }
+bool LLParser::parseDebugProgramValue(DPValue *&DPV, PerFunctionState &PFS) {
+ using LocType = DPValue::LocationType;
+ LocTy DPVLoc = Lex.getLoc();
+ if (Lex.getKind() != lltok::DbgRecordType) {
+ return error(DPVLoc, "expected debug record type here");
+ }
----------------
OCHyams wrote:
nit: braces
https://github.com/llvm/llvm-project/pull/79818
More information about the llvm-commits
mailing list