[clang] [llvm] [DLCov 2/5] Implement DebugLoc coverage tracking (PR #107279)
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 23 15:15:24 PDT 2025
================
@@ -169,6 +169,47 @@ See the discussion in the section about
:ref:`merging locations<WhenToMergeLocation>` for examples of when the rule for
dropping locations applies.
+.. _NewInstLocations:
+
+Setting locations for new instructions
+--------------------------------------
+
+Whenever a new instruction is created and there is no suitable location for that
+instruction, that instruction should be annotated accordingly. There are a set
+of special ``DebugLoc`` values that can be set on an instruction to annotate the
+reason that it does not have a valid location. These are as follows:
+
+* ``DebugLoc::getCompilerGenerated()``: This indicates that the instruction is a
+ compiler-generated instruction, i.e. it is not associated with any user source
+ code.
+
+* ``DebugLoc::getDropped()``: This indicates that the instruction has
+ intentionally had its source location removed, according to the rules for
+ :ref:`dropping locations<WhenToDropLocation>`; this is set automatically by
+ ``Instruction::dropLocation()``.
+
+* ``DebugLoc::getUnknown()``: This indicates that the instruction does not have
----------------
dwblaikie wrote:
Yeah, no worries - you've got th eboots on the ground experience, so go with your gut.
https://github.com/llvm/llvm-project/pull/107279
More information about the cfe-commits
mailing list