[PATCH] D113168: [clang-tblgen] Fix non-determinism in generating AttrSubMatchRulesParserStringSwitches.inc
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 3 22:53:35 PDT 2021
ikudrin created this revision.
ikudrin added reviewers: arphaman, aaron.ballman, rsmith.
Herald added a subscriber: mgrang.
ikudrin requested review of this revision.
Herald added a project: clang.
`llvm::MapVector`, compared to `std::map`, guarantees the same iteration order in different runs.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113168
Files:
clang/utils/TableGen/ClangAttrEmitter.cpp
Index: clang/utils/TableGen/ClangAttrEmitter.cpp
===================================================================
--- clang/utils/TableGen/ClangAttrEmitter.cpp
+++ clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
+#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
@@ -2043,7 +2044,7 @@
OS << " return None;\n";
OS << "}\n\n";
- std::map<const Record *, std::vector<AttributeSubjectMatchRule>>
+ llvm::MapVector<const Record *, std::vector<AttributeSubjectMatchRule>>
SubMatchRules;
for (const auto &Rule : Rules) {
if (!Rule.isSubRule())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113168.384667.patch
Type: text/x-patch
Size: 760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211104/30214c7b/attachment.bin>
More information about the llvm-commits
mailing list