llvm::verifyModule

Check a module for errors.

Synopsis

Declared in <llvm/IR/Verifier.h>

bool
verifyModule(
    Module const& M,
    raw_ostream* OS = nullptr,
    bool* BrokenDebugInfo = nullptr);

Description

If there are no errors, the function returns false. If an error is found, a message describing the error is written to OS (if non-null) and true is returned.

Return Value

true if the module is broken. If BrokenDebugInfo is supplied, DebugInfo verification failures won't be considered as error and instead *BrokenDebugInfo will be set to true. Debug info errors can be "recovered" from by stripping the debug info.

Parameters

NameDescription
MModule whose IR is verified.
OSOptional stream that receives a description of any error found.
BrokenDebugInfoOptional flag set to true when only debug info is broken and IR is otherwise valid.