From d8230627e4fc4439bdae684402f38d50b762f765 Mon Sep 17 00:00:00 2001 From: OCHyams Date: Thu, 23 Nov 2023 09:30:33 +0000 Subject: [PATCH] [NFC][RemoveDIs] Add LocationType parameter to DPValue ctor --- llvm/include/llvm/IR/DebugProgramInstruction.h | 2 +- llvm/lib/IR/DebugProgramInstruction.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h index cd5d37a078015..7f16151cdfc64 100644 --- a/llvm/include/llvm/IR/DebugProgramInstruction.h +++ b/llvm/include/llvm/IR/DebugProgramInstruction.h @@ -113,7 +113,7 @@ class DPValue : public ilist_node, private DebugValueUser { /// 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); + const DILocation *DI, LocationType Type = LocationType::Value); /// Iterator for ValueAsMetadata that internally uses direct pointer iteration /// over either a ValueAsMetadata* or a ValueAsMetadata**, dereferencing to the diff --git a/llvm/lib/IR/DebugProgramInstruction.cpp b/llvm/lib/IR/DebugProgramInstruction.cpp index 6a4ee9d610107..df45c6ea3a776 100644 --- a/llvm/lib/IR/DebugProgramInstruction.cpp +++ b/llvm/lib/IR/DebugProgramInstruction.cpp @@ -35,10 +35,9 @@ DPValue::DPValue(const DPValue &DPV) DbgLoc(DPV.getDebugLoc()), Type(DPV.getType()) {} DPValue::DPValue(Metadata *Location, DILocalVariable *DV, DIExpression *Expr, - const DILocation *DI) + const DILocation *DI, LocationType Type) : DebugValueUser(Location), Variable(DV), Expression(Expr), DbgLoc(DI), - Type(LocationType::Value) { -} + Type(Type) {} void DPValue::deleteInstr() { delete this; }