[clang] [llvm] [DLCov 3/5] Implement DebugLoc origin-tracking (PR #107369)

Stephen Tozer via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 24 10:45:44 PDT 2024


================
@@ -48,22 +64,29 @@ namespace llvm {
     Temporary
   };
 
-  // Extends TrackingMDNodeRef to also store a DebugLocKind, allowing Debugify
-  // to ignore intentionally-empty DebugLocs.
-  class DILocAndCoverageTracking : public TrackingMDNodeRef {
+  // Extends TrackingMDNodeRef to also store a DebugLocKind and Origin,
+  // allowing Debugify to ignore intentionally-empty DebugLocs and display the
+  // code responsible for generating unintentionally-empty DebugLocs.
+  // Currently we only need to track the Origin of this DILoc when using a
+  // DebugLoc that is Normal and empty, so only collect the origin stacktrace in
----------------
SLTozer wrote:

I do actually mean "Normal and empty" in this case; it _is_ confusing wording that should be cleared up, but essentially a "Normal" DebugLoc type is one that hasn't been assigned an annotation; therefore, Normal DebugLocs can either have valid DILocations, or they can be empty, representing missing locations without an annotation. This could be changed so that we have an explicit Empty enum value that gets conditionally set in the DebugLoc constructor, I just didn't do that for simplicity (of implementation).

https://github.com/llvm/llvm-project/pull/107369


More information about the cfe-commits mailing list