aboutsummaryrefslogtreecommitdiff
path: root/tools/opt
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-06-28 18:21:11 +0000
committerVedant Kumar <vsk@apple.com>2018-06-28 18:21:11 +0000
commit3d7cc9ef30488996b4b1532197f92d313a878850 (patch)
treefa1cc51883474c31aee9b190d56d61305abc6c68 /tools/opt
parentb2408daddbd313364fcf4c872013a725b0a65b4a (diff)
[Debugify] Do not report line 0 locations as errors
The checking logic should not treat artificial locations as being somehow problematic. Producing these locations can be the desired behavior of some passes. See llvm.org/PR37961. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335897 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r--tools/opt/Debugify.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/opt/Debugify.cpp b/tools/opt/Debugify.cpp
index e8437016d94..05ade96a80d 100644
--- a/tools/opt/Debugify.cpp
+++ b/tools/opt/Debugify.cpp
@@ -237,11 +237,13 @@ bool checkDebugifyMetadata(Module &M,
continue;
}
- dbg() << "ERROR: Instruction with empty DebugLoc in function ";
- dbg() << F.getName() << " --";
- I.print(dbg());
- dbg() << "\n";
- HasErrors = true;
+ if (!DL) {
+ dbg() << "ERROR: Instruction with empty DebugLoc in function ";
+ dbg() << F.getName() << " --";
+ I.print(dbg());
+ dbg() << "\n";
+ HasErrors = true;
+ }
}
// Find missing variables and mis-sized debug values.