From faebbb053d4971a68d10df9a4f3d5db5aeed0afd Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 28 Mar 2016 21:06:26 +0000 Subject: 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 --- llvm/tools/bugpoint/CrashDebugger.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/tools') 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 &NamedMDs) { std::vector 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) -- cgit v1.2.3