[clang] [llvm] [DLCov 4/5] Track coverage and origins through IRBuilder (PR #108214)

J. Ryan Stinnett via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 26 06:39:05 PDT 2024


================
@@ -90,12 +90,23 @@ class IRBuilderCallbackInserter : public IRBuilderDefaultInserter {
 /// Common base class shared among various IRBuilders.
 class IRBuilderBase {
   /// Pairs of (metadata kind, MDNode *) that should be added to all newly
-  /// created instructions, like !dbg metadata.
+  /// created instructions, excluding !dbg metadata, which is stored in the
+  // StoredDL field.
   SmallVector<std::pair<unsigned, MDNode *>, 2> MetadataToCopy;
+  // The DebugLoc that will be applied to instructions inserted by this builder.
+  DebugLoc StoredDL;
+  // Tracks whether we have explicitly set a DebugLoc - valid or empty - in this
+  // builder, to determine whether to copy StoredDL to inserted instructions.
+  // We use this bool instead of an optional because we may stil want to copy
----------------
jryans wrote:

stil -> still

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


More information about the cfe-commits mailing list