Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 1 | //===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. ------------===// |
| 2 | // |
| 3 | // This tablegen backend is responsible for emitting a description of the target |
| 4 | // instruction set for the code generator. |
| 5 | // |
| 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #include "InstrSelectorEmitter.h" |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 9 | #include "CodeGenWrappers.h" |
Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 10 | #include "Record.h" |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 11 | #include "Support/Debug.h" |
Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 12 | |
| 13 | NodeType::ArgResultTypes NodeType::Translate(Record *R) { |
| 14 | const std::string &Name = R->getName(); |
Chris Lattner | 38aa542 | 2003-08-06 21:47:14 +0000 | [diff] [blame] | 15 | if (Name == "DNVT_void") return Void; |
| 16 | if (Name == "DNVT_val" ) return Val; |
| 17 | if (Name == "DNVT_arg0") return Arg0; |
| 18 | if (Name == "DNVT_ptr" ) return Ptr; |
| 19 | throw "Unknown DagNodeValType '" + Name + "'!"; |
Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 20 | } |
| 21 | |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 22 | |
| 23 | //===----------------------------------------------------------------------===// |
| 24 | // TreePatternNode implementation |
| 25 | // |
| 26 | |
| 27 | // updateNodeType - Set the node type of N to VT if VT contains information. If |
| 28 | // N already contains a conflicting type, then throw an exception |
| 29 | // |
| 30 | bool TreePatternNode::updateNodeType(MVT::ValueType VT, |
| 31 | const std::string &RecName) { |
| 32 | if (VT == MVT::Other || getType() == VT) return false; |
| 33 | if (getType() == MVT::Other) { |
| 34 | setType(VT); |
| 35 | return true; |
| 36 | } |
| 37 | |
| 38 | throw "Type inferfence contradiction found for pattern " + RecName; |
| 39 | } |
| 40 | |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 41 | std::ostream &operator<<(std::ostream &OS, const TreePatternNode &N) { |
| 42 | if (N.isLeaf()) |
| 43 | return OS << N.getType() << ":" << *N.getValue(); |
| 44 | OS << "(" << N.getType() << ":"; |
| 45 | OS << N.getOperator()->getName(); |
| 46 | |
| 47 | const std::vector<TreePatternNode*> &Children = N.getChildren(); |
| 48 | if (!Children.empty()) { |
| 49 | OS << " " << *Children[0]; |
| 50 | for (unsigned i = 1, e = Children.size(); i != e; ++i) |
| 51 | OS << ", " << *Children[i]; |
| 52 | } |
| 53 | return OS << ")"; |
| 54 | } |
| 55 | void TreePatternNode::dump() const { std::cerr << *this; } |
| 56 | |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 57 | //===----------------------------------------------------------------------===// |
| 58 | // Pattern implementation |
| 59 | // |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 60 | |
| 61 | // Parse the specified DagInit into a TreePattern which we can use. |
| 62 | // |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 63 | Pattern::Pattern(PatternType pty, DagInit *RawPat, Record *TheRec, |
| 64 | InstrSelectorEmitter &ise) |
| 65 | : PTy(pty), TheRecord(TheRec), ISE(ise) { |
| 66 | |
| 67 | // First, parse the pattern... |
| 68 | Tree = ParseTreePattern(RawPat); |
| 69 | |
| 70 | bool MadeChange, AnyUnset; |
| 71 | do { |
| 72 | MadeChange = false; |
| 73 | AnyUnset = InferTypes(Tree, MadeChange); |
| 74 | } while ((AnyUnset || MadeChange) && !(AnyUnset && !MadeChange)); |
| 75 | |
Chris Lattner | b356a24 | 2003-08-07 19:21:10 +0000 | [diff] [blame] | 76 | if (PTy == Instruction || PTy == Expander) { |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 77 | // Check to make sure there is not any unset types in the tree pattern... |
| 78 | if (AnyUnset) { |
Chris Lattner | b356a24 | 2003-08-07 19:21:10 +0000 | [diff] [blame] | 79 | std::cerr << "In pattern: " << *Tree << "\n"; |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 80 | error("Could not infer all types!"); |
| 81 | } |
| 82 | |
| 83 | // Check to see if we have a top-level (set) of a register. |
| 84 | if (Tree->getOperator()->getName() == "set") { |
| 85 | assert(Tree->getChildren().size() == 2 && "Set with != 2 arguments?"); |
| 86 | if (!Tree->getChild(0)->isLeaf()) |
| 87 | error("Arg #0 of set should be a register or register class!"); |
| 88 | DefInit *RegInit = dynamic_cast<DefInit*>(Tree->getChild(0)->getValue()); |
| 89 | if (RegInit == 0) |
| 90 | error("LHS of 'set' expected to be a register or register class!"); |
| 91 | |
| 92 | Result = RegInit->getDef(); |
| 93 | Tree = Tree->getChild(1); |
| 94 | |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | Resolved = !AnyUnset; |
| 99 | } |
| 100 | |
| 101 | void Pattern::error(const std::string &Msg) { |
| 102 | std::string M = "In "; |
| 103 | switch (PTy) { |
| 104 | case Nonterminal: M += "nonterminal "; break; |
| 105 | case Instruction: M += "instruction "; break; |
| 106 | case Expander : M += "expander "; break; |
| 107 | } |
| 108 | throw M + TheRecord->getName() + ": " + Msg; |
| 109 | } |
| 110 | |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 111 | static MVT::ValueType getIntrinsicType(Record *R) { |
| 112 | // Check to see if this is a register or a register class... |
Chris Lattner | ab05e2a | 2003-08-07 19:42:14 +0000 | [diff] [blame^] | 113 | if (R->isSubClassOf("RegisterClass")) { |
| 114 | return getValueType(R->getValueAsDef("RegType")); |
| 115 | } else if (R->isSubClassOf("Register")) { |
| 116 | std::cerr << "WARNING: Explicit registers not handled yet!\n"; |
| 117 | return MVT::Other; |
| 118 | } else if (R->isSubClassOf("Nonterminal")) { |
| 119 | //std::cerr << "Warning nonterminal type not handled yet:" << R->getName() |
| 120 | // << "\n"; |
| 121 | return MVT::Other; |
| 122 | } |
| 123 | |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 124 | throw "Error: Unknown value used: " + R->getName(); |
| 125 | } |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 126 | |
| 127 | TreePatternNode *Pattern::ParseTreePattern(DagInit *DI) { |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 128 | Record *Operator = DI->getNodeType(); |
| 129 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 130 | if (!ISE.getNodeTypes().count(Operator)) |
| 131 | error("Unrecognized node '" + Operator->getName() + "'!"); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 132 | |
| 133 | const std::vector<Init*> &Args = DI->getArgs(); |
| 134 | std::vector<TreePatternNode*> Children; |
| 135 | |
| 136 | for (unsigned i = 0, e = Args.size(); i != e; ++i) { |
| 137 | Init *Arg = Args[i]; |
| 138 | if (DagInit *DI = dynamic_cast<DagInit*>(Arg)) { |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 139 | Children.push_back(ParseTreePattern(DI)); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 140 | } else if (DefInit *DI = dynamic_cast<DefInit*>(Arg)) { |
| 141 | Children.push_back(new TreePatternNode(DI)); |
| 142 | // If it's a regclass or something else known, set the type. |
| 143 | Children.back()->setType(getIntrinsicType(DI->getDef())); |
| 144 | } else { |
| 145 | Arg->dump(); |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 146 | error("Unknown leaf value for tree pattern!"); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 147 | } |
| 148 | } |
| 149 | |
| 150 | return new TreePatternNode(Operator, Children); |
| 151 | } |
| 152 | |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 153 | |
| 154 | // InferTypes - Perform type inference on the tree, returning true if there |
| 155 | // are any remaining untyped nodes and setting MadeChange if any changes were |
| 156 | // made. |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 157 | bool Pattern::InferTypes(TreePatternNode *N, bool &MadeChange) { |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 158 | if (N->isLeaf()) return N->getType() == MVT::Other; |
| 159 | |
| 160 | bool AnyUnset = false; |
| 161 | Record *Operator = N->getOperator(); |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 162 | assert(ISE.getNodeTypes().count(Operator) && "No node info for node!"); |
| 163 | const NodeType &NT = ISE.getNodeTypes()[Operator]; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 164 | |
| 165 | // Check to see if we can infer anything about the argument types from the |
| 166 | // return types... |
| 167 | const std::vector<TreePatternNode*> &Children = N->getChildren(); |
| 168 | if (Children.size() != NT.ArgTypes.size()) |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 169 | error("Incorrect number of children for " + Operator->getName() + " node!"); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 170 | |
| 171 | for (unsigned i = 0, e = Children.size(); i != e; ++i) { |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 172 | TreePatternNode *Child = Children[i]; |
| 173 | AnyUnset |= InferTypes(Child, MadeChange); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 174 | |
| 175 | switch (NT.ArgTypes[i]) { |
| 176 | case NodeType::Arg0: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 177 | MadeChange |= Child->updateNodeType(Children[0]->getType(), |
| 178 | TheRecord->getName()); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 179 | break; |
| 180 | case NodeType::Val: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 181 | if (Child->getType() == MVT::isVoid) |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 182 | error("Inferred a void node in an illegal place!"); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 183 | break; |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 184 | case NodeType::Ptr: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 185 | MadeChange |= Child->updateNodeType(ISE.getTarget().getPointerType(), |
| 186 | TheRecord->getName()); |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 187 | break; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 188 | default: assert(0 && "Invalid argument ArgType!"); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // See if we can infer anything about the return type now... |
| 193 | switch (NT.ResultType) { |
| 194 | case NodeType::Void: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 195 | MadeChange |= N->updateNodeType(MVT::isVoid, TheRecord->getName()); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 196 | break; |
| 197 | case NodeType::Arg0: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 198 | MadeChange |= N->updateNodeType(Children[0]->getType(), |
| 199 | TheRecord->getName()); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 200 | break; |
| 201 | |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 202 | case NodeType::Ptr: |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 203 | MadeChange |= N->updateNodeType(ISE.getTarget().getPointerType(), |
| 204 | TheRecord->getName()); |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 205 | break; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 206 | case NodeType::Val: |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 207 | if (N->getType() == MVT::isVoid) |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 208 | error("Inferred a void node in an illegal place!"); |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 209 | break; |
| 210 | default: |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 211 | assert(0 && "Unhandled type constraint!"); |
| 212 | break; |
| 213 | } |
| 214 | |
| 215 | return AnyUnset | N->getType() == MVT::Other; |
| 216 | } |
| 217 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 218 | std::ostream &operator<<(std::ostream &OS, const Pattern &P) { |
| 219 | switch (P.getPatternType()) { |
| 220 | case Pattern::Nonterminal: OS << "Nonterminal pattern "; break; |
| 221 | case Pattern::Instruction: OS << "Instruction pattern "; break; |
| 222 | case Pattern::Expander: OS << "Expander pattern "; break; |
| 223 | } |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 224 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 225 | OS << P.getRecord()->getName() << ":\t"; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 226 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 227 | if (Record *Result = P.getResult()) |
| 228 | OS << Result->getName() << " = "; |
| 229 | OS << *P.getTree(); |
| 230 | |
| 231 | if (!P.isResolved()) |
| 232 | OS << " [not completely resolved]"; |
| 233 | return OS; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 234 | } |
| 235 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 236 | |
Chris Lattner | 2b8b2b4 | 2003-08-07 19:28:55 +0000 | [diff] [blame] | 237 | //===----------------------------------------------------------------------===// |
| 238 | // InstrSelectorEmitter implementation |
| 239 | // |
| 240 | |
| 241 | /// ProcessNodeTypes - Process all of the node types in the current |
| 242 | /// RecordKeeper, turning them into the more accessible NodeTypes data |
| 243 | /// structure. |
| 244 | /// |
| 245 | void InstrSelectorEmitter::ProcessNodeTypes() { |
| 246 | std::vector<Record*> Nodes = Records.getAllDerivedDefinitions("DagNode"); |
| 247 | DEBUG(std::cerr << "Getting node types: "); |
| 248 | for (unsigned i = 0, e = Nodes.size(); i != e; ++i) { |
| 249 | Record *Node = Nodes[i]; |
| 250 | |
| 251 | // Translate the return type... |
| 252 | NodeType::ArgResultTypes RetTy = |
| 253 | NodeType::Translate(Node->getValueAsDef("RetType")); |
| 254 | |
| 255 | // Translate the arguments... |
| 256 | ListInit *Args = Node->getValueAsListInit("ArgTypes"); |
| 257 | std::vector<NodeType::ArgResultTypes> ArgTypes; |
| 258 | |
| 259 | for (unsigned a = 0, e = Args->getSize(); a != e; ++a) { |
| 260 | if (DefInit *DI = dynamic_cast<DefInit*>(Args->getElement(a))) |
| 261 | ArgTypes.push_back(NodeType::Translate(DI->getDef())); |
| 262 | else |
| 263 | throw "In node " + Node->getName() + ", argument is not a Def!"; |
| 264 | |
| 265 | if (a == 0 && ArgTypes.back() == NodeType::Arg0) |
| 266 | throw "In node " + Node->getName() + ", arg 0 cannot have type 'arg0'!"; |
| 267 | if (ArgTypes.back() == NodeType::Void) |
| 268 | throw "In node " + Node->getName() + ", args cannot be void type!"; |
| 269 | } |
| 270 | if (RetTy == NodeType::Arg0 && Args->getSize() == 0) |
| 271 | throw "In node " + Node->getName() + |
| 272 | ", invalid return type for nullary node!"; |
| 273 | |
| 274 | // Add the node type mapping now... |
| 275 | NodeTypes[Node] = NodeType(RetTy, ArgTypes); |
| 276 | DEBUG(std::cerr << Node->getName() << ", "); |
| 277 | } |
| 278 | DEBUG(std::cerr << "DONE!\n"); |
| 279 | } |
| 280 | |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 281 | // ProcessNonTerminals - Read in all nonterminals and incorporate them into |
| 282 | // our pattern database. |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 283 | void InstrSelectorEmitter::ProcessNonterminals() { |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 284 | std::vector<Record*> NTs = Records.getAllDerivedDefinitions("Nonterminal"); |
| 285 | for (unsigned i = 0, e = NTs.size(); i != e; ++i) { |
| 286 | DagInit *DI = NTs[i]->getValueAsDag("Pattern"); |
| 287 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 288 | Pattern *P = new Pattern(Pattern::Nonterminal, DI, NTs[i], *this); |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 289 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 290 | |
| 291 | DEBUG(std::cerr << "Parsed " << *P << "\n"); |
Chris Lattner | bc659dd | 2003-08-07 06:02:15 +0000 | [diff] [blame] | 292 | } |
| 293 | } |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 294 | |
| 295 | |
Chris Lattner | 2787d1a | 2003-08-06 06:16:35 +0000 | [diff] [blame] | 296 | /// ProcessInstructionPatterns - Read in all subclasses of Instruction, and |
| 297 | /// process those with a useful Pattern field. |
| 298 | /// |
| 299 | void InstrSelectorEmitter::ProcessInstructionPatterns() { |
| 300 | std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction"); |
| 301 | for (unsigned i = 0, e = Insts.size(); i != e; ++i) { |
| 302 | Record *Inst = Insts[i]; |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 303 | if (DagInit *DI = dynamic_cast<DagInit*>(Inst->getValueInit("Pattern"))) { |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 304 | Pattern *P = new Pattern(Pattern::Instruction, DI, Inst, *this); |
Chris Lattner | 2787d1a | 2003-08-06 06:16:35 +0000 | [diff] [blame] | 305 | |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 306 | DEBUG(std::cerr << "Parsed " << *P << "\n"); |
Chris Lattner | 2787d1a | 2003-08-06 06:16:35 +0000 | [diff] [blame] | 307 | } |
| 308 | } |
| 309 | } |
| 310 | |
Chris Lattner | b356a24 | 2003-08-07 19:21:10 +0000 | [diff] [blame] | 311 | /// ProcessExpanderPatterns - Read in all expander patterns... |
| 312 | /// |
| 313 | void InstrSelectorEmitter::ProcessExpanderPatterns() { |
| 314 | std::vector<Record*> Expanders = Records.getAllDerivedDefinitions("Expander"); |
| 315 | for (unsigned i = 0, e = Expanders.size(); i != e; ++i) { |
| 316 | Record *Expander = Expanders[i]; |
| 317 | DagInit *DI = Expanders[i]->getValueAsDag("Pattern"); |
| 318 | |
| 319 | Pattern *P = new Pattern(Pattern::Expander, DI, Expanders[i], *this); |
| 320 | |
| 321 | DEBUG(std::cerr << "Parsed " << *P << "\n"); |
| 322 | } |
| 323 | } |
| 324 | |
Chris Lattner | 2787d1a | 2003-08-06 06:16:35 +0000 | [diff] [blame] | 325 | |
Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 326 | void InstrSelectorEmitter::run(std::ostream &OS) { |
| 327 | // Type-check all of the node types to ensure we "understand" them. |
| 328 | ProcessNodeTypes(); |
| 329 | |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 330 | // Read in all of the nonterminals... |
Chris Lattner | f8e9683 | 2003-08-07 19:12:24 +0000 | [diff] [blame] | 331 | ProcessNonterminals(); |
Chris Lattner | 018c9e4 | 2003-08-07 05:40:14 +0000 | [diff] [blame] | 332 | |
Chris Lattner | 2787d1a | 2003-08-06 06:16:35 +0000 | [diff] [blame] | 333 | // Read all of the instruction patterns in... |
| 334 | ProcessInstructionPatterns(); |
| 335 | |
| 336 | // Read all of the Expander patterns in... |
Chris Lattner | b356a24 | 2003-08-07 19:21:10 +0000 | [diff] [blame] | 337 | ProcessExpanderPatterns(); |
Chris Lattner | faca5ab | 2003-08-06 05:42:05 +0000 | [diff] [blame] | 338 | } |