summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index c42a9a377f4..c78b8c21c8b 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -417,10 +417,12 @@ bool DIType::isUnsignedDIType() {
bool DICompileUnit::Verify() const {
if (!isCompileUnit())
return false;
- StringRef N = getFilename();
- if (N.empty())
+
+ // Don't bother verifying the compilation directory or producer string
+ // as those could be empty.
+ if (getFilename().empty())
return false;
- // It is possible that directory and produce string is empty.
+
return DbgNode->getNumOperands() == 13;
}
OpenPOWER on IntegriCloud