Lines Matching refs:Module
1 //===-- Verifier.cpp - Implement the Module Verifier -----------------------==//
65 #include "llvm/IR/Module.h"
111 report_fatal_error("Broken module, no Basic Block terminator!");
119 INITIALIZE_PASS(PreVerifier, "preverify", "Preliminary module verification",
126 bool Broken; // Is this module found to be broken?
129 Module *Mod; // Module we are verifying right now
152 /// Finder keeps track of all debug info MDNodes in a Module.
167 bool doInitialization(Module &M) {
175 // pass manager may try to run other passes on the broken module.
191 // pass manager may try to run other passes on the broken module.
195 bool doFinalization(Module &M) {
197 for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
204 for (Module::global_iterator I = M.global_begin(), E = M.global_end();
208 for (Module::alias_iterator I = M.alias_begin(), E = M.alias_end();
212 for (Module::named_metadata_iterator I = M.named_metadata_begin(),
221 // If the module is broken, abort at this time.
231 /// abortIfBroken - If the module is broken and we are supposed to abort on
236 MessagesStr << "Broken module found, ";
261 void visitModuleFlags(Module &M);
331 void verifyDebugInfo(Module &M);
384 INITIALIZE_PASS_BEGIN(Verifier, "verify", "Module Verifier", false, false)
387 INITIALIZE_PASS_END(Verifier, "verify", "Module Verifier", false, false)
615 void Verifier::visitModuleFlags(Module &M) {
626 // Validate that the requirements in the module are valid.
634 CheckFailed("invalid requirement on flag, flag is not present in module",
650 // Each module flag should have three arguments, the merge behavior (a
653 "incorrect number of operands in module flag", Op);
657 "invalid behavior operand in module flag (expected constant integer)",
661 "invalid ID operand in module flag (expected metadata string)",
668 "invalid behavior operand in module flag (unexpected constant)",
672 case Module::Error:
673 case Module::Warning:
674 case Module::Override:
678 case Module::Require: {
683 "invalid value for 'require' module flag (expected metadata pair)",
686 ("invalid value for 'require' module flag "
690 // Append it to the list of requirements, to check once all module flags are
696 case Module::Append:
697 case Module::AppendUnique: {
700 "invalid value for 'append'-type module flag "
707 if (BehaviorValue != Module::Require) {
710 "module flag identifiers must be unique (or of 'require' type)",
970 "Function context does not match Module context!", &F);
2041 Assert1(F->getParent() == Mod, "Referencing function in another module!",
2050 Assert1(GV->getParent() == Mod, "Referencing global in another module!",
2312 void Verifier::verifyDebugInfo(Module &M) {
2359 /// verifyModule - Check a module for errors, printing messages on stderr.
2360 /// Return true if the module is corrupt.
2362 bool llvm::verifyModule(const Module &M, VerifierFailureAction action,
2367 PM.run(const_cast<Module&>(M));