diff options
| author | Vedant Kumar <vsk@apple.com> | 2018-02-15 21:28:38 +0000 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2018-02-15 21:28:38 +0000 |
| commit | 17d8bbac45622e3cc1daa96cbab3fb4ffc79b53a (patch) | |
| tree | 3edccb8adfabe64b81919f6bdaf54a6afb1b79d2 /llvm/tools | |
| parent | b97ff922a9eeea6efbf12deba907848e5002cc76 (diff) | |
| download | bcm5719-llvm-17d8bbac45622e3cc1daa96cbab3fb4ffc79b53a.tar.gz bcm5719-llvm-17d8bbac45622e3cc1daa96cbab3fb4ffc79b53a.zip | |
[Debugify] Don't check functions which were skipped
If no debug info was applied to a function, its debug info shouldn't be
checked (it doesn't have any :).
llvm-svn: 325297
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/opt/Debugify.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/tools/opt/Debugify.cpp b/llvm/tools/opt/Debugify.cpp index 50b142b3240..441fec36765 100644 --- a/llvm/tools/opt/Debugify.cpp +++ b/llvm/tools/opt/Debugify.cpp @@ -35,6 +35,10 @@ using namespace llvm; namespace { +bool isFunctionSkipped(Function &F) { + return F.isDeclaration() || !F.hasExactDefinition(); +} + bool applyDebugifyMetadata(Module &M) { // Skip modules with debug info. if (M.getNamedMetadata("llvm.dbg.cu")) { @@ -67,7 +71,7 @@ bool applyDebugifyMetadata(Module &M) { // Visit each instruction. for (Function &F : M) { - if (F.isDeclaration() || !F.hasExactDefinition()) + if (isFunctionSkipped(F)) continue; auto SPType = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None)); @@ -134,6 +138,9 @@ void checkDebugifyMetadata(Module &M) { // Find missing lines. BitVector MissingLines{OriginalNumLines, true}; for (Function &F : M) { + if (isFunctionSkipped(F)) + continue; + for (Instruction &I : instructions(F)) { if (isa<DbgValueInst>(&I)) continue; @@ -156,6 +163,9 @@ void checkDebugifyMetadata(Module &M) { // Find missing variables. BitVector MissingVars{OriginalNumVars, true}; for (Function &F : M) { + if (isFunctionSkipped(F)) + continue; + for (Instruction &I : instructions(F)) { auto *DVI = dyn_cast<DbgValueInst>(&I); if (!DVI) |

