1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

[globalisel][tablegen] Fix non-determinism introduced in r299430.

This should fix the last issue on llvm-clang-x86_64-expensive-checks-win.

llvm-svn: 299436
This commit is contained in:
Daniel Sanders 2017-04-04 14:27:06 +00:00
parent 82d428e6c5
commit a5960566d5

View File

@ -1011,9 +1011,14 @@ StringRef RuleMatcher::getInsnVarName(const InstructionMatcher &InsnMatcher) con
/// Emit a C++ initializer_list containing references to every matched instruction.
void RuleMatcher::emitCxxCapturedInsnList(raw_ostream &OS) {
OS << "{";
SmallVector<StringRef, 2> Names;
for (const auto &Pair : InsnVariableNames)
OS << "&" << Pair.second << ", ";
Names.push_back(Pair.second);
std::sort(Names.begin(), Names.end());
OS << "{";
for (const auto &Name : Names)
OS << "&" << Name << ", ";
OS << "}";
}