diff options
Diffstat (limited to 'include/llvm/IR/Verifier.h')
-rw-r--r-- | include/llvm/IR/Verifier.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/llvm/IR/Verifier.h b/include/llvm/IR/Verifier.h index 0f146e6936..9a2f402ac8 100644 --- a/include/llvm/IR/Verifier.h +++ b/include/llvm/IR/Verifier.h @@ -21,13 +21,15 @@ #ifndef LLVM_IR_VERIFIER_H #define LLVM_IR_VERIFIER_H +#include "llvm/ADT/StringRef.h" #include <string> namespace llvm { +class Function; class FunctionPass; class Module; -class Function; +class PreservedAnalyses; class raw_ostream; /// \brief Check a function for errors, useful for use when debugging a @@ -52,8 +54,22 @@ bool verifyModule(const Module &M, raw_ostream *OS = 0); /// functionality. When the pass detects a verification error it is always /// printed to stderr, and by default they are fatal. You can override that by /// passing \c false to \p FatalErrors. +/// +/// Note that this creates a pass suitable for the legacy pass manager. It has nothing to do with \c VerifierPass. FunctionPass *createVerifierPass(bool FatalErrors = true); +class VerifierPass { + bool FatalErrors; + +public: + explicit VerifierPass(bool FatalErrors = true) : FatalErrors(FatalErrors) {} + + PreservedAnalyses run(Module *M); + PreservedAnalyses run(Function *F); + + static StringRef name() { return "VerifierPass"; } +}; + } // End llvm namespace #endif |