|
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 |
|
9 | 9 | #include "DecoderTableEmitter.h" |
10 | | -#include "Common/CodeGenInstruction.h" |
11 | | -#include "Common/InstructionEncoding.h" |
| 10 | +#include "llvm/ADT/StringExtras.h" |
12 | 11 | #include "llvm/Support/Format.h" |
13 | 12 | #include "llvm/Support/LEB128.h" |
14 | 13 |
|
@@ -77,10 +76,8 @@ DecoderTableEmitter::computeNodeSize(const DecoderTreeNode *Node) const { |
77 | 76 | } |
78 | 77 | case DecoderTreeNode::Decode: { |
79 | 78 | const auto *N = static_cast<const DecodeNode *>(Node); |
80 | | - unsigned InstOpcode = N->getEncoding().getInstruction()->EnumVal; |
81 | | - unsigned DecoderIndex = N->getDecoderIndex(); |
82 | | - return OpcodeSize + getULEB128Size(InstOpcode) + |
83 | | - getULEB128Size(DecoderIndex); |
| 79 | + return OpcodeSize + getULEB128Size(N->getInstOpcode()) + |
| 80 | + getULEB128Size(N->getDecoderIndex()); |
84 | 81 | } |
85 | 82 | } |
86 | 83 | llvm_unreachable("Unknown node kind"); |
@@ -267,15 +264,15 @@ void DecoderTableEmitter::emitSoftFailNode(const SoftFailNode *N, |
267 | 264 | } |
268 | 265 |
|
269 | 266 | void DecoderTableEmitter::emitDecodeNode(const DecodeNode *N, indent Indent) { |
270 | | - const InstructionEncoding &Encoding = N->getEncoding(); |
271 | | - unsigned InstOpcode = Encoding.getInstruction()->EnumVal; |
| 267 | + StringRef EncodingName = N->getEncodingName(); |
| 268 | + unsigned InstOpcode = N->getInstOpcode(); |
272 | 269 | unsigned DecoderIndex = N->getDecoderIndex(); |
273 | 270 |
|
274 | 271 | emitOpcode("OPC_Decode"); |
275 | 272 | emitULEB128(InstOpcode); |
276 | 273 | emitULEB128(DecoderIndex); |
277 | 274 |
|
278 | | - emitComment(Indent) << "decode to " << Encoding.getName() << " using decoder " |
| 275 | + emitComment(Indent) << "decode to " << EncodingName << " using decoder " |
279 | 276 | << DecoderIndex << '\n'; |
280 | 277 | } |
281 | 278 |
|
|
0 commit comments