From 627079d42a1340360f8699cd87865e20799cff21 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 21 Nov 2002 16:54:22 +0000 Subject: [PATCH] User defined operators are not supposed to live beyond the lifetime of the pass. Detect and flag them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4801 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 812ca4a8684..145a66caf53 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -137,6 +137,8 @@ namespace { // Anonymous namespace for class void visitInstruction(Instruction &I); void visitTerminatorInst(TerminatorInst &I); void visitReturnInst(ReturnInst &RI); + void visitUserOp1(Instruction &I); + void visitUserOp2(Instruction &I) { visitUserOp1(I); } // CheckFailed - A check failed, so print out the condition and the message // that failed. This provides a nice place to put a breakpoint if you want @@ -248,6 +250,13 @@ void Verifier::visitReturnInst(ReturnInst &RI) { visitTerminatorInst(RI); } +// visitUserOp1 - User defined operators shouldn't live beyond the lifetime of a +// pass, if any exist, it's an error. +// +void Verifier::visitUserOp1(Instruction &I) { + Assert1(0, "User-defined operators should not live outside of a pass!", + &I); +} // visitPHINode - Ensure that a PHI node is well formed. void Verifier::visitPHINode(PHINode &PN) { -- 2.34.1