Insert dynamic checks only if the appropriate

checker functions exist.

llvm-svn: 157652
This commit is contained in:
Sean Callanan 2012-05-29 23:46:46 +00:00
parent 850ef99516
commit 53bacf2130
1 changed files with 21 additions and 15 deletions

View File

@ -611,22 +611,28 @@ IRDynamicChecks::runOnModule(llvm::Module &M)
return false; return false;
} }
ValidPointerChecker vpc(M, m_checker_functions); if (m_checker_functions.m_valid_pointer_check.get())
{
ValidPointerChecker vpc(M, m_checker_functions);
if (!vpc.Inspect(*function))
return false;
if (!vpc.Instrument())
return false;
}
if (!vpc.Inspect(*function)) if (m_checker_functions.m_objc_object_check.get())
return false; {
ObjcObjectChecker ooc(M, m_checker_functions);
if (!vpc.Instrument())
return false; if (!ooc.Inspect(*function))
return false;
ObjcObjectChecker ooc(M, m_checker_functions);
if (!ooc.Instrument())
if (!ooc.Inspect(*function)) return false;
return false; }
if (!ooc.Instrument())
return false;
if (log && log->GetVerbose()) if (log && log->GetVerbose())
{ {
std::string s; std::string s;