mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
verify-uselistorder: Make the verification logic easier to reuse
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214587 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4a6fa1390a
commit
236c1ac873
@ -359,6 +359,15 @@ static bool verifyAssemblyUseListOrder(const Module &M) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user