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.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index e5a7415..e6b5e26 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -290,16 +290,6 @@ bool llvm::stripDebugifyMetadata(Module &M) {
return Changed;
}
-bool hasLoc(const Instruction &I) {
- const DILocation *Loc = I.getDebugLoc().get();
-#if ENABLE_DEBUGLOC_COVERAGE_TRACKING
- DebugLocKind Kind = I.getDebugLoc().getKind();
- return Loc || Kind != DebugLocKind::Normal;
-#else
- return Loc;
-#endif
-}
-
bool llvm::collectDebugInfoMetadata(Module &M,
iterator_range<Module::iterator> Functions,
DebugInfoPerPass &DebugInfoBeforePass,
@@ -372,7 +362,9 @@ bool llvm::collectDebugInfoMetadata(Module &M,
LLVM_DEBUG(dbgs() << " Collecting info for inst: " << I << '\n');
DebugInfoBeforePass.InstToDelete.insert({&I, &I});
- DebugInfoBeforePass.DILocations.insert({&I, hasLoc(I)});
+ const DILocation *Loc = I.getDebugLoc().get();
+ bool HasLoc = Loc != nullptr;
+ DebugInfoBeforePass.DILocations.insert({&I, HasLoc});
}
}
}
@@ -615,7 +607,10 @@ bool llvm::checkDebugInfoMetadata(Module &M,
LLVM_DEBUG(dbgs() << " Collecting info for inst: " << I << '\n');
- DebugInfoAfterPass.DILocations.insert({&I, hasLoc(I)});
+ const DILocation *Loc = I.getDebugLoc().get();
+ bool HasLoc = Loc != nullptr;
+
+ DebugInfoAfterPass.DILocations.insert({&I, HasLoc});
}
}
}