[2/3] dwarf-reader: Improve comments of reader::maybe_associate_die_to_type

Message ID 20260929072248.1015420-3-dodji@seketeli.org
State New
Headers
Series [1/3] dwarf-reader: Fix an intermittent assert in maybe_strip_qualification |

Commit Message

Dodji Seketeli Sept. 29, 2026, 7:21 a.m. UTC
  While looking into something else, I noticed that the comments of
reader::maybe_associate_die_to_type could be more specific about its
implications in the context of parallel processing.

	* src/abg-dwarf-reader.cc (reader::maybe_associate_die_to_type):
	Add better comments about the implication of calling this function
	in a multi-threaded environment.

Signed-off-by: Dodji Seketeli <dodji@seketeli.org>
---
 src/abg-dwarf-reader.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
  

Patch

diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc
index f0b66a30..7963214a 100644
--- a/src/abg-dwarf-reader.cc
+++ b/src/abg-dwarf-reader.cc
@@ -3746,10 +3746,16 @@  public:
   /// represents, if and only if no IR type node was already
   /// associated the DIE.
   ///
-  /// If another IR type node, was previously associated with this new
+  /// If another IR type node was previously associated with this new
   /// DIE, then the NEW type node is NOT associated.  The previous
   /// type node that was already associated is returned.
   ///
+  /// Otherwise, if this is the first time that the DIE is being
+  /// associated to a type IR node, the function makes that type IR
+  /// node be available to other threads calling
+  /// reader::lookup_artifact_from_die or
+  /// reader::lookup_type_artifact_from_die.
+  ///
   /// @param die the DIE to consider.
   ///
   /// @param type the type to associate the DIE to.