Mercurial > hg > CbC > CbC_llvm
comparison utils/TableGen/DisassemblerEmitter.cpp @ 120:1172e4bd9c6f
update 4.0.0
author | mir3636 |
---|---|
date | Fri, 25 Nov 2016 19:14:25 +0900 |
parents | afa8332a0e37 |
children | 803732b1fca8 |
comparison
equal
deleted
inserted
replaced
101:34baf5011add | 120:1172e4bd9c6f |
---|---|
94 /// instruction. | 94 /// instruction. |
95 | 95 |
96 namespace llvm { | 96 namespace llvm { |
97 | 97 |
98 extern void EmitFixedLenDecoder(RecordKeeper &RK, raw_ostream &OS, | 98 extern void EmitFixedLenDecoder(RecordKeeper &RK, raw_ostream &OS, |
99 std::string PredicateNamespace, | 99 const std::string &PredicateNamespace, |
100 std::string GPrefix, | 100 const std::string &GPrefix, |
101 std::string GPostfix, | 101 const std::string &GPostfix, |
102 std::string ROK, | 102 const std::string &ROK, |
103 std::string RFail, | 103 const std::string &RFail, const std::string &L); |
104 std::string L); | |
105 | 104 |
106 void EmitDisassembler(RecordKeeper &Records, raw_ostream &OS) { | 105 void EmitDisassembler(RecordKeeper &Records, raw_ostream &OS) { |
107 CodeGenTarget Target(Records); | 106 CodeGenTarget Target(Records); |
108 emitSourceFileHeader(" * " + Target.getName() + " Disassembler", OS); | 107 emitSourceFileHeader(" * " + Target.getName() + " Disassembler", OS); |
109 | 108 |
110 // X86 uses a custom disassembler. | 109 // X86 uses a custom disassembler. |
111 if (Target.getName() == "X86") { | 110 if (Target.getName() == "X86") { |
112 DisassemblerTables Tables; | 111 DisassemblerTables Tables; |
113 | 112 |
114 const std::vector<const CodeGenInstruction*> &numberedInstructions = | 113 ArrayRef<const CodeGenInstruction*> numberedInstructions = |
115 Target.getInstructionsByEnumValue(); | 114 Target.getInstructionsByEnumValue(); |
116 | 115 |
117 for (unsigned i = 0, e = numberedInstructions.size(); i != e; ++i) | 116 for (unsigned i = 0, e = numberedInstructions.size(); i != e; ++i) |
118 RecognizableInstr::processInstr(Tables, *numberedInstructions[i], i); | 117 RecognizableInstr::processInstr(Tables, *numberedInstructions[i], i); |
119 | 118 |