Verifier: Don't return early from verifyTypeRefs()

We'll no longer crash in the `verifyTypeRefs()` (used to be called
`verifyDebugInfo()`), so there's no reason to return early here.  Remove
the `EverBroken` member since this was the only use!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-31 02:37:13 +00:00
parent 35ef0ef906
commit 6b9d1f9cee

View File

@ -87,10 +87,9 @@ struct VerifierSupport {
/// \brief Track the brokenness of the module while recursively visiting. /// \brief Track the brokenness of the module while recursively visiting.
bool Broken; bool Broken;
bool EverBroken;
explicit VerifierSupport(raw_ostream &OS) explicit VerifierSupport(raw_ostream &OS)
: OS(OS), M(nullptr), Broken(false), EverBroken(false) {} : OS(OS), M(nullptr), Broken(false) {}
private: private:
void Write(const Value *V) { void Write(const Value *V) {
@ -145,7 +144,7 @@ public:
/// something is not correct. /// something is not correct.
void CheckFailed(const Twine &Message) { void CheckFailed(const Twine &Message) {
OS << Message << '\n'; OS << Message << '\n';
EverBroken = Broken = true; Broken = true;
} }
/// \brief A check failed (with values to print). /// \brief A check failed (with values to print).
@ -3387,11 +3386,6 @@ void Verifier::visitUnresolvedTypeRef(const MDString *S, const MDNode *N) {
} }
void Verifier::verifyTypeRefs() { void Verifier::verifyTypeRefs() {
// Run the debug info verifier only if the regular verifier succeeds, since
// sometimes checks that have already failed will cause crashes here.
if (EverBroken || !VerifyDebugInfo)
return;
auto *CUs = M->getNamedMetadata("llvm.dbg.cu"); auto *CUs = M->getNamedMetadata("llvm.dbg.cu");
if (!CUs) if (!CUs)
return; return;