[llvm] 4648acb - [NFC][RemoveDIs] Add LocationType parameter to DPValue ctor (#74091)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 11 03:34:56 PST 2023


Author: Orlando Cazalet-Hyams
Date: 2023-12-11T11:34:53Z
New Revision: 4648acbb6047afc4834560825c5a2bc6d6384e0d

URL: https://github.com/llvm/llvm-project/commit/4648acbb6047afc4834560825c5a2bc6d6384e0d
DIFF: https://github.com/llvm/llvm-project/commit/4648acbb6047afc4834560825c5a2bc6d6384e0d.diff

LOG: [NFC][RemoveDIs] Add LocationType parameter to DPValue ctor (#74091)

We can tidy up the interfaces a bit once all intrinsics are supported, as we
will have a more informed view then.

Added: 
    

Modified: 
    llvm/include/llvm/IR/DebugProgramInstruction.h
    llvm/lib/IR/DebugProgramInstruction.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h
index d6b4536a2a07d..f73a6237a4777 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 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; }
 


        


More information about the llvm-commits mailing list