diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp --- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp +++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp @@ -136,10 +136,10 @@ STATISTIC(NumAliasesWritten, "Number of aliases generated"); STATISTIC(NumDoubleWeak, "Number of new functions created"); -static cl::opt NumFunctionsForSanityCheck( - "mergefunc-sanity", - cl::desc("How many functions in module could be used for " - "MergeFunctions pass sanity check. " +static cl::opt NumFunctionsForVerificationCheck( + "mergefunc-verify", + cl::desc("How many functions in a module could be used for " + "MergeFunctions to pass a basic correctness check. " "'0' disables this check. Works only with '-debug' key."), cl::init(0), cl::Hidden); @@ -227,8 +227,8 @@ #ifndef NDEBUG /// Checks the rules of order relation introduced among functions set. - /// Returns true, if sanity check has been passed, and false if failed. - bool doSanityCheck(std::vector &Worklist); + /// Returns true, if check has been passed, and false if failed. + bool doFunctionalCheck(std::vector &Worklist); #endif /// Insert a ComparableFunction into the FnTree, or merge it away if it's @@ -327,12 +327,12 @@ } #ifndef NDEBUG -bool MergeFunctions::doSanityCheck(std::vector &Worklist) { - if (const unsigned Max = NumFunctionsForSanityCheck) { +bool MergeFunctions::doFunctionalCheck(std::vector &Worklist) { + if (const unsigned Max = NumFunctionsForVerificationCheck) { unsigned TripleNumber = 0; bool Valid = true; - dbgs() << "MERGEFUNC-SANITY: Started for first " << Max << " functions.\n"; + dbgs() << "MERGEFUNC-VERIFY: Started for first " << Max << " functions.\n"; unsigned i = 0; for (std::vector::iterator I = Worklist.begin(), @@ -348,7 +348,7 @@ // If F1 <= F2, then F2 >= F1, otherwise report failure. if (Res1 != -Res2) { - dbgs() << "MERGEFUNC-SANITY: Non-symmetric; triple: " << TripleNumber + dbgs() << "MERGEFUNC-VERIFY: Non-symmetric; triple: " << TripleNumber << "\n"; dbgs() << *F1 << '\n' << *F2 << '\n'; Valid = false; @@ -381,7 +381,7 @@ } if (!Transitive) { - dbgs() << "MERGEFUNC-SANITY: Non-transitive; triple: " + dbgs() << "MERGEFUNC-VERIFY: Non-transitive; triple: " << TripleNumber << "\n"; dbgs() << "Res1, Res3, Res4: " << Res1 << ", " << Res3 << ", " << Res4 << "\n"; @@ -392,7 +392,7 @@ } } - dbgs() << "MERGEFUNC-SANITY: " << (Valid ? "Passed." : "Failed.") << "\n"; + dbgs() << "MERGEFUNC-VERIFY: " << (Valid ? "Passed." : "Failed.") << "\n"; return Valid; } return true; @@ -433,7 +433,7 @@ std::vector Worklist; Deferred.swap(Worklist); - LLVM_DEBUG(doSanityCheck(Worklist)); + LLVM_DEBUG(doFunctionalCheck(Worklist)); LLVM_DEBUG(dbgs() << "size of module: " << M.size() << '\n'); LLVM_DEBUG(dbgs() << "size of worklist: " << Worklist.size() << '\n');