aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
authorDjordje Todorovic <djordje.todorovic@syrmia.com>2022-03-22 12:16:30 +0100
committerDjordje Todorovic <djordje.todorovic@syrmia.com>2022-03-22 14:04:56 +0100
commit91ea247039dbcc756107616d39baecbb3a4bfb7e (patch)
tree78bfe8d27435b7f22cde115b392f158d331b251e /llvm/lib/Transforms/Utils/Debugify.cpp
parentafb526b3f49e06d1b72986d3bc4c5d445cfda05b (diff)
downloadllvm-91ea247039dbcc756107616d39baecbb3a4bfb7e.zip
llvm-91ea247039dbcc756107616d39baecbb3a4bfb7e.tar.gz
llvm-91ea247039dbcc756107616d39baecbb3a4bfb7e.tar.bz2
[Debugify] Use DebugifyLevel in Debugify original mode
Before this patch the DebugifyLevel option was used for the synthetic mode, so after this, it will be used in the original mode as well. Differential Revision: https://reviews.llvm.org/D115623
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Debugify.cpp55
1 files changed, 29 insertions, 26 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index 84fe656..d6b1b1b 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -42,7 +42,6 @@ enum class Level {
LocationsAndVariables
};
-// Used for the synthetic mode only.
cl::opt<Level> DebugifyLevel(
"debugify-level", cl::desc("Kind of debug info to add"),
cl::values(clEnumValN(Level::Locations, "locations", "Locations only"),
@@ -321,20 +320,22 @@ bool llvm::collectDebugInfoMetadata(Module &M,
if (isa<PHINode>(I))
continue;
- // Collect dbg.values and dbg.declares.
- if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
- if (!SP)
- continue;
- // Skip inlined variables.
- if (I.getDebugLoc().getInlinedAt())
- continue;
- // Skip undef values.
- if (DVI->isUndef())
+ // Cllect dbg.values and dbg.declare.
+ if (DebugifyLevel > Level::Locations) {
+ if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
+ if (!SP)
+ continue;
+ // Skip inlined variables.
+ if (I.getDebugLoc().getInlinedAt())
+ continue;
+ // Skip undef values.
+ if (DVI->isUndef())
+ continue;
+
+ auto *Var = DVI->getVariable();
+ DebugInfoBeforePass.DIVariables[Var]++;
continue;
-
- auto *Var = DVI->getVariable();
- DebugInfoBeforePass.DIVariables[Var]++;
- continue;
+ }
}
// Skip debug instructions other than dbg.value and dbg.declare.
@@ -556,19 +557,21 @@ bool llvm::checkDebugInfoMetadata(Module &M,
continue;
// Collect dbg.values and dbg.declares.
- if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
- if (!SP)
+ if (DebugifyLevel > Level::Locations) {
+ if (auto *DVI = dyn_cast<DbgVariableIntrinsic>(&I)) {
+ if (!SP)
+ continue;
+ // Skip inlined variables.
+ if (I.getDebugLoc().getInlinedAt())
+ continue;
+ // Skip undef values.
+ if (DVI->isUndef())
+ continue;
+
+ auto *Var = DVI->getVariable();
+ DebugInfoAfterPass.DIVariables[Var]++;
continue;
- // Skip inlined variables.
- if (I.getDebugLoc().getInlinedAt())
- continue;
- // Skip undef values.
- if (DVI->isUndef())
- continue;
-
- auto *Var = DVI->getVariable();
- DebugInfoAfterPass.DIVariables[Var]++;
- continue;
+ }
}
// Skip debug instructions other than dbg.value and dbg.declare.