[llvm] r214587 - verify-uselistorder: Make the verification logic easier to reuse
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Aug 1 15:52:07 PDT 2014
Author: dexonsmith
Date: Fri Aug 1 17:52:06 2014
New Revision: 214587
URL: http://llvm.org/viewvc/llvm-project?rev=214587&view=rev
Log:
verify-uselistorder: Make the verification logic easier to reuse
Modified:
llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
Modified: llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp?rev=214587&r1=214586&r2=214587&view=diff
==============================================================================
--- llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp (original)
+++ llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp Fri Aug 1 17:52:06 2014
@@ -359,6 +359,15 @@ static bool verifyAssemblyUseListOrder(c
return matches(ValueMapping(M), ValueMapping(*OtherM));
}
+static void verifyUseListOrder(const Module &M) {
+ if (!verifyBitcodeUseListOrder(M))
+ report_fatal_error("bitcode use-list order changed");
+
+ if (shouldPreserveAssemblyUseListOrder())
+ if (!verifyAssemblyUseListOrder(M))
+ report_fatal_error("assembly use-list order changed");
+}
+
int main(int argc, char **argv) {
sys::PrintStackTraceOnErrorSignal();
llvm::PrettyStackTraceProgram X(argc, argv);
@@ -397,12 +406,7 @@ int main(int argc, char **argv) {
// Shuffle with a different seed each time so that use-lists that aren't
// modified the first time are likely to be modified the next time.
shuffleUseLists(*M, I);
- if (!verifyBitcodeUseListOrder(*M))
- report_fatal_error("bitcode use-list order changed");
-
- if (shouldPreserveAssemblyUseListOrder())
- if (!verifyAssemblyUseListOrder(*M))
- report_fatal_error("assembly use-list order changed");
+ verifyUseListOrder(*M);
}
return 0;
More information about the llvm-commits
mailing list