aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Debugify.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index d67a563..3e323cc 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -35,6 +35,8 @@ using namespace llvm;
namespace {
+cl::opt<bool> ApplyAtomGroups("debugify-atoms", cl::init(false));
+
cl::opt<bool> Quiet("debugify-quiet",
cl::desc("Suppress verbose debugify output"));
@@ -142,8 +144,13 @@ bool llvm::applyDebugifyMetadata(
for (BasicBlock &BB : F) {
// Attach debug locations.
- for (Instruction &I : BB)
- I.setDebugLoc(DILocation::get(Ctx, NextLine++, 1, SP));
+ for (Instruction &I : BB) {
+ uint64_t AtomGroup = ApplyAtomGroups ? NextLine : 0;
+ uint8_t AtomRank = ApplyAtomGroups ? 1 : 0;
+ uint64_t Line = NextLine++;
+ I.setDebugLoc(DILocation::get(Ctx, Line, 1, SP, nullptr, false,
+ AtomGroup, AtomRank));
+ }
if (DebugifyLevel < Level::LocationsAndVariables)
continue;