@@ -282,6 +282,7 @@ class DbgVariableRecord : public DbgRecord, protected DebugValueUser {
282282 Declare,
283283 Value,
284284 Assign,
285+ DeclareValue,
285286
286287 End, // /< Marks the end of the concrete types.
287288 Any, // /< To indicate all LocationTypes in searches.
@@ -364,6 +365,13 @@ class DbgVariableRecord : public DbgRecord, protected DebugValueUser {
364365 createDVRDeclare (Value *Address, DILocalVariable *DV, DIExpression *Expr,
365366 const DILocation *DI, DbgVariableRecord &InsertBefore);
366367
368+ LLVM_ABI static DbgVariableRecord *
369+ createDVRDeclareValue (Value *Address, DILocalVariable *DV, DIExpression *Expr,
370+ const DILocation *DI);
371+ LLVM_ABI static DbgVariableRecord *
372+ createDVRDeclareValue (Value *Address, DILocalVariable *DV, DIExpression *Expr,
373+ const DILocation *DI, DbgVariableRecord &InsertBefore);
374+
367375 // / Iterator for ValueAsMetadata that internally uses direct pointer iteration
368376 // / over either a ValueAsMetadata* or a ValueAsMetadata**, dereferencing to the
369377 // / ValueAsMetadata .
@@ -414,6 +422,7 @@ class DbgVariableRecord : public DbgRecord, protected DebugValueUser {
414422
415423 bool isDbgDeclare () const { return Type == LocationType::Declare; }
416424 bool isDbgValue () const { return Type == LocationType::Value; }
425+ bool isDbgDeclareValue () const { return Type == LocationType::DeclareValue; }
417426
418427 // / Get the locations corresponding to the variable referenced by the debug
419428 // / info intrinsic. Depending on the intrinsic, this could be the
@@ -439,12 +448,16 @@ class DbgVariableRecord : public DbgRecord, protected DebugValueUser {
439448 bool hasValidLocation () const { return getVariableLocationOp (0 ) != nullptr ; }
440449
441450 // / Does this describe the address of a local variable. True for dbg.addr
442- // / and dbg.declare, but not dbg.value, which describes its value.
451+ // / and dbg.declare, but not dbg.value or dbg.declare_value, which describes
452+ // / its value.
443453 bool isAddressOfVariable () const { return Type == LocationType::Declare; }
444454
445455 // / Determine if this describes the value of a local variable. It is false for
446- // / dbg.declare, but true for dbg.value, which describes its value.
447- bool isValueOfVariable () const { return Type == LocationType::Value; }
456+ // / dbg.declare, but true for dbg.value and dbg.declare_value, which describes
457+ // / its value.
458+ bool isValueOfVariable () const {
459+ return Type == LocationType::Value || Type == LocationType::DeclareValue;
460+ }
448461
449462 LocationType getType () const { return Type; }
450463
0 commit comments