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

2025-04-11 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > IIRC, there are still some open review threads in this PR, mainly related to > reducing duplication in the symbolication bits. Yes, this part won't land quite yet; as I'm kicking these reviews back into action, I'll be pushing up some other reviews to come before this one in t

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

2025-04-11 Thread J. Ryan Stinnett via cfe-commits
jryans wrote: IIRC, there are still some open review threads in this PR, mainly related to reducing duplication in the symbolication bits. https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

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

2024-09-26 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107369 >From e45d7e68a371a09ea766c4accf8edc6c030fd7fd Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:09:50 +0100 Subject: [PATCH 1/4] Add CMake option to enable expensive line number origin trac

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

2024-09-25 Thread J. Ryan Stinnett via cfe-commits
@@ -1279,6 +1279,9 @@ void Instruction::swapProfMetadata() { void Instruction::copyMetadata(const Instruction &SrcInst, ArrayRef WL) { + if (WL.empty() || is_contained(WL, LLVMContext::MD_dbg)) +setDebugLoc(SrcInst.getDebugLoc()); --

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

2024-09-25 Thread Stephen Tozer via cfe-commits
@@ -1279,6 +1279,9 @@ void Instruction::swapProfMetadata() { void Instruction::copyMetadata(const Instruction &SrcInst, ArrayRef WL) { + if (WL.empty() || is_contained(WL, LLVMContext::MD_dbg)) +setDebugLoc(SrcInst.getDebugLoc()); --

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

2024-09-25 Thread J. Ryan Stinnett via cfe-commits
@@ -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

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

2024-09-24 Thread J. Ryan Stinnett via cfe-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddresses)

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

2024-09-24 Thread Stephen Tozer via cfe-commits
@@ -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

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

2024-09-24 Thread J. Ryan Stinnett via cfe-commits
https://github.com/jryans edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-24 Thread J. Ryan Stinnett via cfe-commits
@@ -487,14 +490,15 @@ def Main(): if bugs_metadata == "DILocation": try: +origin = bug["origin"] action = bug["action"] bb_name = bug["bb-name"]

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

2024-09-24 Thread J. Ryan Stinnett via cfe-commits
https://github.com/jryans edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-24 Thread J. Ryan Stinnett via cfe-commits
@@ -115,6 +138,23 @@ namespace llvm { DebugLocKind getKind() const { return Loc.Kind; } #endif +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +#if !ENABLE_DEBUGLOC_COVERAGE_TRACKING +#error Cannot enable DebugLoc origin-tracking without coverage-tracking! +#endif jr

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

2024-09-23 Thread Stephen Tozer via cfe-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddresses)

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

2024-09-23 Thread Stephen Tozer via cfe-commits
@@ -115,6 +138,23 @@ namespace llvm { DebugLocKind getKind() const { return Loc.Kind; } #endif +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +#if !ENABLE_DEBUGLOC_COVERAGE_TRACKING +#error Cannot enable DebugLoc origin-tracking without coverage-tracking! +#endif SL

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

2024-09-23 Thread Stephen Tozer via cfe-commits
@@ -487,14 +490,15 @@ def Main(): if bugs_metadata == "DILocation": try: +origin = bug["origin"] action = bug["action"] bb_name = bug["bb-name"]

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -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

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddresses)

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -115,6 +138,23 @@ namespace llvm { DebugLocKind getKind() const { return Loc.Kind; } #endif +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +#if !ENABLE_DEBUGLOC_COVERAGE_TRACKING +#error Cannot enable DebugLoc origin-tracking without coverage-tracking! +#endif jr

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -487,14 +490,15 @@ def Main(): if bugs_metadata == "DILocation": try: +origin = bug["origin"] action = bug["action"] bb_name = bug["bb-name"]

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -28,6 +31,11 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/JSON.h" #include +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +// We need the Signals header to operate on stacktraces if we're using DebugLoc jryans wrote: stacktrace -> stack trace http

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -253,6 +253,122 @@ static bool printSymbolizedStackTrace(StringRef Argv0, void **StackTrace, return true; } +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +void sys::symbolizeAddresses(AddressSet &Addresses, + SymbolizedAddressMap &SymbolizedAddresses)

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -50,11 +50,15 @@ class TargetRegisterInfo; class MergePotentialsElt { unsigned Hash; MachineBasicBlock *Block; - DebugLoc BranchDebugLoc; + // We use MDNode rather than DebugLoc here because under certain CMake + // options*, DebugLoc may conta

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -1279,6 +1279,9 @@ void Instruction::swapProfMetadata() { void Instruction::copyMetadata(const Instruction &SrcInst, ArrayRef WL) { + if (WL.empty() || is_contained(WL, LLVMContext::MD_dbg)) +setDebugLoc(SrcInst.getDebugLoc()); --

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
@@ -55,6 +73,28 @@ namespace sys { ///specified, the entire frame is printed. void PrintStackTrace(raw_ostream &OS, int Depth = 0); +#if ENABLE_DEBUGLOC_ORIGIN_TRACKING +#ifdef NDEBUG +#error DebugLoc origin-tracking should not be enabled in Release builds. +#endif

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
https://github.com/jryans requested changes to this pull request. More exciting work! 😄 Seems roughly sensible, but appears to duplicate some code that can hopefully be shared. https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing l

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

2024-09-23 Thread J. Ryan Stinnett via cfe-commits
https://github.com/jryans edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-11 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-11 Thread Stephen Tozer via cfe-commits
SLTozer wrote: > @SLTozer What's in patches 4 and 5...? I keep putting off looking at this > stack, as I've been waiting for the whole series to appear (perhaps > incorrectly)... Patches 4 and 5 are less consequential, but I'll open them up - patch 4 is adding origin-tracking support to the I

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

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer edited https://github.com/llvm/llvm-project/pull/107369 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/107369 >From e45d7e68a371a09ea766c4accf8edc6c030fd7fd Mon Sep 17 00:00:00 2001 From: Stephen Tozer Date: Wed, 4 Sep 2024 12:09:50 +0100 Subject: [PATCH 1/3] Add CMake option to enable expensive line number origin trac

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

2024-09-05 Thread via cfe-commits
github-actions[bot] wrote: :warning: Python code formatter, darker found issues in your code. :warning: You can test this locally with the following command: ``bash darker --check --diff -r 5f05d5ec8f9bb15c0ac29fce843a2c73165ac414...194069a26418fc4dbb27cee13d5b4263588320b7 llvm/

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

2024-09-05 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 5f05d5ec8f9bb15c0ac29fce843a2c73165ac414 194069a26418fc4dbb27cee13d5b4263588320b7 --e

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

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking feature, which collects a stack trace at the po

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

2024-09-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-debuginfo @llvm/pr-subscribers-platform-windows Author: Stephen Tozer (SLTozer) Changes This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking featu

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

2024-09-05 Thread Stephen Tozer via cfe-commits
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/107369 This is part of a series of patches that tries to improve DILocation bug detection in Debugify; see below for more details. This patch adds an origin-tracking feature, which collects a stack trace at the point