mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
Iterate deterministicaly over ClassInfo*'s
Fixes an observed instance of nondeterministic TableGen output. Review by Jakob. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164191 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -279,6 +279,15 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
/// Sort ClassInfo pointers independently of pointer value.
|
||||||
|
struct LessClassInfoPtr {
|
||||||
|
bool operator()(const ClassInfo *LHS, const ClassInfo *RHS) const {
|
||||||
|
return *LHS < *RHS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/// MatchableInfo - Helper class for storing the necessary information for an
|
/// MatchableInfo - Helper class for storing the necessary information for an
|
||||||
/// instruction or alias which is capable of being matched.
|
/// instruction or alias which is capable of being matched.
|
||||||
struct MatchableInfo {
|
struct MatchableInfo {
|
||||||
@ -1240,7 +1249,8 @@ void AsmMatcherInfo::buildOperandMatchInfo() {
|
|||||||
|
|
||||||
/// Map containing a mask with all operands indices that can be found for
|
/// Map containing a mask with all operands indices that can be found for
|
||||||
/// that class inside a instruction.
|
/// that class inside a instruction.
|
||||||
std::map<ClassInfo*, unsigned> OpClassMask;
|
typedef std::map<ClassInfo*, unsigned, LessClassInfoPtr> OpClassMaskTy;
|
||||||
|
OpClassMaskTy OpClassMask;
|
||||||
|
|
||||||
for (std::vector<MatchableInfo*>::const_iterator it =
|
for (std::vector<MatchableInfo*>::const_iterator it =
|
||||||
Matchables.begin(), ie = Matchables.end();
|
Matchables.begin(), ie = Matchables.end();
|
||||||
@ -1259,7 +1269,7 @@ void AsmMatcherInfo::buildOperandMatchInfo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate operand match info for each mnemonic/operand class pair.
|
// Generate operand match info for each mnemonic/operand class pair.
|
||||||
for (std::map<ClassInfo*, unsigned>::iterator iit = OpClassMask.begin(),
|
for (OpClassMaskTy::iterator iit = OpClassMask.begin(),
|
||||||
iie = OpClassMask.end(); iit != iie; ++iit) {
|
iie = OpClassMask.end(); iit != iie; ++iit) {
|
||||||
unsigned OpMask = iit->second;
|
unsigned OpMask = iit->second;
|
||||||
ClassInfo *CI = iit->first;
|
ClassInfo *CI = iit->first;
|
||||||
|
Reference in New Issue
Block a user