diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-03-28 21:06:26 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-03-28 21:06:26 +0000 |
commit | faebbb053d4971a68d10df9a4f3d5db5aeed0afd (patch) | |
tree | 77cb00300206f881742871634dfc12bf33f5146c /llvm/tools | |
parent | 64fa75391cba60721f7b4d07e6fe6126b76809a5 (diff) | |
download | bcm5719-llvm-faebbb053d4971a68d10df9a4f3d5db5aeed0afd.tar.gz bcm5719-llvm-faebbb053d4971a68d10df9a4f3d5db5aeed0afd.zip |
Add an IR Verifier check for orphaned DICompileUnits.
A DICompileUnit that is not listed in llvm.dbg.cu will cause assertion
failures and/or crashes in the backend. The Verifier should reject this.
rdar://problem/25369499
llvm-svn: 264657
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 7f9a54a389a..493bda64f19 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -552,7 +552,9 @@ bool ReduceCrashingNamedMD::TestNamedMDs(std::vector<std::string> &NamedMDs) { std::vector<NamedMDNode *> ToDelete; ToDelete.reserve(M->named_metadata_size() - Names.size()); for (auto &NamedMD : M->named_metadata()) - if (!Names.count(NamedMD.getName())) + // Always keep a nonempty llvm.dbg.cu because the Verifier would complain. + if (!Names.count(NamedMD.getName()) && + (!(NamedMD.getName() == "llvm.dbg.cu" && NamedMD.getNumOperands() > 0))) ToDelete.push_back(&NamedMD); for (auto *NamedMD : ToDelete) |