summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/GlobalISelEmitter.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2017-04-04 14:27:06 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2017-04-04 14:27:06 +0000
commit9e4817d49e2baf2310c31db56cf203a9e2e66181 (patch)
tree253f7c6268a5bcea7ac004c39844150c656f283a /llvm/utils/TableGen/GlobalISelEmitter.cpp
parent4cc78d7008ab6b8a7b09d01881e1d24aa8958c6d (diff)
downloadbcm5719-llvm-9e4817d49e2baf2310c31db56cf203a9e2e66181.tar.gz
bcm5719-llvm-9e4817d49e2baf2310c31db56cf203a9e2e66181.zip
[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
Diffstat (limited to 'llvm/utils/TableGen/GlobalISelEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/GlobalISelEmitter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index f581c889234..a2d1b1cbc91 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -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 << "}";
}
OpenPOWER on IntegriCloud