@@ -497,35 +497,34 @@ void DWARFUnit::extractDIEsIfNeeded(bool CUDieOnly) {
497
497
498
498
Error DWARFUnit::tryExtractDIEsIfNeeded (bool CUDieOnly) {
499
499
{
500
- llvm::sys::ScopedReader Lock (m_cu_die_array_mutex );
500
+ llvm::sys::ScopedReader Lock (CUDieArrayMutex );
501
501
if ((CUDieOnly && !DieArray.empty ()) || DieArray.size () > 1 )
502
502
return Error::success (); // Already parsed.
503
503
}
504
504
bool HasCUDie = false ;
505
505
{
506
- llvm::sys::ScopedWriter Lock (m_cu_die_array_mutex );
506
+ llvm::sys::ScopedWriter Lock (CUDieArrayMutex );
507
507
if ((CUDieOnly && !DieArray.empty ()) || DieArray.size () > 1 )
508
508
return Error::success (); // Already parsed.
509
509
HasCUDie = !DieArray.empty ();
510
510
extractDIEsToVector (!HasCUDie, !CUDieOnly, DieArray);
511
511
}
512
512
{
513
- llvm::sys::ScopedReader Lock (m_all_die_array_mutex );
513
+ llvm::sys::ScopedReader Lock (AllDieArrayMutex );
514
514
if (DieArray.empty ())
515
515
return Error::success ();
516
516
517
- // If CU DIE was just parsed, copy several attribute values from it.
518
517
if (HasCUDie)
519
518
return Error::success ();
520
519
}
521
- llvm::sys::ScopedWriter Lock (m_all_die_array_mutex );
520
+ llvm::sys::ScopedWriter Lock (AllDieArrayMutex );
522
521
if (DieArray.empty ())
523
522
return Error::success ();
524
523
525
- // If CU DIE was just parsed, copy several attribute values from it.
526
524
if (HasCUDie)
527
525
return Error::success ();
528
526
527
+ // If CU DIE was just parsed, copy several attribute values from it.
529
528
DWARFDie UnitDie (this , &DieArray[0 ]);
530
529
if (std::optional<uint64_t > DWOId =
531
530
toUnsigned (UnitDie.find (DW_AT_GNU_dwo_id)))
@@ -674,8 +673,8 @@ void DWARFUnit::clearDIEs(bool KeepCUDie) {
674
673
// It depends on the implementation whether the request is fulfilled.
675
674
// Create a new vector with a small capacity and assign it to the DieArray to
676
675
// have previous contents freed.
677
- llvm::sys::ScopedWriter CULock (m_cu_die_array_mutex );
678
- llvm::sys::ScopedWriter AllLock (m_all_die_array_mutex );
676
+ llvm::sys::ScopedWriter CULock (CUDieArrayMutex );
677
+ llvm::sys::ScopedWriter AllLock (AllDieArrayMutex );
679
678
DieArray = (KeepCUDie && !DieArray.empty ())
680
679
? std::vector<DWARFDebugInfoEntry>({DieArray[0 ]})
681
680
: std::vector<DWARFDebugInfoEntry>();
0 commit comments