diff options
author | Quentin Colombet <qcolombet@apple.com> | 2017-12-18 22:12:13 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2017-12-18 22:12:13 +0000 |
commit | df42abc90b4e94413a3fa34d25c691e51421035e (patch) | |
tree | 46bebb337fb275503a83e71b781dbbdf7b2a7741 /utils | |
parent | b43be724f7c7af0e2adec9649728d414b0ea0b2b (diff) |
[TableGen][GlobalISel] Make the arguments of the Instruction and Operand Matchers consistent
Move InsnVarID and OpIdx at the beginning of the list of arguments
for all the constructors of the OperandMatcher subclasses.
This matches what we do for the InstructionMatcher.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321031 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/GlobalISelEmitter.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/utils/TableGen/GlobalISelEmitter.cpp b/utils/TableGen/GlobalISelEmitter.cpp index bf6a5fe8aae..d7f87eac8d4 100644 --- a/utils/TableGen/GlobalISelEmitter.cpp +++ b/utils/TableGen/GlobalISelEmitter.cpp @@ -931,7 +931,7 @@ class SameOperandMatcher : public OperandPredicateMatcher { std::string MatchingName; public: - SameOperandMatcher(StringRef MatchingName, unsigned InsnVarID, unsigned OpIdx) + SameOperandMatcher(unsigned InsnVarID, unsigned OpIdx, StringRef MatchingName) : OperandPredicateMatcher(OPM_SameOperand, InsnVarID, OpIdx), MatchingName(MatchingName) {} @@ -951,7 +951,7 @@ protected: public: static std::set<LLTCodeGen> KnownTypes; - LLTOperandMatcher(const LLTCodeGen &Ty, unsigned InsnVarID, unsigned OpIdx) + LLTOperandMatcher(unsigned InsnVarID, unsigned OpIdx, const LLTCodeGen &Ty) : OperandPredicateMatcher(OPM_LLT, InsnVarID, OpIdx), Ty(Ty) { KnownTypes.insert(Ty); } @@ -991,8 +991,8 @@ protected: unsigned SizeInBits; public: - PointerToAnyOperandMatcher(unsigned SizeInBits, unsigned InsnVarID, - unsigned OpIdx) + PointerToAnyOperandMatcher(unsigned InsnVarID, unsigned OpIdx, + unsigned SizeInBits) : OperandPredicateMatcher(OPM_PointerToAny, InsnVarID, OpIdx), SizeInBits(SizeInBits) {} @@ -1021,9 +1021,9 @@ protected: public: bool isIdentical(const PredicateMatcher &B) const override { return false; } - ComplexPatternOperandMatcher(const OperandMatcher &Operand, - const Record &TheDef, unsigned InsnVarID, - unsigned OpIdx) + ComplexPatternOperandMatcher(unsigned InsnVarID, unsigned OpIdx, + const OperandMatcher &Operand, + const Record &TheDef) : OperandPredicateMatcher(OPM_ComplexPattern, InsnVarID, OpIdx), Operand(Operand), TheDef(TheDef) {} @@ -1053,8 +1053,8 @@ protected: const CodeGenRegisterClass &RC; public: - RegisterBankOperandMatcher(const CodeGenRegisterClass &RC, unsigned InsnVarID, - unsigned OpIdx) + RegisterBankOperandMatcher(unsigned InsnVarID, unsigned OpIdx, + const CodeGenRegisterClass &RC) : OperandPredicateMatcher(OPM_RegBank, InsnVarID, OpIdx), RC(RC) {} bool isIdentical(const PredicateMatcher &B) const override { @@ -1102,7 +1102,7 @@ protected: int64_t Value; public: - ConstantIntOperandMatcher(int64_t Value, unsigned InsnVarID, unsigned OpIdx) + ConstantIntOperandMatcher(unsigned InsnVarID, unsigned OpIdx, int64_t Value) : OperandPredicateMatcher(OPM_Int, InsnVarID, OpIdx), Value(Value) {} bool isIdentical(const PredicateMatcher &B) const override { @@ -1130,7 +1130,7 @@ protected: int64_t Value; public: - LiteralIntOperandMatcher(int64_t Value, unsigned InsnVarID, unsigned OpIdx) + LiteralIntOperandMatcher(unsigned InsnVarID, unsigned OpIdx, int64_t Value) : OperandPredicateMatcher(OPM_LiteralInt, InsnVarID, OpIdx), Value(Value) {} @@ -1158,8 +1158,8 @@ protected: const CodeGenIntrinsic *II; public: - IntrinsicIDOperandMatcher(const CodeGenIntrinsic *II, unsigned InsnVarID, - unsigned OpIdx) + IntrinsicIDOperandMatcher(unsigned InsnVarID, unsigned OpIdx, + const CodeGenIntrinsic *II) : OperandPredicateMatcher(OPM_IntrinsicID, InsnVarID, OpIdx), II(II) {} bool isIdentical(const PredicateMatcher &B) const override { @@ -1294,9 +1294,9 @@ PredicateListMatcher<OperandPredicateMatcher>::addPredicate(Args &&... args) { auto *OpMatcher = static_cast<OperandMatcher *>(this); if (static_cast<OperandMatcher *>(this)->isSameAsAnotherOperand()) return None; - Predicates.emplace_back(llvm::make_unique<Kind>( - std::forward<Args>(args)..., OpMatcher->getInsnVarID(), - OpMatcher->getOperandIndex())); + Predicates.emplace_back(llvm::make_unique<Kind>(OpMatcher->getInsnVarID(), + OpMatcher->getOperandIndex(), + std::forward<Args>(args)...)); return static_cast<Kind *>(Predicates.back().get()); } @@ -1668,8 +1668,8 @@ protected: std::unique_ptr<InstructionMatcher> InsnMatcher; public: - InstructionOperandMatcher(RuleMatcher &Rule, StringRef SymbolicName, - unsigned InsnVarID, unsigned OpIdx) + InstructionOperandMatcher(unsigned InsnVarID, unsigned OpIdx, + RuleMatcher &Rule, StringRef SymbolicName) : OperandPredicateMatcher(OPM_Instruction, InsnVarID, OpIdx), InsnMatcher(new InstructionMatcher(Rule, SymbolicName)) {} |