1 //===- AsmWriterEmitter.cpp - Generate an assembly writer -----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This tablegen backend is emits an assembly printer for the current target.
11 // Note that this is currently fairly skeletal, but will grow over time.
13 //===----------------------------------------------------------------------===//
15 #include "AsmWriterEmitter.h"
16 #include "CodeGenTarget.h"
18 #include "llvm/ADT/StringExtras.h"
19 #include "llvm/Support/Debug.h"
20 #include "llvm/Support/MathExtras.h"
24 static bool isIdentChar(char C) {
25 return (C >= 'a' && C <= 'z') ||
26 (C >= 'A' && C <= 'Z') ||
27 (C >= '0' && C <= '9') ||
31 // This should be an anon namespace, this works around a GCC warning.
33 struct AsmWriterOperand {
34 enum { isLiteralTextOperand, isMachineInstrOperand } OperandType;
36 /// Str - For isLiteralTextOperand, this IS the literal text. For
37 /// isMachineInstrOperand, this is the PrinterMethodName for the operand.
40 /// MiOpNo - For isMachineInstrOperand, this is the operand number of the
41 /// machine instruction.
44 /// MiModifier - For isMachineInstrOperand, this is the modifier string for
45 /// an operand, specified with syntax like ${opname:modifier}.
46 std::string MiModifier;
48 AsmWriterOperand(const std::string &LitStr)
49 : OperandType(isLiteralTextOperand), Str(LitStr) {}
51 AsmWriterOperand(const std::string &Printer, unsigned OpNo,
52 const std::string &Modifier)
53 : OperandType(isMachineInstrOperand), Str(Printer), MIOpNo(OpNo),
54 MiModifier(Modifier) {}
56 bool operator!=(const AsmWriterOperand &Other) const {
57 if (OperandType != Other.OperandType || Str != Other.Str) return true;
58 if (OperandType == isMachineInstrOperand)
59 return MIOpNo != Other.MIOpNo || MiModifier != Other.MiModifier;
62 bool operator==(const AsmWriterOperand &Other) const {
63 return !operator!=(Other);
66 /// getCode - Return the code that prints this operand.
67 std::string getCode() const;
74 std::vector<AsmWriterOperand> Operands;
75 const CodeGenInstruction *CGI;
77 AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant);
79 /// MatchesAllButOneOp - If this instruction is exactly identical to the
80 /// specified instruction except for one differing operand, return the
81 /// differing operand number. Otherwise return ~0.
82 unsigned MatchesAllButOneOp(const AsmWriterInst &Other) const;
85 void AddLiteralString(const std::string &Str) {
86 // If the last operand was already a literal text string, append this to
87 // it, otherwise add a new operand.
88 if (!Operands.empty() &&
89 Operands.back().OperandType == AsmWriterOperand::isLiteralTextOperand)
90 Operands.back().Str.append(Str);
92 Operands.push_back(AsmWriterOperand(Str));
98 std::string AsmWriterOperand::getCode() const {
99 if (OperandType == isLiteralTextOperand)
100 return "O << \"" + Str + "\"; ";
102 std::string Result = Str + "(MI";
104 Result += ", " + utostr(MIOpNo);
105 if (!MiModifier.empty())
106 Result += ", \"" + MiModifier + '"';
107 return Result + "); ";
111 /// ParseAsmString - Parse the specified Instruction's AsmString into this
114 AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
116 unsigned CurVariant = ~0U; // ~0 if we are outside a {.|.|.} region, other #.
118 // NOTE: Any extensions to this code need to be mirrored in the
119 // AsmPrinter::printInlineAsm code that executes as compile time (assuming
120 // that inline asm strings should also get the new feature)!
121 const std::string &AsmString = CGI.AsmString;
122 std::string::size_type LastEmitted = 0;
123 while (LastEmitted != AsmString.size()) {
124 std::string::size_type DollarPos =
125 AsmString.find_first_of("${|}", LastEmitted);
126 if (DollarPos == std::string::npos) DollarPos = AsmString.size();
128 // Emit a constant string fragment.
129 if (DollarPos != LastEmitted) {
130 // TODO: this should eventually handle escaping.
131 if (CurVariant == Variant || CurVariant == ~0U)
132 AddLiteralString(std::string(AsmString.begin()+LastEmitted,
133 AsmString.begin()+DollarPos));
134 LastEmitted = DollarPos;
135 } else if (AsmString[DollarPos] == '{') {
136 if (CurVariant != ~0U)
137 throw "Nested variants found for instruction '" +
138 CGI.TheDef->getName() + "'!";
139 LastEmitted = DollarPos+1;
140 CurVariant = 0; // We are now inside of the variant!
141 } else if (AsmString[DollarPos] == '|') {
142 if (CurVariant == ~0U)
143 throw "'|' character found outside of a variant in instruction '"
144 + CGI.TheDef->getName() + "'!";
147 } else if (AsmString[DollarPos] == '}') {
148 if (CurVariant == ~0U)
149 throw "'}' character found outside of a variant in instruction '"
150 + CGI.TheDef->getName() + "'!";
153 } else if (DollarPos+1 != AsmString.size() &&
154 AsmString[DollarPos+1] == '$') {
155 if (CurVariant == Variant || CurVariant == ~0U)
156 AddLiteralString("$"); // "$$" -> $
157 LastEmitted = DollarPos+2;
159 // Get the name of the variable.
160 std::string::size_type VarEnd = DollarPos+1;
162 // handle ${foo}bar as $foo by detecting whether the character following
163 // the dollar sign is a curly brace. If so, advance VarEnd and DollarPos
164 // so the variable name does not contain the leading curly brace.
165 bool hasCurlyBraces = false;
166 if (VarEnd < AsmString.size() && '{' == AsmString[VarEnd]) {
167 hasCurlyBraces = true;
172 while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
174 std::string VarName(AsmString.begin()+DollarPos+1,
175 AsmString.begin()+VarEnd);
177 // Modifier - Support ${foo:modifier} syntax, where "modifier" is passed
178 // into printOperand. Also support ${:feature}, which is passed into
180 std::string Modifier;
182 // In order to avoid starting the next string at the terminating curly
183 // brace, advance the end position past it if we found an opening curly
185 if (hasCurlyBraces) {
186 if (VarEnd >= AsmString.size())
187 throw "Reached end of string before terminating curly brace in '"
188 + CGI.TheDef->getName() + "'";
190 // Look for a modifier string.
191 if (AsmString[VarEnd] == ':') {
193 if (VarEnd >= AsmString.size())
194 throw "Reached end of string before terminating curly brace in '"
195 + CGI.TheDef->getName() + "'";
197 unsigned ModifierStart = VarEnd;
198 while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
200 Modifier = std::string(AsmString.begin()+ModifierStart,
201 AsmString.begin()+VarEnd);
202 if (Modifier.empty())
203 throw "Bad operand modifier name in '"+ CGI.TheDef->getName() + "'";
206 if (AsmString[VarEnd] != '}')
207 throw "Variable name beginning with '{' did not end with '}' in '"
208 + CGI.TheDef->getName() + "'";
211 if (VarName.empty() && Modifier.empty())
212 throw "Stray '$' in '" + CGI.TheDef->getName() +
213 "' asm string, maybe you want $$?";
215 if (VarName.empty()) {
216 // Just a modifier, pass this into PrintSpecial.
217 Operands.push_back(AsmWriterOperand("PrintSpecial", ~0U, Modifier));
219 // Otherwise, normal operand.
220 unsigned OpNo = CGI.getOperandNamed(VarName);
221 CodeGenInstruction::OperandInfo OpInfo = CGI.OperandList[OpNo];
223 if (CurVariant == Variant || CurVariant == ~0U) {
224 unsigned MIOp = OpInfo.MIOperandNo;
225 Operands.push_back(AsmWriterOperand(OpInfo.PrinterMethodName, MIOp,
229 LastEmitted = VarEnd;
233 AddLiteralString("\\n");
236 /// MatchesAllButOneOp - If this instruction is exactly identical to the
237 /// specified instruction except for one differing operand, return the differing
238 /// operand number. If more than one operand mismatches, return ~1, otherwise
239 /// if the instructions are identical return ~0.
240 unsigned AsmWriterInst::MatchesAllButOneOp(const AsmWriterInst &Other)const{
241 if (Operands.size() != Other.Operands.size()) return ~1;
243 unsigned MismatchOperand = ~0U;
244 for (unsigned i = 0, e = Operands.size(); i != e; ++i) {
245 if (Operands[i] != Other.Operands[i])
246 if (MismatchOperand != ~0U) // Already have one mismatch?
251 return MismatchOperand;
254 static void PrintCases(std::vector<std::pair<std::string,
255 AsmWriterOperand> > &OpsToPrint, std::ostream &O) {
256 O << " case " << OpsToPrint.back().first << ": ";
257 AsmWriterOperand TheOp = OpsToPrint.back().second;
258 OpsToPrint.pop_back();
260 // Check to see if any other operands are identical in this list, and if so,
261 // emit a case label for them.
262 for (unsigned i = OpsToPrint.size(); i != 0; --i)
263 if (OpsToPrint[i-1].second == TheOp) {
264 O << "\n case " << OpsToPrint[i-1].first << ": ";
265 OpsToPrint.erase(OpsToPrint.begin()+i-1);
268 // Finally, emit the code.
269 O << TheOp.getCode();
274 /// EmitInstructions - Emit the last instruction in the vector and any other
275 /// instructions that are suitably similar to it.
276 static void EmitInstructions(std::vector<AsmWriterInst> &Insts,
278 AsmWriterInst FirstInst = Insts.back();
281 std::vector<AsmWriterInst> SimilarInsts;
282 unsigned DifferingOperand = ~0;
283 for (unsigned i = Insts.size(); i != 0; --i) {
284 unsigned DiffOp = Insts[i-1].MatchesAllButOneOp(FirstInst);
286 if (DifferingOperand == ~0U) // First match!
287 DifferingOperand = DiffOp;
289 // If this differs in the same operand as the rest of the instructions in
290 // this class, move it to the SimilarInsts list.
291 if (DifferingOperand == DiffOp || DiffOp == ~0U) {
292 SimilarInsts.push_back(Insts[i-1]);
293 Insts.erase(Insts.begin()+i-1);
298 O << " case " << FirstInst.CGI->Namespace << "::"
299 << FirstInst.CGI->TheDef->getName() << ":\n";
300 for (unsigned i = 0, e = SimilarInsts.size(); i != e; ++i)
301 O << " case " << SimilarInsts[i].CGI->Namespace << "::"
302 << SimilarInsts[i].CGI->TheDef->getName() << ":\n";
303 for (unsigned i = 0, e = FirstInst.Operands.size(); i != e; ++i) {
304 if (i != DifferingOperand) {
305 // If the operand is the same for all instructions, just print it.
306 O << " " << FirstInst.Operands[i].getCode();
308 // If this is the operand that varies between all of the instructions,
309 // emit a switch for just this operand now.
310 O << " switch (MI->getOpcode()) {\n";
311 std::vector<std::pair<std::string, AsmWriterOperand> > OpsToPrint;
312 OpsToPrint.push_back(std::make_pair(FirstInst.CGI->Namespace + "::" +
313 FirstInst.CGI->TheDef->getName(),
314 FirstInst.Operands[i]));
316 for (unsigned si = 0, e = SimilarInsts.size(); si != e; ++si) {
317 AsmWriterInst &AWI = SimilarInsts[si];
318 OpsToPrint.push_back(std::make_pair(AWI.CGI->Namespace+"::"+
319 AWI.CGI->TheDef->getName(),
322 std::reverse(OpsToPrint.begin(), OpsToPrint.end());
323 while (!OpsToPrint.empty())
324 PrintCases(OpsToPrint, O);
333 void AsmWriterEmitter::
334 FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands,
335 std::vector<unsigned> &InstIdxs,
336 std::vector<unsigned> &InstOpsUsed) const {
337 InstIdxs.assign(NumberedInstructions.size(), ~0U);
339 // This vector parallels UniqueOperandCommands, keeping track of which
340 // instructions each case are used for. It is a comma separated string of
342 std::vector<std::string> InstrsForCase;
343 InstrsForCase.resize(UniqueOperandCommands.size());
344 InstOpsUsed.assign(UniqueOperandCommands.size(), 0);
346 for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
347 const AsmWriterInst *Inst = getAsmWriterInstByID(i);
348 if (Inst == 0) continue; // PHI, INLINEASM, LABEL, etc.
351 if (Inst->Operands.empty())
352 continue; // Instruction already done.
354 Command = " " + Inst->Operands[0].getCode() + "\n";
356 // If this is the last operand, emit a return.
357 if (Inst->Operands.size() == 1)
358 Command += " return true;\n";
360 // Check to see if we already have 'Command' in UniqueOperandCommands.
362 bool FoundIt = false;
363 for (unsigned idx = 0, e = UniqueOperandCommands.size(); idx != e; ++idx)
364 if (UniqueOperandCommands[idx] == Command) {
366 InstrsForCase[idx] += ", ";
367 InstrsForCase[idx] += Inst->CGI->TheDef->getName();
372 InstIdxs[i] = UniqueOperandCommands.size();
373 UniqueOperandCommands.push_back(Command);
374 InstrsForCase.push_back(Inst->CGI->TheDef->getName());
376 // This command matches one operand so far.
377 InstOpsUsed.push_back(1);
381 // For each entry of UniqueOperandCommands, there is a set of instructions
382 // that uses it. If the next command of all instructions in the set are
383 // identical, fold it into the command.
384 for (unsigned CommandIdx = 0, e = UniqueOperandCommands.size();
385 CommandIdx != e; ++CommandIdx) {
387 for (unsigned Op = 1; ; ++Op) {
388 // Scan for the first instruction in the set.
389 std::vector<unsigned>::iterator NIT =
390 std::find(InstIdxs.begin(), InstIdxs.end(), CommandIdx);
391 if (NIT == InstIdxs.end()) break; // No commonality.
393 // If this instruction has no more operands, we isn't anything to merge
394 // into this command.
395 const AsmWriterInst *FirstInst =
396 getAsmWriterInstByID(NIT-InstIdxs.begin());
397 if (!FirstInst || FirstInst->Operands.size() == Op)
400 // Otherwise, scan to see if all of the other instructions in this command
401 // set share the operand.
404 for (NIT = std::find(NIT+1, InstIdxs.end(), CommandIdx);
405 NIT != InstIdxs.end();
406 NIT = std::find(NIT+1, InstIdxs.end(), CommandIdx)) {
407 // Okay, found another instruction in this command set. If the operand
408 // matches, we're ok, otherwise bail out.
409 const AsmWriterInst *OtherInst =
410 getAsmWriterInstByID(NIT-InstIdxs.begin());
411 if (!OtherInst || OtherInst->Operands.size() == Op ||
412 OtherInst->Operands[Op] != FirstInst->Operands[Op]) {
419 // Okay, everything in this command set has the same next operand. Add it
420 // to UniqueOperandCommands and remember that it was consumed.
421 std::string Command = " " + FirstInst->Operands[Op].getCode() + "\n";
423 // If this is the last operand, emit a return after the code.
424 if (FirstInst->Operands.size() == Op+1)
425 Command += " return true;\n";
427 UniqueOperandCommands[CommandIdx] += Command;
428 InstOpsUsed[CommandIdx]++;
432 // Prepend some of the instructions each case is used for onto the case val.
433 for (unsigned i = 0, e = InstrsForCase.size(); i != e; ++i) {
434 std::string Instrs = InstrsForCase[i];
435 if (Instrs.size() > 70) {
436 Instrs.erase(Instrs.begin()+70, Instrs.end());
441 UniqueOperandCommands[i] = " // " + Instrs + "\n" +
442 UniqueOperandCommands[i];
448 void AsmWriterEmitter::run(std::ostream &O) {
449 EmitSourceFileHeader("Assembly Writer Source Fragment", O);
451 CodeGenTarget Target;
452 Record *AsmWriter = Target.getAsmWriter();
453 std::string ClassName = AsmWriter->getValueAsString("AsmWriterClassName");
454 unsigned Variant = AsmWriter->getValueAsInt("Variant");
457 "/// printInstruction - This method is automatically generated by tablegen\n"
458 "/// from the instruction set description. This method returns true if the\n"
459 "/// machine instruction was sufficiently described to print it, otherwise\n"
460 "/// it returns false.\n"
461 "bool " << Target.getName() << ClassName
462 << "::printInstruction(const MachineInstr *MI) {\n";
464 std::vector<AsmWriterInst> Instructions;
466 for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
467 E = Target.inst_end(); I != E; ++I)
468 if (!I->second.AsmString.empty())
469 Instructions.push_back(AsmWriterInst(I->second, Variant));
471 // Get the instruction numbering.
472 Target.getInstructionsByEnumValue(NumberedInstructions);
474 // Compute the CodeGenInstruction -> AsmWriterInst mapping. Note that not
475 // all machine instructions are necessarily being printed, so there may be
476 // target instructions not in this map.
477 for (unsigned i = 0, e = Instructions.size(); i != e; ++i)
478 CGIAWIMap.insert(std::make_pair(Instructions[i].CGI, &Instructions[i]));
480 // Build an aggregate string, and build a table of offsets into it.
481 std::map<std::string, unsigned> StringOffset;
482 std::string AggregateString;
483 AggregateString.push_back(0); // "\0"
484 AggregateString.push_back(0); // "\0"
486 /// OpcodeInfo - This encodes the index of the string to use for the first
487 /// chunk of the output as well as indices used for operand printing.
488 std::vector<unsigned> OpcodeInfo;
490 unsigned MaxStringIdx = 0;
491 for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
492 AsmWriterInst *AWI = CGIAWIMap[NumberedInstructions[i]];
495 // Something not handled by the asmwriter printer.
497 } else if (AWI->Operands[0].OperandType !=
498 AsmWriterOperand::isLiteralTextOperand ||
499 AWI->Operands[0].Str.empty()) {
500 // Something handled by the asmwriter printer, but with no leading string.
503 unsigned &Entry = StringOffset[AWI->Operands[0].Str];
505 // Add the string to the aggregate if this is the first time found.
506 MaxStringIdx = Entry = AggregateString.size();
507 std::string Str = AWI->Operands[0].Str;
509 AggregateString += Str;
510 AggregateString += '\0';
514 // Nuke the string from the operand list. It is now handled!
515 AWI->Operands.erase(AWI->Operands.begin());
517 OpcodeInfo.push_back(Idx);
520 // Figure out how many bits we used for the string index.
521 unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx);
523 // To reduce code size, we compactify common instructions into a few bits
524 // in the opcode-indexed table.
525 unsigned BitsLeft = 32-AsmStrBits;
527 std::vector<std::vector<std::string> > TableDrivenOperandPrinters;
531 std::vector<std::string> UniqueOperandCommands;
533 // For the first operand check, add a default value for instructions with
534 // just opcode strings to use.
536 UniqueOperandCommands.push_back(" return true;\n");
540 std::vector<unsigned> InstIdxs;
541 std::vector<unsigned> NumInstOpsHandled;
542 FindUniqueOperandCommands(UniqueOperandCommands, InstIdxs,
545 // If we ran out of operands to print, we're done.
546 if (UniqueOperandCommands.empty()) break;
548 // Compute the number of bits we need to represent these cases, this is
549 // ceil(log2(numentries)).
550 unsigned NumBits = Log2_32_Ceil(UniqueOperandCommands.size());
552 // If we don't have enough bits for this operand, don't include it.
553 if (NumBits > BitsLeft) {
554 DOUT << "Not enough bits to densely encode " << NumBits
559 // Otherwise, we can include this in the initial lookup table. Add it in.
561 for (unsigned i = 0, e = InstIdxs.size(); i != e; ++i)
562 if (InstIdxs[i] != ~0U)
563 OpcodeInfo[i] |= InstIdxs[i] << (BitsLeft+AsmStrBits);
565 // Remove the info about this operand.
566 for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
567 if (AsmWriterInst *Inst = getAsmWriterInstByID(i))
568 if (!Inst->Operands.empty()) {
569 unsigned NumOps = NumInstOpsHandled[InstIdxs[i]];
570 assert(NumOps <= Inst->Operands.size() &&
571 "Can't remove this many ops!");
572 Inst->Operands.erase(Inst->Operands.begin(),
573 Inst->Operands.begin()+NumOps);
577 // Remember the handlers for this set of operands.
578 TableDrivenOperandPrinters.push_back(UniqueOperandCommands);
583 O<<" static const unsigned OpInfo[] = {\n";
584 for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
585 O << " " << OpcodeInfo[i] << "U,\t// "
586 << NumberedInstructions[i]->TheDef->getName() << "\n";
588 // Add a dummy entry so the array init doesn't end with a comma.
592 // Emit the string itself.
593 O << " const char *AsmStrs = \n \"";
594 unsigned CharsPrinted = 0;
595 EscapeString(AggregateString);
596 for (unsigned i = 0, e = AggregateString.size(); i != e; ++i) {
597 if (CharsPrinted > 70) {
601 O << AggregateString[i];
604 // Print escape sequences all together.
605 if (AggregateString[i] == '\\') {
606 assert(i+1 < AggregateString.size() && "Incomplete escape sequence!");
607 if (isdigit(AggregateString[i+1])) {
608 assert(isdigit(AggregateString[i+2]) && isdigit(AggregateString[i+3]) &&
609 "Expected 3 digit octal escape!");
610 O << AggregateString[++i];
611 O << AggregateString[++i];
612 O << AggregateString[++i];
615 O << AggregateString[++i];
622 O << " if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
623 << " printInlineAsm(MI);\n"
625 << " } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
626 << " printLabel(MI);\n"
630 O << " // Emit the opcode for the instruction.\n"
631 << " unsigned Bits = OpInfo[MI->getOpcode()];\n"
632 << " if (Bits == 0) return false;\n"
633 << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n\n";
635 // Output the table driven operand information.
636 BitsLeft = 32-AsmStrBits;
637 for (unsigned i = 0, e = TableDrivenOperandPrinters.size(); i != e; ++i) {
638 std::vector<std::string> &Commands = TableDrivenOperandPrinters[i];
640 // Compute the number of bits we need to represent these cases, this is
641 // ceil(log2(numentries)).
642 unsigned NumBits = Log2_32_Ceil(Commands.size());
643 assert(NumBits <= BitsLeft && "consistency error");
645 // Emit code to extract this field from Bits.
648 O << "\n // Fragment " << i << " encoded into " << NumBits
649 << " bits for " << Commands.size() << " unique commands.\n";
651 if (Commands.size() == 2) {
652 // Emit two possibilitys with if/else.
653 O << " if ((Bits >> " << (BitsLeft+AsmStrBits) << ") & "
654 << ((1 << NumBits)-1) << ") {\n"
660 O << " switch ((Bits >> " << (BitsLeft+AsmStrBits) << ") & "
661 << ((1 << NumBits)-1) << ") {\n"
662 << " default: // unreachable.\n";
664 // Print out all the cases.
665 for (unsigned i = 0, e = Commands.size(); i != e; ++i) {
666 O << " case " << i << ":\n";
674 // Okay, delete instructions with no operand info left.
675 for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
676 // Entire instruction has been emitted?
677 AsmWriterInst &Inst = Instructions[i];
678 if (Inst.Operands.empty()) {
679 Instructions.erase(Instructions.begin()+i);
685 // Because this is a vector, we want to emit from the end. Reverse all of the
686 // elements in the vector.
687 std::reverse(Instructions.begin(), Instructions.end());
689 if (!Instructions.empty()) {
690 // Find the opcode # of inline asm.
691 O << " switch (MI->getOpcode()) {\n";
692 while (!Instructions.empty())
693 EmitInstructions(Instructions, O);
696 O << " return true;\n";