[IPO/MergeFunctions] This function is used only under DEBUG().

llvm-svn: 301672
This commit is contained in:
Davide Italiano 2017-04-28 19:39:45 +00:00
parent 99351967c7
commit b6681e2b4e
1 changed files with 4 additions and 0 deletions

View File

@ -211,7 +211,9 @@ private:
/// Checks the rules of order relation introduced among functions set. /// Checks the rules of order relation introduced among functions set.
/// Returns true, if sanity check has been passed, and false if failed. /// Returns true, if sanity check has been passed, and false if failed.
#ifndef NDEBUG
bool doSanityCheck(std::vector<WeakVH> &Worklist); bool doSanityCheck(std::vector<WeakVH> &Worklist);
#endif
/// Insert a ComparableFunction into the FnTree, or merge it away if it's /// Insert a ComparableFunction into the FnTree, or merge it away if it's
/// equal to one that's already present. /// equal to one that's already present.
@ -283,6 +285,7 @@ ModulePass *llvm::createMergeFunctionsPass() {
return new MergeFunctions(); return new MergeFunctions();
} }
#ifndef NDEBUG
bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) { bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
if (const unsigned Max = NumFunctionsForSanityCheck) { if (const unsigned Max = NumFunctionsForSanityCheck) {
unsigned TripleNumber = 0; unsigned TripleNumber = 0;
@ -351,6 +354,7 @@ bool MergeFunctions::doSanityCheck(std::vector<WeakVH> &Worklist) {
} }
return true; return true;
} }
#endif
bool MergeFunctions::runOnModule(Module &M) { bool MergeFunctions::runOnModule(Module &M) {
if (skipModule(M)) if (skipModule(M))