[llvm] [NFC][RemoveDIs] Add LocationType parameter to DPValue ctor (PR #74091)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 07:28:36 PST 2023


https://github.com/OCHyams created https://github.com/llvm/llvm-project/pull/74091

IMO we can tidy up the interfaces a bit once all intrinsics are supported, so we have a complete view.

>From d8230627e4fc4439bdae684402f38d50b762f765 Mon Sep 17 00:00:00 2001
From: OCHyams <orlando.hyams at sony.com>
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 cd5d37a078015be..7f16151cdfc64ba 100644
--- a/llvm/include/llvm/IR/DebugProgramInstruction.h
+++ b/llvm/include/llvm/IR/DebugProgramInstruction.h
@@ -113,7 +113,7 @@ class DPValue : public ilist_node<DPValue>, 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 6a4ee9d6101076f..df45c6ea3a776fd 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; }
 



More information about the llvm-commits mailing list