diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-19 07:49:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-19 07:49:56 +0000 |
commit | 7043e0ab9150ebad7c071cd403a948464a995d73 (patch) | |
tree | 4ab297299463dfee3887fc22f4677c4b53bb463b /utils | |
parent | d43e4a814963ce8be3e7f3acf51b81130463321a (diff) | |
download | external_llvm-7043e0ab9150ebad7c071cd403a948464a995d73.zip external_llvm-7043e0ab9150ebad7c071cd403a948464a995d73.tar.gz external_llvm-7043e0ab9150ebad7c071cd403a948464a995d73.tar.bz2 |
add emitter support for integer constants and simple physreg references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/DAGISelMatcher.h | 2 | ||||
-rw-r--r-- | utils/TableGen/DAGISelMatcherEmitter.cpp | 17 |
2 files changed, 15 insertions, 4 deletions
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h index 7b6fbdb..0d58256 100644 --- a/utils/TableGen/DAGISelMatcher.h +++ b/utils/TableGen/DAGISelMatcher.h @@ -386,7 +386,7 @@ public: EmitIntegerMatcherNode(int64_t val, MVT::SimpleValueType vt) : MatcherNode(EmitInteger), Val(val), VT(vt) {} - int64_t getVal() const { return Val; } + int64_t getValue() const { return Val; } MVT::SimpleValueType getVT() const { return VT; } static inline bool classof(const MatcherNode *N) { diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp index 92b2a55..4b16db3 100644 --- a/utils/TableGen/DAGISelMatcherEmitter.cpp +++ b/utils/TableGen/DAGISelMatcherEmitter.cpp @@ -213,10 +213,21 @@ EmitMatcher(const MatcherNode *N, unsigned Indent) { << cast<CheckChainCompatibleMatcherNode>(N)->getPreviousOp() << ",\n"; return 2; - case MatcherNode::EmitInteger: + case MatcherNode::EmitInteger: { + int64_t Val = cast<EmitIntegerMatcherNode>(N)->getValue(); + OS << "OPC_EmitInteger" << ClassifyInt(Val) << ", " + << getEnumName(cast<EmitIntegerMatcherNode>(N)->getVT()) << ", "; + return EmitInt(Val, OS)+2; + } + case MatcherNode::EmitRegister: - // FIXME: Implement. - return 0; + OS << "OPC_EmitRegister, " + << getEnumName(cast<EmitRegisterMatcherNode>(N)->getVT()) << ", "; + if (Record *R = cast<EmitRegisterMatcherNode>(N)->getReg()) + OS << getQualifiedName(R) << ",\n"; + else + OS << "0 /*zero_reg*/,\n"; + return 3; } assert(0 && "Unreachable"); return 0; |