llvm.org GIT mirror llvm / f5da133
What should be the last unnecessary <iostream>s in the library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32333 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 12 years ago
52 changed file(s) with 2703 addition(s) and 1879 deletion(s). Raw diff Collapse all Expand all
3030 #include "llvm/Support/CommandLine.h"
3131 #include "llvm/Support/MathExtras.h"
3232 #include
33 #include
3433 using namespace llvm;
3534
3635 namespace {
2626 #include "llvm/CodeGen/SSARegMap.h"
2727 #include "llvm/Target/TargetLowering.h"
2828 #include "llvm/Support/Debug.h"
29 #include
3029 #include
3130 using namespace llvm;
3231
2323 #include "llvm/Target/TargetOptions.h"
2424 #include "llvm/Target/TargetInstrInfo.h"
2525 #include "llvm/ADT/STLExtras.h"
26 #include
2726 using namespace llvm;
2827
2928 // hasFP - Return true if the specified function should have a dedicated frame
2323 #include "llvm/Support/Compiler.h"
2424 #include "llvm/Support/Mangler.h"
2525 #include "llvm/ADT/Statistic.h"
26 #include
2726 using namespace llvm;
2827
2928 namespace {
104103 return;
105104
106105 case MachineOperand::MO_Immediate:
107 std::cerr << "printOp() does not handle immediate values\n";
106 cerr << "printOp() does not handle immediate values\n";
108107 abort();
109108 return;
110109
264263 "\t.section .data", I);
265264 break;
266265 case GlobalValue::GhostLinkage:
267 std::cerr << "GhostLinkage cannot appear in AlphaAsmPrinter!\n";
266 cerr << "GhostLinkage cannot appear in AlphaAsmPrinter!\n";
268267 abort();
269268 case GlobalValue::DLLImportLinkage:
270 std::cerr << "DLLImport linkage is not supported by this target!\n";
269 cerr << "DLLImport linkage is not supported by this target!\n";
271270 abort();
272271 case GlobalValue::DLLExportLinkage:
273 std::cerr << "DLLExport linkage is not supported by this target!\n";
272 cerr << "DLLExport linkage is not supported by this target!\n";
274273 abort();
275274 default:
276275 assert(0 && "Unknown linkage type!");
2222 #include "llvm/Function.h"
2323 #include "llvm/Support/Debug.h"
2424 #include "llvm/ADT/Statistic.h"
25 #include
2625 using namespace llvm;
2726
2827 namespace {
157156 rv = MO.getImmedValue();
158157 } else if (MO.isGlobalAddress() || MO.isExternalSymbol()
159158 || MO.isConstantPoolIndex()) {
160 DEBUG(std::cerr << MO << " is a relocated op for " << MI << "\n";);
159 DOUT << MO << " is a relocated op for " << MI << "\n";
161160 unsigned Reloc = 0;
162161 int Offset = 0;
163162 bool useGOT = false;
213212 Alpha::reloc_bsr,
214213 MO.getMachineBasicBlock()));
215214 }else {
216 std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
215 cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
217216 abort();
218217 }
219218
2828 #include "llvm/Support/Debug.h"
2929 #include "llvm/Support/MathExtras.h"
3030 #include
31 #include
3231 #include
3332 #include
3433 using namespace llvm;
114113 unsigned at = CountLeadingZeros_64(x);
115114 uint64_t complow = 1 << (63 - at);
116115 uint64_t comphigh = 1 << (64 - at);
117 //std::cerr << x << ":" << complow << ":" << comphigh << "\n";
116 //cerr << x << ":" << complow << ":" << comphigh << "\n";
118117 if (abs(complow - x) <= abs(comphigh - x))
119118 return complow;
120119 else
2121 #include "llvm/Function.h"
2222 #include "llvm/Module.h"
2323 #include "llvm/Support/CommandLine.h"
24 #include
25
2624 using namespace llvm;
2725
2826 /// AddLiveIn - This helper function adds the specified physical register to the
223221 if (ArgNo < 6) {
224222 switch (ObjectVT) {
225223 default:
226 std::cerr << "Unknown Type " << ObjectVT << "\n";
224 cerr << "Unknown Type " << ObjectVT << "\n";
227225 abort();
228226 case MVT::f64:
229227 args_float[ArgNo] = AddLiveIn(MF, args_float[ArgNo],
1414 #include "AlphaInstrInfo.h"
1515 #include "AlphaGenInstrInfo.inc"
1616 #include "llvm/CodeGen/MachineInstrBuilder.h"
17 #include
1817 using namespace llvm;
1918
2019 AlphaInstrInfo::AlphaInstrInfo()
1717 #include "llvm/Config/alloca.h"
1818 #include "llvm/Support/Debug.h"
1919 #include
20 #include
2120 #include
2221 using namespace llvm;
2322
5756
5857 AtI[0] = BUILD_OR(0, 27, 27);
5958
60 DEBUG(std::cerr << "Stub targeting " << To << "\n");
59 DOUT << "Stub targeting " << To << "\n";
6160
6261 for (int x = 1; x <= 8; ++x) {
6362 AtI[2*x - 1] = BUILD_SLLi(27,27,8);
6463 unsigned d = (Fn >> (64 - 8 * x)) & 0x00FF;
65 // DEBUG(std::cerr << "outputing " << hex << d << dec << "\n");
64 //DOUT << "outputing " << hex << d << dec << "\n";
6665 AtI[2*x] = BUILD_ORi(27, 27, d);
6766 }
6867 AtI[17] = BUILD_JMP(31,27,0); //jump, preserving ra, and setting pv
8685
8786 //rewrite the stub to an unconditional branch
8887 if (((unsigned*)CameFromStub)[18] == 0x00FFFFFF) {
89 DEBUG(std::cerr << "Came from a stub, rewriting\n");
88 DOUT << "Came from a stub, rewriting\n";
9089 EmitBranchToAt(CameFromStub, Target);
9190 } else {
92 DEBUG(std::cerr << "confused, didn't come from stub at " << CameFromStub
93 << " old jump vector " << oldpv
94 << " new jump vector " << Target << "\n");
91 DOUT << "confused, didn't come from stub at " << CameFromStub
92 << " old jump vector " << oldpv
93 << " new jump vector " << Target << "\n";
9594 }
9695
9796 //Change pv to new Target
184183 );
185184 #else
186185 void AlphaCompilationCallback() {
187 std::cerr << "Cannot call AlphaCompilationCallback() on a non-Alpha arch!\n";
186 cerr << "Cannot call AlphaCompilationCallback() on a non-Alpha arch!\n";
188187 abort();
189188 }
190189 #endif
198197 for (int x = 0; x < 19; ++ x)
199198 MCE.emitWordLE(0);
200199 EmitBranchToAt(Addr, Fn);
201 DEBUG(std::cerr << "Emitting Stub to " << Fn << " at [" << Addr << "]\n");
200 DOUT << "Emitting Stub to " << Fn << " at [" << Addr << "]\n";
202201 return MCE.finishFunctionStub(0);
203202 }
204203
249248 case Alpha::reloc_literal:
250249 //This is a LDQl
251250 idx = MR->getGOTIndex();
252 DEBUG(std::cerr << "Literal relocation to slot " << idx);
251 DOUT << "Literal relocation to slot " << idx;
253252 idx = (idx - GOToffset) * 8;
254 DEBUG(std::cerr << " offset " << idx << "\n");
253 DOUT << " offset " << idx << "\n";
255254 break;
256255 case Alpha::reloc_gprellow:
257256 idx = (unsigned char*)MR->getResultPointer() - &GOTBase[GOToffset * 8];
258257 idx = getLower16(idx);
259 DEBUG(std::cerr << "gprellow relocation offset " << idx << "\n");
260 DEBUG(std::cerr << " Pointer is " << (void*)MR->getResultPointer()
261 << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n");
258 DOUT << "gprellow relocation offset " << idx << "\n";
259 DOUT << " Pointer is " << (void*)MR->getResultPointer()
260 << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n";
262261 break;
263262 case Alpha::reloc_gprelhigh:
264263 idx = (unsigned char*)MR->getResultPointer() - &GOTBase[GOToffset * 8];
265264 idx = getUpper16(idx);
266 DEBUG(std::cerr << "gprelhigh relocation offset " << idx << "\n");
267 DEBUG(std::cerr << " Pointer is " << (void*)MR->getResultPointer()
268 << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n");
265 DOUT << "gprelhigh relocation offset " << idx << "\n";
266 DOUT << " Pointer is " << (void*)MR->getResultPointer()
267 << " GOT is " << (void*)&GOTBase[GOToffset * 8] << "\n";
269268 break;
270269 case Alpha::reloc_gpdist:
271270 switch (*RelocPos >> 26) {
272271 case 0x09: //LDAH
273272 idx = &GOTBase[GOToffset * 8] - (unsigned char*)RelocPos;
274273 idx = getUpper16(idx);
275 DEBUG(std::cerr << "LDAH: " << idx << "\n");
274 DOUT << "LDAH: " << idx << "\n";
276275 //add the relocation to the map
277276 gpdistmap[std::make_pair(Function, MR->getConstantVal())] = RelocPos;
278277 break;
282281 idx = &GOTBase[GOToffset * 8] -
283282 (unsigned char*)gpdistmap[std::make_pair(Function, MR->getConstantVal())];
284283 idx = getLower16(idx);
285 DEBUG(std::cerr << "LDA: " << idx << "\n");
284 DOUT << "LDA: " << idx << "\n";
286285 break;
287286 default:
288287 assert(0 && "Cannot handle gpdist yet");
2929 #include "llvm/Support/Debug.h"
3030 #include "llvm/ADT/STLExtras.h"
3131 #include
32 #include
3332 using namespace llvm;
3433
3534 //These describe LDAx
6261 MachineBasicBlock::iterator MI,
6362 unsigned SrcReg, int FrameIdx,
6463 const TargetRegisterClass *RC) const {
65 //std::cerr << "Trying to store " << getPrettyName(SrcReg) << " to "
66 //<< FrameIdx << "\n";
64 //cerr << "Trying to store " << getPrettyName(SrcReg) << " to "
65 // << FrameIdx << "\n";
6766 //BuildMI(MBB, MI, Alpha::WTF, 0).addReg(SrcReg);
6867 if (RC == Alpha::F4RCRegisterClass)
6968 BuildMI(MBB, MI, TII.get(Alpha::STS))
8382 MachineBasicBlock::iterator MI,
8483 unsigned DestReg, int FrameIdx,
8584 const TargetRegisterClass *RC) const {
86 //std::cerr << "Trying to load " << getPrettyName(DestReg) << " to "
87 //<< FrameIdx << "\n";
85 //cerr << "Trying to load " << getPrettyName(DestReg) << " to "
86 // << FrameIdx << "\n";
8887 if (RC == Alpha::F4RCRegisterClass)
8988 BuildMI(MBB, MI, TII.get(Alpha::LDS), DestReg)
9089 .addFrameIndex(FrameIdx).addReg(Alpha::F31);
138137 MachineBasicBlock::iterator MI,
139138 unsigned DestReg, unsigned SrcReg,
140139 const TargetRegisterClass *RC) const {
141 // std::cerr << "copyRegToReg " << DestReg << " <- " << SrcReg << "\n";
140 //cerr << "copyRegToReg " << DestReg << " <- " << SrcReg << "\n";
142141 if (RC == Alpha::GPRCRegisterClass) {
143142 BuildMI(MBB, MI, TII.get(Alpha::BISr), DestReg).addReg(SrcReg).addReg(SrcReg);
144143 } else if (RC == Alpha::F4RCRegisterClass) {
146145 } else if (RC == Alpha::F8RCRegisterClass) {
147146 BuildMI(MBB, MI, TII.get(Alpha::CPYST), DestReg).addReg(SrcReg).addReg(SrcReg);
148147 } else {
149 std::cerr << "Attempt to copy register that is not GPR or FPR";
150 abort();
148 cerr << "Attempt to copy register that is not GPR or FPR";
149 abort();
151150 }
152151 }
153152
254253 // Now add the frame object offset to the offset from the virtual frame index.
255254 int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
256255
257 DEBUG(std::cerr << "FI: " << FrameIndex << " Offset: " << Offset << "\n");
256 DOUT << "FI: " << FrameIndex << " Offset: " << Offset << "\n";
258257
259258 Offset += MF.getFrameInfo()->getStackSize();
260259
261 DEBUG(std::cerr << "Corrected Offset " << Offset <<
262 " for stack size: " << MF.getFrameInfo()->getStackSize() << "\n");
260 DOUT << "Corrected Offset " << Offset
261 << " for stack size: " << MF.getFrameInfo()->getStackSize() << "\n";
263262
264263 if (Offset > IMM_HIGH || Offset < IMM_LOW) {
265 DEBUG(std::cerr << "Unconditionally using R28 for evil purposes Offset: "
266 << Offset << "\n");
264 DOUT << "Unconditionally using R28 for evil purposes Offset: "
265 << Offset << "\n";
267266 //so in this case, we need to use a temporary register, and move the
268267 //original inst off the SP/FP
269268 //fix up the old:
308307 // brackets around call sites.
309308 //If there is a frame pointer, then we don't do this
310309 NumBytes += MFI->getMaxCallFrameSize();
311 DEBUG(std::cerr << "Added " << MFI->getMaxCallFrameSize()
312 << " to the stack due to calls\n");
310 DOUT << "Added " << MFI->getMaxCallFrameSize()
311 << " to the stack due to calls\n";
313312 }
314313
315314 if (FP)
335334 BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30).addImm(getLower16(NumBytes))
336335 .addReg(Alpha::R30);
337336 } else {
338 std::cerr << "Too big a stack frame at " << NumBytes << "\n";
337 cerr << "Too big a stack frame at " << NumBytes << "\n";
339338 abort();
340339 }
341340
385384 BuildMI(MBB, MBBI, TII.get(Alpha::LDA), Alpha::R30)
386385 .addImm(getLower16(NumBytes)).addReg(Alpha::R30);
387386 } else {
388 std::cerr << "Too big a stack frame at " << NumBytes << "\n";
387 cerr << "Too big a stack frame at " << NumBytes << "\n";
389388 abort();
390389 }
391390 }
4141 #include "llvm/Support/MathExtras.h"
4242 #include "llvm/Config/config.h"
4343 #include
44 #include
4544 #include
46 #include
4745 using namespace llvm;
4846
4947 namespace {
228226 void visitVAArgInst (VAArgInst &I);
229227
230228 void visitInstruction(Instruction &I) {
231 std::cerr << "C Writer does not know about " << I;
229 cerr << "C Writer does not know about " << I;
232230 abort();
233231 }
234232
374372 case Type::FloatTyID: return Out << "float " << NameSoFar;
375373 case Type::DoubleTyID: return Out << "double " << NameSoFar;
376374 default :
377 std::cerr << "Unknown primitive type: " << *Ty << "\n";
375 cerr << "Unknown primitive type: " << *Ty << "\n";
378376 abort();
379377 }
380378
725723 }
726724
727725 default:
728 std::cerr << "CWriter Error: Unhandled constant expression: "
729 << *CE << "\n";
726 cerr << "CWriter Error: Unhandled constant expression: "
727 << *CE << "\n";
730728 abort();
731729 }
732730 } else if (isa(CPV) && CPV->getType()->isFirstClassType()) {
900898 }
901899 // FALL THROUGH
902900 default:
903 std::cerr << "Unknown constant type: " << *CPV << "\n";
901 cerr << "Unknown constant type: " << *CPV << "\n";
904902 abort();
905903 }
906904 }
19721970 case Instruction::Shl : Out << " << "; break;
19731971 case Instruction::LShr:
19741972 case Instruction::AShr: Out << " >> "; break;
1975 default: std::cerr << "Invalid operator type!" << I; abort();
1973 default: cerr << "Invalid operator type!" << I; abort();
19761974 }
19771975
19781976 writeOperandWithCast(I.getOperand(1), I.getOpcode());
20982096 Out << ", ";
20992097 // Output the last argument to the enclosing function...
21002098 if (I.getParent()->getParent()->arg_empty()) {
2101 std::cerr << "The C backend does not currently support zero "
2102 << "argument varargs functions, such as '"
2103 << I.getParent()->getParent()->getName() << "'!\n";
2099 cerr << "The C backend does not currently support zero "
2100 << "argument varargs functions, such as '"
2101 << I.getParent()->getParent()->getName() << "'!\n";
21042102 abort();
21052103 }
21062104 writeOperand(--I.getParent()->getParent()->arg_end());
4141 #include "llvm/Support/MathExtras.h"
4242 #include "llvm/Config/config.h"
4343 #include
44 #include
4544 #include
46 #include
4745 using namespace llvm;
4846
4947 namespace {
228226 void visitVAArgInst (VAArgInst &I);
229227
230228 void visitInstruction(Instruction &I) {
231 std::cerr << "C Writer does not know about " << I;
229 cerr << "C Writer does not know about " << I;
232230 abort();
233231 }
234232
374372 case Type::FloatTyID: return Out << "float " << NameSoFar;
375373 case Type::DoubleTyID: return Out << "double " << NameSoFar;
376374 default :
377 std::cerr << "Unknown primitive type: " << *Ty << "\n";
375 cerr << "Unknown primitive type: " << *Ty << "\n";
378376 abort();
379377 }
380378
725723 }
726724
727725 default:
728 std::cerr << "CWriter Error: Unhandled constant expression: "
729 << *CE << "\n";
726 cerr << "CWriter Error: Unhandled constant expression: "
727 << *CE << "\n";
730728 abort();
731729 }
732730 } else if (isa(CPV) && CPV->getType()->isFirstClassType()) {
900898 }
901899 // FALL THROUGH
902900 default:
903 std::cerr << "Unknown constant type: " << *CPV << "\n";
901 cerr << "Unknown constant type: " << *CPV << "\n";
904902 abort();
905903 }
906904 }
19721970 case Instruction::Shl : Out << " << "; break;
19731971 case Instruction::LShr:
19741972 case Instruction::AShr: Out << " >> "; break;
1975 default: std::cerr << "Invalid operator type!" << I; abort();
1973 default: cerr << "Invalid operator type!" << I; abort();
19761974 }
19771975
19781976 writeOperandWithCast(I.getOperand(1), I.getOpcode());
20982096 Out << ", ";
20992097 // Output the last argument to the enclosing function...
21002098 if (I.getParent()->getParent()->arg_empty()) {
2101 std::cerr << "The C backend does not currently support zero "
2102 << "argument varargs functions, such as '"
2103 << I.getParent()->getParent()->getName() << "'!\n";
2099 cerr << "The C backend does not currently support zero "
2100 << "argument varargs functions, such as '"
2101 << I.getParent()->getParent()->getName() << "'!\n";
21042102 abort();
21052103 }
21062104 writeOperand(--I.getParent()->getParent()->arg_end());
2525 #include "llvm/Target/TargetMachine.h"
2626 #include "llvm/Support/Mangler.h"
2727 #include "llvm/ADT/Statistic.h"
28 #include
2928 using namespace llvm;
3029
3130 namespace {
307306 SwitchToDataSection(C->isNullValue() ? ".bss" : ".data", I);
308307 break;
309308 case GlobalValue::GhostLinkage:
310 std::cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";
309 cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";
311310 abort();
312311 case GlobalValue::DLLImportLinkage:
313 std::cerr << "DLLImport linkage is not supported by this target!\n";
312 cerr << "DLLImport linkage is not supported by this target!\n";
314313 abort();
315314 case GlobalValue::DLLExportLinkage:
316 std::cerr << "DLLExport linkage is not supported by this target!\n";
315 cerr << "DLLExport linkage is not supported by this target!\n";
317316 abort();
318317 default:
319318 assert(0 && "Unknown linkage type!");
2828 #include "llvm/ADT/Statistic.h"
2929 #include "llvm/Support/Debug.h"
3030 #include
31 #include
3231 using namespace llvm;
3332
3433 namespace {
2626 #include "llvm/Intrinsics.h"
2727 #include "llvm/Support/Debug.h"
2828 #include "llvm/Support/MathExtras.h"
29 #include
3029 #include
3130 #include
3231 using namespace llvm;
2828 #include "llvm/Target/TargetInstrInfo.h"
2929 #include "llvm/Support/CommandLine.h"
3030 #include "llvm/ADT/STLExtras.h"
31 #include
3231 using namespace llvm;
33
3432
3533 IA64RegisterInfo::IA64RegisterInfo(const TargetInstrInfo &tii)
3634 : IA64GenRegisterInfo(IA64::ADJUSTCALLSTACKDOWN, IA64::ADJUSTCALLSTACKUP),
4040 #include "llvm/Target/TargetOptions.h"
4141 #include "llvm/ADT/Statistic.h"
4242 #include "llvm/ADT/StringExtras.h"
43 #include
4443 #include
4544 using namespace llvm;
4645
294293 void PPCAsmPrinter::printOp(const MachineOperand &MO) {
295294 switch (MO.getType()) {
296295 case MachineOperand::MO_Immediate:
297 std::cerr << "printOp() does not handle immediate values\n";
296 cerr << "printOp() does not handle immediate values\n";
298297 abort();
299298 return;
300299
628627 SwitchToDataSection("\t.data", I);
629628 break;
630629 default:
631 std::cerr << "Unknown linkage type!";
630 cerr << "Unknown linkage type!";
632631 abort();
633632 }
634633
2323 #include "llvm/Support/Debug.h"
2424 #include "llvm/Support/Compiler.h"
2525 #include "llvm/Target/TargetOptions.h"
26 #include
2726 using namespace llvm;
2827
2928 namespace {
192191 Reloc,
193192 MO.getMachineBasicBlock()));
194193 } else {
195 std::cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
194 cerr << "ERROR: Unknown type of MachineOperand: " << MO << "\n";
196195 abort();
197196 }
198197
1515 #include "PPC.h"
1616 #include "PPCInstrInfo.h"
1717 #include "llvm/Support/Debug.h"
18 #include
1918 using namespace llvm;
20
2119
2220 //===----------------------------------------------------------------------===//
2321 // PowerPC 970 Hazard Recognizer
5149 }
5250
5351 void PPCHazardRecognizer970::EndDispatchGroup() {
54 DEBUG(std::cerr << "=== Start of dispatch group\n");
52 DOUT << "=== Start of dispatch group\n";
5553 NumIssued = 0;
5654
5755 // Structural hazard info.
2929 #include "llvm/Support/Debug.h"
3030 #include "llvm/Support/MathExtras.h"
3131 #include "llvm/Support/Compiler.h"
32 #include
3332 #include
3433 #include
3534 using namespace llvm;
1515 #include "PPCGenInstrInfo.inc"
1616 #include "PPCTargetMachine.h"
1717 #include "llvm/CodeGen/MachineInstrBuilder.h"
18 #include
1918 using namespace llvm;
2019
2120 PPCInstrInfo::PPCInstrInfo(PPCTargetMachine &tm)
1717 #include "llvm/Config/alloca.h"
1818 #include "llvm/Support/Debug.h"
1919 #include
20 #include
2120 using namespace llvm;
2221
2322 static TargetJITInfo::JITCompilerFn JITCompilerFunction;
3535 #include "llvm/Support/MathExtras.h"
3636 #include "llvm/ADT/STLExtras.h"
3737 #include
38 #include
3938 using namespace llvm;
4039
4140 /// getRegisterNumbering - Given the enum value for some register, e.g.
7675 case R30: case X30: case F30: case V30: return 30;
7776 case R31: case X31: case F31: case V31: return 31;
7877 default:
79 std::cerr << "Unhandled reg in PPCRegisterInfo::getRegisterNumbering!\n";
78 cerr << "Unhandled reg in PPCRegisterInfo::getRegisterNumbering!\n";
8079 abort();
8180 }
8281 }
233232 } else if (RC == PPC::VRRCRegisterClass) {
234233 BuildMI(MBB, MI, TII.get(PPC::VOR), DestReg).addReg(SrcReg).addReg(SrcReg);
235234 } else {
236 std::cerr << "Attempt to copy register that is not GPR or FPR";
235 cerr << "Attempt to copy register that is not GPR or FPR";
237236 abort();
238237 }
239238 }
1414 #include "PPC.h"
1515 #include "llvm/Module.h"
1616 #include "PPCGenSubtarget.inc"
17 #include
1817 using namespace llvm;
1918
2019 #if defined(__APPLE__)
7978 // If we are generating code for ppc64, verify that options make sense.
8079 if (is64Bit) {
8180 if (!has64BitSupport()) {
82 std::cerr << "PPC: Generation of 64-bit code for a 32-bit processor "
83 "requested. Ignoring 32-bit processor feature.\n";
81 cerr << "PPC: Generation of 64-bit code for a 32-bit processor "
82 << "requested. Ignoring 32-bit processor feature.\n";
8483 Has64BitSupport = true;
8584 }
8685 // Silently force 64-bit register use on ppc64.
9089 // If the user requested use of 64-bit regs, but the cpu selected doesn't
9190 // support it, warn and ignore.
9291 if (use64BitRegs() && !has64BitSupport()) {
93 std::cerr << "PPC: 64-bit registers requested on CPU without support. "
94 "Disabling 64-bit register use.\n";
92 cerr << "PPC: 64-bit registers requested on CPU without support. "
93 << "Disabling 64-bit register use.\n";
9594 Use64BitRegs = false;
9695 }
9796
1818 #include "llvm/Target/TargetInstrInfo.h"
1919 #include "llvm/ADT/Statistic.h"
2020 #include "llvm/Support/Debug.h"
21 #include
2221 using namespace llvm;
2322
2423 namespace {
107106
108107 MI->getOperand(0).setReg(EvenDestReg);
109108 MI->getOperand(1).setReg(EvenSrcReg);
110 DEBUG(std::cerr << "FPMover: the modified instr is: " << *MI);
109 DOUT << "FPMover: the modified instr is: " << *MI;
111110 // Insert copy for the other half of the double.
112111 if (DestDReg != SrcDReg) {
113112 MI = BuildMI(MBB, I, TM.getInstrInfo()->get(SP::FMOVS), OddDestReg)
114113 .addReg(OddSrcReg);
115 DEBUG(std::cerr << "FPMover: the inserted instr is: " << *MI);
114 DOUT << "FPMover: the inserted instr is: " << *MI;
116115 }
117116 ++NumFpDs;
118117 }
2929 #include "llvm/Support/CommandLine.h"
3030 #include "llvm/Support/MathExtras.h"
3131 #include
32 #include
3332 using namespace llvm;
3433
3534 namespace {
265264 SwitchToDataSection(".data", I);
266265 break;
267266 case GlobalValue::GhostLinkage:
268 std::cerr << "Should not have any unmaterialized functions!\n";
267 cerr << "Should not have any unmaterialized functions!\n";
269268 abort();
270269 case GlobalValue::DLLImportLinkage:
271 std::cerr << "DLLImport linkage is not supported by this target!\n";
270 cerr << "DLLImport linkage is not supported by this target!\n";
272271 abort();
273272 case GlobalValue::DLLExportLinkage:
274 std::cerr << "DLLExport linkage is not supported by this target!\n";
273 cerr << "DLLExport linkage is not supported by this target!\n";
275274 abort();
276275 default:
277276 assert(0 && "Unknown linkage type!");
2323 #include "llvm/CodeGen/SSARegMap.h"
2424 #include "llvm/Target/TargetLowering.h"
2525 #include "llvm/Support/Debug.h"
26 #include
2726 #include
2827 #include
2928 using namespace llvm;
2020 #include "llvm/Target/TargetInstrInfo.h"
2121 #include "llvm/Type.h"
2222 #include "llvm/ADT/STLExtras.h"
23 #include
2423 using namespace llvm;
2524
2625 SparcRegisterInfo::SparcRegisterInfo(SparcSubtarget &st,
1515 #include "llvm/Module.h"
1616 #include "llvm/PassManager.h"
1717 #include "llvm/Target/TargetMachineRegistry.h"
18 #include
1918 using namespace llvm;
2019
2120 namespace {
1212
1313 #include "llvm/Target/SubtargetFeature.h"
1414 #include "llvm/ADT/StringExtras.h"
15 #include "llvm/Support/Streams.h"
1516 #include
1617 #include
1718 #include
18 #include
1919 using namespace llvm;
2020
2121 //===----------------------------------------------------------------------===//
143143 unsigned MaxFeatLen = getLongestEntryLength(FeatTable, FeatTableSize);
144144
145145 // Print the CPU table.
146 std::cerr << "Available CPUs for this target:\n\n";
146 cerr << "Available CPUs for this target:\n\n";
147147 for (size_t i = 0; i != CPUTableSize; i++)
148 std::cerr << " " << CPUTable[i].Key
149 << std::string(MaxCPULen - std::strlen(CPUTable[i].Key), ' ')
150 << " - " << CPUTable[i].Desc << ".\n";
151 std::cerr << "\n";
148 cerr << " " << CPUTable[i].Key
149 << std::string(MaxCPULen - std::strlen(CPUTable[i].Key), ' ')
150 << " - " << CPUTable[i].Desc << ".\n";
151 cerr << "\n";
152152
153153 // Print the Feature table.
154 std::cerr << "Available features for this target:\n\n";
154 cerr << "Available features for this target:\n\n";
155155 for (size_t i = 0; i != FeatTableSize; i++)
156 std::cerr << " " << FeatTable[i].Key
157 << std::string(MaxFeatLen - std::strlen(FeatTable[i].Key), ' ')
158 << " - " << FeatTable[i].Desc << ".\n";
159 std::cerr << "\n";
156 cerr << " " << FeatTable[i].Key
157 << std::string(MaxFeatLen - std::strlen(FeatTable[i].Key), ' ')
158 << " - " << FeatTable[i].Desc << ".\n";
159 cerr << "\n";
160160
161 std::cerr << "Use +feature to enable a feature, or -feature to disable it.\n"
162 << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n";
161 cerr << "Use +feature to enable a feature, or -feature to disable it.\n"
162 << "For example, llc -mcpu=mycpu -mattr=+feature1,-feature2\n";
163163 exit(1);
164164 }
165165
230230 // Set base feature bits
231231 Bits = CPUEntry->Value;
232232 } else {
233 std::cerr << "'" << Features[0]
234 << "' is not a recognized processor for this target"
235 << " (ignoring processor)"
236 << "\n";
233 cerr << "'" << Features[0]
234 << "' is not a recognized processor for this target"
235 << " (ignoring processor)"
236 << "\n";
237237 }
238238 // Iterate through each feature
239239 for (size_t i = 1; i < Features.size(); i++) {
252252 if (isEnabled(Feature)) Bits |= FeatureEntry->Value;
253253 else Bits &= ~FeatureEntry->Value;
254254 } else {
255 std::cerr << "'" << Feature
256 << "' is not a recognized feature for this target"
257 << " (ignoring feature)"
258 << "\n";
255 cerr << "'" << Feature
256 << "' is not a recognized feature for this target"
257 << " (ignoring feature)"
258 << "\n";
259259 }
260260 }
261261 return Bits;
277277 if (Entry) {
278278 return Entry->Value;
279279 } else {
280 std::cerr << "'" << Features[0]
281 << "' is not a recognized processor for this target"
282 << " (ignoring processor)"
283 << "\n";
280 cerr << "'" << Features[0]
281 << "' is not a recognized processor for this target"
282 << " (ignoring processor)"
283 << "\n";
284284 return NULL;
285285 }
286286 }
297297 /// dump - Dump feature info.
298298 ///
299299 void SubtargetFeatures::dump() const {
300 print(std::cerr);
301 }
300 print(*cerr.stream());
301 }
4343 #include "llvm/ADT/Statistic.h"
4444 #include "llvm/ADT/STLExtras.h"
4545 #include
46 #include
4746 #include
4847 using namespace llvm;
4948
6968 unsigned StackTop; // The current top of the FP stack.
7069
7170 void dumpStack() const {
72 std::cerr << "Stack contents:";
71 cerr << "Stack contents:";
7372 for (unsigned i = 0; i != StackTop; ++i) {
74 std::cerr << " FP" << Stack[i];
73 cerr << " FP" << Stack[i];
7574 assert(RegMap[Stack[i]] == i && "Stack[] doesn't match RegMap[]!");
7675 }
77 std::cerr << "\n";
76 cerr << "\n";
7877 }
7978 private:
8079 // getSlot - Return the stack slot number a particular register number is
210209 PrevMI = prior(I);
211210
212211 ++NumFP; // Keep track of # of pseudo instrs
213 DEBUG(std::cerr << "\nFPInst:\t"; MI->print(std::cerr, &(MF.getTarget())));
212 DOUT << "\nFPInst:\t"; MI->print(*cerr.stream(), &(MF.getTarget()));
214213
215214 // Get dead variables list now because the MI pointer may be deleted as part
216215 // of processing!
237236 for (unsigned i = 0, e = DeadRegs.size(); i != e; ++i) {
238237 unsigned Reg = DeadRegs[i];
239238 if (Reg >= X86::FP0 && Reg <= X86::FP6) {
240 DEBUG(std::cerr << "Register FP#" << Reg-X86::FP0 << " is dead!\n");
239 DOUT << "Register FP#" << Reg-X86::FP0 << " is dead!\n";
241240 freeStackSlotAfter(I, Reg-X86::FP0);
242241 }
243242 }
246245 DEBUG(
247246 MachineBasicBlock::iterator PrevI(PrevMI);
248247 if (I == PrevI) {
249 std::cerr << "Just deleted pseudo instruction\n";
248 cerr << "Just deleted pseudo instruction\n";
250249 } else {
251250 MachineBasicBlock::iterator Start = I;
252251 // Rewind to first instruction newly inserted.
253252 while (Start != BB.begin() && prior(Start) != PrevI) --Start;
254 std::cerr << "Inserted instructions:\n\t";
255 Start->print(std::cerr, &MF.getTarget());
253 cerr << "Inserted instructions:\n\t";
254 Start->print(*cerr.stream(), &MF.getTarget());
256255 while (++Start != next(I));
257256 }
258257 dumpStack();
3333 #include "llvm/Support/Debug.h"
3434 #include "llvm/Support/MathExtras.h"
3535 #include "llvm/ADT/Statistic.h"
36 #include
3736 #include
3837 #include
3938 using namespace llvm;
3131 #include "llvm/Target/TargetOptions.h"
3232 #include "llvm/Support/CommandLine.h"
3333 #include "llvm/ADT/STLExtras.h"
34 #include
35
3634 using namespace llvm;
3735
3836 namespace {
243241 static bool TableIsSorted(const TableEntry *Table, unsigned NumEntries) {
244242 for (unsigned i = 1; i != NumEntries; ++i)
245243 if (!(Table[i-1] < Table[i])) {
246 std::cerr << "Entries out of order " << Table[i-1].from
247 << " " << Table[i].from << "\n";
244 cerr << "Entries out of order " << Table[i-1].from
245 << " " << Table[i].from << "\n";
248246 return false;
249247 }
250248 return true;
844842
845843 // No fusion
846844 if (PrintFailedFusing)
847 std::cerr << "We failed to fuse ("
848 << ((i == 1) ? "r" : "s") << "): " << *MI;
845 cerr << "We failed to fuse ("
846 << ((i == 1) ? "r" : "s") << "): " << *MI;
849847 return NULL;
850848 }
851849
1414 #include "X86GenSubtarget.inc"
1515 #include "llvm/Module.h"
1616 #include "llvm/Support/CommandLine.h"
17 #include
1817 using namespace llvm;
1918
2019 cl::opt
223222 ParseSubtargetFeatures(FS, CPU);
224223
225224 if (Is64Bit && !HasX86_64)
226 std::cerr << "Warning: Generation of 64-bit code for a 32-bit processor "
227 "requested.\n";
225 cerr << "Warning: Generation of 64-bit code for a 32-bit processor "
226 << "requested.\n";
228227 if (Is64Bit && X86SSELevel < SSE2)
229 std::cerr << "Warning: 64-bit processors all have at least SSE2.\n";
228 cerr << "Warning: 64-bit processors all have at least SSE2.\n";
230229 } else {
231230 // Otherwise, use CPUID to auto-detect feature set.
232231 AutoDetectSubtargetFeatures();
2828 #include "llvm/Assembly/Writer.h"
2929 #include "llvm/ADT/Statistic.h"
3030 #include
31 #include
3231 using namespace llvm;
3332
3433 namespace {
6463 cerr << "WARNING: Linking function '" << Old->getName()
6564 << "' is causing arguments to be dropped.\n";
6665 cerr << "WARNING: Prototype: ";
67 WriteAsOperand(std::cerr, Old);
66 WriteAsOperand(*cerr.stream(), Old);
6867 cerr << " resolved to ";
69 WriteAsOperand(std::cerr, Concrete);
68 WriteAsOperand(*cerr.stream(), Concrete);
7069 cerr << "\n";
7170 }
7271
8382 ConcreteFT->getParamType(i)->getTypeID()) {
8483 cerr << "WARNING: Function [" << Old->getName()
8584 << "]: Parameter types conflict for: '";
86 WriteTypeSymbolic(std::cerr, OldFT, &M);
85 WriteTypeSymbolic(*cerr.stream(), OldFT, &M);
8786 cerr << "' (in "
8887 << Old->getParent()->getModuleIdentifier() << ") and '";
89 WriteTypeSymbolic(std::cerr, ConcreteFT, &M);
88 WriteTypeSymbolic(*cerr.stream(), ConcreteFT, &M);
9089 cerr << "'(in "
9190 << Concrete->getParent()->getModuleIdentifier() << ")\n";
9291 return Changed;
253252 cerr << "WARNING: Found global types that are not compatible:\n";
254253 for (unsigned i = 0; i < Globals.size(); ++i) {
255254 cerr << "\t";
256 WriteTypeSymbolic(std::cerr, Globals[i]->getType(), &M);
255 WriteTypeSymbolic(*cerr.stream(), Globals[i]->getType(), &M);
257256 cerr << " %" << Globals[i]->getName() << "\n";
258257 }
259258 }
1818 #include "llvm/Support/Debug.h"
1919 #include "llvm/Support/MathExtras.h"
2020 #include
21 #include
2221 using namespace llvm;
2322
2423 static bool isIdentChar(char C) {
550549
551550 // If we don't have enough bits for this operand, don't include it.
552551 if (NumBits > BitsLeft) {
553 DEBUG(std::cerr << "Not enough bits to densely encode " << NumBits
554 << " more bits\n");
552 DOUT << "Not enough bits to densely encode " << NumBits
553 << " more bits\n";
555554 break;
556555 }
557556
213213
214214 // Default case: unhandled opcode
215215 o << " default:\n"
216 << " std::cerr << \"Not supported instr: \" << MI << \"\\n\";\n"
216 << " cerr << \"Not supported instr: \" << MI << \"\\n\";\n"
217217 << " abort();\n"
218218 << " }\n"
219219 << " return Value;\n"
1818 #include "Record.h"
1919 #include "llvm/ADT/StringExtras.h"
2020 #include "llvm/Support/CommandLine.h"
21 #include "llvm/Support/Streams.h"
2122 #include
2223 #include
2324 using namespace llvm;
526527 } else if (PropList[i]->getName() == "SDNPOptInFlag") {
527528 Properties |= 1 << SDNPOptInFlag;
528529 } else {
529 std::cerr << "Unsupported SD Node property '" << PropList[i]->getName()
530 << "' on ComplexPattern '" << R->getName() << "'!\n";
530 cerr << "Unsupported SD Node property '" << PropList[i]->getName()
531 << "' on ComplexPattern '" << R->getName() << "'!\n";
531532 exit(1);
532533 }
533534 }
1515 #include "llvm/ADT/StringExtras.h"
1616 #include "llvm/Support/Debug.h"
1717 #include "llvm/Support/MathExtras.h"
18 #include "llvm/Support/Streams.h"
1819 #include
1920 #include
2021 using namespace llvm;
108109 x.SDTCisIntVectorOfSameSize_Info.OtherOperandNum =
109110 R->getValueAsInt("OtherOpNum");
110111 } else {
111 std::cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
112 cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
112113 exit(1);
113114 }
114115 }
122123 "We only work with nodes with zero or one result so far!");
123124
124125 if (OpNo >= (NumResults + N->getNumChildren())) {
125 std::cerr << "Invalid operand number " << OpNo << " ";
126 cerr << "Invalid operand number " << OpNo << " ";
126127 N->dump();
127 std::cerr << '\n';
128 cerr << '\n';
128129 exit(1);
129130 }
130131
315316 } else if (PropList[i]->getName() == "SDNPOptInFlag") {
316317 Properties |= 1 << SDNPOptInFlag;
317318 } else {
318 std::cerr << "Unknown SD Node property '" << PropList[i]->getName()
319 << "' on node '" << R->getName() << "'!\n";
319 cerr << "Unknown SD Node property '" << PropList[i]->getName()
320 << "' on node '" << R->getName() << "'!\n";
320321 exit(1);
321322 }
322323 }
411412
412413 if (isLeaf()) {
413414 dump();
414 std::cerr << " ";
415 cerr << " ";
415416 TP.error("Type inference contradiction found in node!");
416417 } else {
417418 TP.error("Type inference contradiction found in node " +
467468
468469 }
469470 void TreePatternNode::dump() const {
470 print(std::cerr);
471 print(*cerr.stream());
471472 }
472473
473474 /// isIsomorphicTo - Return true if this node is recursively isomorphic to
10081009 error("Constant int argument should not have a name!");
10091010 Children.push_back(Node);
10101011 } else {
1011 std::cerr << '"';
1012 cerr << '"';
10121013 Arg->dump();
1013 std::cerr << "\": ";
1014 cerr << "\": ";
10141015 error("Unknown leaf value for tree pattern!");
10151016 }
10161017 }
10801081 OS << "]\n";
10811082 }
10821083
1083 void TreePattern::dump() const { print(std::cerr); }
1084 void TreePattern::dump() const { print(*cerr.stream()); }
10841085
10851086
10861087
16211622 if (I == 0) continue; // No pattern.
16221623
16231624 if (I->getNumTrees() != 1) {
1624 std::cerr << "CANNOT HANDLE: " << I->getRecord()->getName() << " yet!";
1625 cerr << "CANNOT HANDLE: " << I->getRecord()->getName() << " yet!";
16251626 continue;
16261627 }
16271628 TreePatternNode *Pattern = I->getTree(0);
19481949 // match multiple ways. Add them to PatternsToMatch as well.
19491950 void DAGISelEmitter::GenerateVariants() {
19501951
1951 DEBUG(std::cerr << "Generating instruction variants.\n");
1952 DOUT << "Generating instruction variants.\n";
19521953
19531954 // Loop over all of the patterns we've collected, checking to see if we can
19541955 // generate variants of the instruction, through the exploitation of
19691970 if (Variants.empty()) // No variants for this pattern.
19701971 continue;
19711972
1972 DEBUG(std::cerr << "FOUND VARIANTS OF: ";
1973 PatternsToMatch[i].getSrcPattern()->dump();
1974 std::cerr << "\n");
1973 DOUT << "FOUND VARIANTS OF: ";
1974 DEBUG(PatternsToMatch[i].getSrcPattern()->dump());
1975 DOUT << "\n";
19751976
19761977 for (unsigned v = 0, e = Variants.size(); v != e; ++v) {
19771978 TreePatternNode *Variant = Variants[v];
19781979
1979 DEBUG(std::cerr << " VAR#" << v << ": ";
1980 Variant->dump();
1981 std::cerr << "\n");
1980 DOUT << " VAR#" << v << ": ";
1981 DEBUG(Variant->dump());
1982 DOUT << "\n";
19821983
19831984 // Scan to see if an instruction or explicit pattern already matches this.
19841985 bool AlreadyExists = false;
19851986 for (unsigned p = 0, e = PatternsToMatch.size(); p != e; ++p) {
19861987 // Check to see if this variant already exists.
19871988 if (Variant->isIsomorphicTo(PatternsToMatch[p].getSrcPattern())) {
1988 DEBUG(std::cerr << " *** ALREADY EXISTS, ignoring variant.\n");
1989 DOUT << " *** ALREADY EXISTS, ignoring variant.\n";
19891990 AlreadyExists = true;
19901991 break;
19911992 }
20002001 PatternsToMatch[i].getAddedComplexity()));
20012002 }
20022003
2003 DEBUG(std::cerr << "\n");
2004 DOUT << "\n";
20042005 }
20052006 }
20062007
21592160 Record *DAGISelEmitter::getSDNodeNamed(const std::string &Name) const {
21602161 Record *N = Records.getDef(Name);
21612162 if (!N || !N->isSubClassOf("SDNode")) {
2162 std::cerr << "Error getting SDNode '" << Name << "'!\n";
2163 cerr << "Error getting SDNode '" << Name << "'!\n";
21632164 exit(1);
21642165 }
21652166 return N;
25682569 } else {
25692570 #ifndef NDEBUG
25702571 Child->dump();
2571 std::cerr << " ";
2572 cerr << " ";
25722573 #endif
25732574 assert(0 && "Unknown leaf type!");
25742575 }
30673068 return NodeOps;
30683069 } else {
30693070 N->dump();
3070 std::cerr << "\n";
3071 cerr << "\n";
30713072 throw std::string("Unknown node in result pattern!");
30723073 }
30733074 }
34423443 &PatternsToMatch[i]);
34433444 }
34443445 } else {
3445 std::cerr << "Unrecognized opcode '";
3446 cerr << "Unrecognized opcode '";
34463447 Node->dump();
3447 std::cerr << "' on tree pattern '";
3448 std::cerr <<
3449 PatternsToMatch[i].getDstPattern()->getOperator()->getName();
3450 std::cerr << "'!\n";
3448 cerr << "' on tree pattern '";
3449 cerr << PatternsToMatch[i].getDstPattern()->getOperator()->getName();
3450 cerr << "'!\n";
34513451 exit(1);
34523452 }
34533453 }
35333533 // If this pattern definitely matches, and if it isn't the last one, the
35343534 // patterns after it CANNOT ever match. Error out.
35353535 if (mightNotMatch == false && i != CodeForPatterns.size()-1) {
3536 std::cerr << "Pattern '";
3537 CodeForPatterns[i].first->getSrcPattern()->print(std::cerr);
3538 std::cerr << "' is impossible to select!\n";
3536 cerr << "Pattern '";
3537 CodeForPatterns[i].first->getSrcPattern()->print(*cerr.stream());
3538 cerr << "' is impossible to select!\n";
35393539 exit(1);
35403540 }
35413541 }
36493649 // If the last pattern has predicates (which could fail) emit code to
36503650 // catch the case where nothing handles a pattern.
36513651 if (mightNotMatch) {
3652 OS << " std::cerr << \"Cannot yet select: \";\n";
3652 OS << " cerr << \"Cannot yet select: \";\n";
36533653 if (OpName != "ISD::INTRINSIC_W_CHAIN" &&
36543654 OpName != "ISD::INTRINSIC_WO_CHAIN" &&
36553655 OpName != "ISD::INTRINSIC_VOID") {
36573657 } else {
36583658 OS << " unsigned iid = cast(N.getOperand("
36593659 "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n"
3660 << " std::cerr << \"intrinsic %\"<< "
3660 << " cerr << \"intrinsic %\"<< "
36613661 "Intrinsic::getName((Intrinsic::ID)iid);\n";
36623662 }
3663 OS << " std::cerr << '\\n';\n"
3663 OS << " cerr << '\\n';\n"
36643664 << " abort();\n"
36653665 << " return NULL;\n";
36663666 }
37793779 }
37803780
37813781 OS << " } // end of big switch.\n\n"
3782 << " std::cerr << \"Cannot yet select: \";\n"
3782 << " cerr << \"Cannot yet select: \";\n"
37833783 << " if (N.getOpcode() != ISD::INTRINSIC_W_CHAIN &&\n"
37843784 << " N.getOpcode() != ISD::INTRINSIC_WO_CHAIN &&\n"
37853785 << " N.getOpcode() != ISD::INTRINSIC_VOID) {\n"
37873787 << " } else {\n"
37883788 << " unsigned iid = cast(N.getOperand("
37893789 "N.getOperand(0).getValueType() == MVT::Other))->getValue();\n"
3790 << " std::cerr << \"intrinsic %\"<< "
3791 "Intrinsic::getName((Intrinsic::ID)iid);\n"
3790 << " cerr << \"intrinsic %\"<< "
3791 "Intrinsic::getName((Intrinsic::ID)iid);\n"
37923792 << " }\n"
3793 << " std::cerr << '\\n';\n"
3793 << " cerr << '\\n';\n"
37943794 << " abort();\n"
37953795 << " return NULL;\n"
37963796 << "}\n";
39363936 // multiple ways. Add them to PatternsToMatch as well.
39373937 GenerateVariants();
39383938
3939
3940 DEBUG(std::cerr << "\n\nALL PATTERNS TO MATCH:\n\n";
3941 for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) {
3942 std::cerr << "PATTERN: "; PatternsToMatch[i].getSrcPattern()->dump();
3943 std::cerr << "\nRESULT: ";PatternsToMatch[i].getDstPattern()->dump();
3944 std::cerr << "\n";
3945 });
3939 DOUT << "\n\nALL PATTERNS TO MATCH:\n\n";
3940 for (unsigned i = 0, e = PatternsToMatch.size(); i != e; ++i) {
3941 DOUT << "PATTERN: "; DEBUG(PatternsToMatch[i].getSrcPattern()->dump());
3942 DOUT << "\nRESULT: "; DEBUG(PatternsToMatch[i].getDstPattern()->dump());
3943 DOUT << "\n";
3944 }
39463945
39473946 // At this point, we have full information about the 'Patterns' we need to
39483947 // parse, both implicitly from instructions as well as from explicit pattern
500500 #define YY_MORE_ADJ 0
501501 #define YY_RESTORE_YY_MORE_OFFSET
502502 char *yytext;
503 #line 1 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
503 #line 1 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
504504 #define INITIAL 0
505505 /*===-- FileLexer.l - Scanner for TableGen Files ----------------*- C++ -*-===//
506506 //
518518 #define YY_NEVER_INTERACTIVE 1
519519 #define comment 1
520520
521 #line 30 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
521 #line 30 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
522522 #include "llvm/Config/config.h"
523 #include "llvm/Support/Streams.h"
523524 #include "Record.h"
524525 typedef std::pair*> SubClassRefTy;
525526 #include "FileParser.h"
555556 static std::vector IncludeStack;
556557
557558 std::ostream &err() {
558 if (IncludeStack.empty())
559 return std::cerr << "At end of input: ";
559 if (IncludeStack.empty()) {
560 cerr << "At end of input: ";
561 return *cerr.stream();
562 }
560563
561564 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
562 std::cerr << "Included from " << IncludeStack[i].Filename << ":"
563 << IncludeStack[i].LineNo << ":\n";
564 return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
565 << Filelineno << ": ";
565 cerr << "Included from " << IncludeStack[i].Filename << ":"
566 << IncludeStack[i].LineNo << ":\n";
567 cerr << "Parsing " << IncludeStack.back().Filename << ":"
568 << Filelineno << ": ";
569 return *cerr.stream();
566570 }
567571
568572 /// ParseFile - this function begins the parsing of the specified tablegen file.
574578 F = fopen(Filename.c_str(), "r");
575579
576580 if (F == 0) {
577 std::cerr << "Could not open input file '" + Filename + "'!\n";
581 cerr << "Could not open input file '" + Filename + "'!\n";
578582 exit (1);
579583 }
580584 IncludeStack.push_back(IncludeRec(Filename, F));
606610 }
607611 assert(Length >= 2 && "Double quotes not found?");
608612 std::string Filename(Buffer+1, Buffer+Length-1);
609 //std::cerr << "Filename = '" << Filename << "'\n";
613 //cerr << "Filename = '" << Filename << "'\n";
610614
611615 // Save the line number and lex buffer of the includer...
612616 IncludeStack.back().LineNo = Filelineno;
660664
661665 using namespace llvm;
662666
663 #line 665 "Lexer.cpp"
667 #line 669 "Lexer.cpp"
664668
665669 /* Macros after this point can all be overridden by user definitions in
666670 * section 1.
811815 register char *yy_cp, *yy_bp;
812816 register int yy_act;
813817
814 #line 181 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
815
816
817 #line 819 "Lexer.cpp"
818 #line 185 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
819
820
821 #line 823 "Lexer.cpp"
818822
819823 if ( yy_init )
820824 {
907911 { /* beginning of action switch */
908912 case 1:
909913 YY_RULE_SETUP
910 #line 183 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
914 #line 187 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
911915 { /* Ignore comments */ }
912916 YY_BREAK
913917 case 2:
914918 YY_RULE_SETUP
915 #line 185 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
919 #line 189 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
916920 { HandleInclude(yytext); }
917921 YY_BREAK
918922 case 3:
919923 YY_RULE_SETUP
920 #line 186 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
924 #line 190 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
921925 { Filelval.StrVal = new std::string(yytext+2, yytext+yyleng-2);
922926 return CODEFRAGMENT; }
923927 YY_BREAK
924928 case 4:
925929 YY_RULE_SETUP
926 #line 189 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
930 #line 193 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
927931 { return INT; }
928932 YY_BREAK
929933 case 5:
930934 YY_RULE_SETUP
931 #line 190 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
935 #line 194 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
932936 { return BIT; }
933937 YY_BREAK
934938 case 6:
935939 YY_RULE_SETUP
936 #line 191 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
940 #line 195 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
937941 { return BITS; }
938942 YY_BREAK
939943 case 7:
940944 YY_RULE_SETUP
941 #line 192 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
945 #line 196 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
942946 { return STRING; }
943947 YY_BREAK
944948 case 8:
945949 YY_RULE_SETUP
946 #line 193 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
950 #line 197 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
947951 { return LIST; }
948952 YY_BREAK
949953 case 9:
950954 YY_RULE_SETUP
951 #line 194 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
955 #line 198 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
952956 { return CODE; }
953957 YY_BREAK
954958 case 10:
955959 YY_RULE_SETUP
956 #line 195 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
960 #line 199 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
957961 { return DAG; }
958962 YY_BREAK
959963 case 11:
960964 YY_RULE_SETUP
961 #line 197 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
965 #line 201 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
962966 { return CLASS; }
963967 YY_BREAK
964968 case 12:
965969 YY_RULE_SETUP
966 #line 198 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
970 #line 202 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
967971 { return DEF; }
968972 YY_BREAK
969973 case 13:
970974 YY_RULE_SETUP
971 #line 199 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
975 #line 203 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
972976 { return DEFM; }
973977 YY_BREAK
974978 case 14:
975979 YY_RULE_SETUP
976 #line 200 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
980 #line 204 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
977981 { return MULTICLASS; }
978982 YY_BREAK
979983 case 15:
980984 YY_RULE_SETUP
981 #line 201 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
985 #line 205 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
982986 { return FIELD; }
983987 YY_BREAK
984988 case 16:
985989 YY_RULE_SETUP
986 #line 202 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
990 #line 206 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
987991 { return LET; }
988992 YY_BREAK
989993 case 17:
990994 YY_RULE_SETUP
991 #line 203 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
995 #line 207 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
992996 { return IN; }
993997 YY_BREAK
994998 case 18:
995999 YY_RULE_SETUP
996 #line 205 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1000 #line 209 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
9971001 { return SRATOK; }
9981002 YY_BREAK
9991003 case 19:
10001004 YY_RULE_SETUP
1001 #line 206 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1005 #line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10021006 { return SRLTOK; }
10031007 YY_BREAK
10041008 case 20:
10051009 YY_RULE_SETUP
1006 #line 207 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1010 #line 211 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10071011 { return SHLTOK; }
10081012 YY_BREAK
10091013 case 21:
10101014 YY_RULE_SETUP
1011 #line 208 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1015 #line 212 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10121016 { return STRCONCATTOK; }
10131017 YY_BREAK
10141018 case 22:
10151019 YY_RULE_SETUP
1016 #line 211 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1020 #line 215 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10171021 { Filelval.StrVal = new std::string(yytext, yytext+yyleng);
10181022 return ID; }
10191023 YY_BREAK
10201024 case 23:
10211025 YY_RULE_SETUP
1022 #line 213 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1026 #line 217 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10231027 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng);
10241028 return VARNAME; }
10251029 YY_BREAK
10261030 case 24:
10271031 YY_RULE_SETUP
1028 #line 216 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1032 #line 220 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10291033 { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1);
10301034 return STRVAL; }
10311035 YY_BREAK
10321036 case 25:
10331037 YY_RULE_SETUP
1034 #line 219 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1038 #line 223 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10351039 { Filelval.IntVal = ParseInt(Filetext); return INTVAL; }
10361040 YY_BREAK
10371041 case 26:
10381042 YY_RULE_SETUP
1039 #line 221 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1043 #line 225 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10401044 { /* Ignore whitespace */ }
10411045 YY_BREAK
10421046 case 27:
10431047 YY_RULE_SETUP
1044 #line 224 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1048 #line 228 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10451049 { BEGIN(comment); CommentDepth++; }
10461050 YY_BREAK
10471051 case 28:
10481052 YY_RULE_SETUP
1049 #line 225 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1053 #line 229 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10501054 {} /* eat anything that's not a '*' or '/' */
10511055 YY_BREAK
10521056 case 29:
10531057 YY_RULE_SETUP
1054 #line 226 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1058 #line 230 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10551059 {} /* eat up '*'s not followed by '/'s */
10561060 YY_BREAK
10571061 case 30:
10581062 YY_RULE_SETUP
1059 #line 227 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1063 #line 231 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10601064 { ++CommentDepth; }
10611065 YY_BREAK
10621066 case 31:
10631067 YY_RULE_SETUP
1064 #line 228 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1068 #line 232 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10651069 {} /* eat up /'s not followed by *'s */
10661070 YY_BREAK
10671071 case 32:
10681072 YY_RULE_SETUP
1069 #line 229 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1073 #line 233 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10701074 { if (!--CommentDepth) { BEGIN(INITIAL); } }
10711075 YY_BREAK
10721076 case YY_STATE_EOF(comment):
1073 #line 230 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1077 #line 234 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10741078 { err() << "Unterminated comment!\n"; exit(1); }
10751079 YY_BREAK
10761080 case 33:
10771081 YY_RULE_SETUP
1078 #line 232 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1082 #line 236 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10791083 { return Filetext[0]; }
10801084 YY_BREAK
10811085 case 34:
10821086 YY_RULE_SETUP
1083 #line 234 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1087 #line 238 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
10841088 YY_FATAL_ERROR( "flex scanner jammed" );
10851089 YY_BREAK
1086 #line 1088 "Lexer.cpp"
1090 #line 1092 "Lexer.cpp"
10871091 case YY_STATE_EOF(INITIAL):
10881092 yyterminate();
10891093
15071511 case EOB_ACT_END_OF_FILE:
15081512 {
15091513 if ( yywrap() )
1510 return EOF;
1514 return 0;
15111515
15121516 if ( ! yy_did_buffer_switch_on_eof )
15131517 YY_NEW_FILE;
19671971 return 0;
19681972 }
19691973 #endif
1970 #line 234 "/Users/sabre/cvs/llvm/utils/TableGen/FileLexer.l"
1971
1972
1974 #line 238 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileLexer.l"
1975
1976
2727
2828 %{
2929 #include "llvm/Config/config.h"
30 #include "llvm/Support/Streams.h"
3031 #include "Record.h"
3132 typedef std::pair*> SubClassRefTy;
3233 #include "FileParser.h"
6263 static std::vector IncludeStack;
6364
6465 std::ostream &err() {
65 if (IncludeStack.empty())
66 return std::cerr << "At end of input: ";
66 if (IncludeStack.empty()) {
67 cerr << "At end of input: ";
68 return *cerr.stream();
69 }
6770
6871 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
69 std::cerr << "Included from " << IncludeStack[i].Filename << ":"
70 << IncludeStack[i].LineNo << ":\n";
71 return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
72 << Filelineno << ": ";
72 cerr << "Included from " << IncludeStack[i].Filename << ":"
73 << IncludeStack[i].LineNo << ":\n";
74 cerr << "Parsing " << IncludeStack.back().Filename << ":"
75 << Filelineno << ": ";
76 return *cerr.stream();
7377 }
7478
7579 /// ParseFile - this function begins the parsing of the specified tablegen file.
8185 F = fopen(Filename.c_str(), "r");
8286
8387 if (F == 0) {
84 std::cerr << "Could not open input file '" + Filename + "'!\n";
88 cerr << "Could not open input file '" + Filename + "'!\n";
8589 exit (1);
8690 }
8791 IncludeStack.push_back(IncludeRec(Filename, F));
113117 }
114118 assert(Length >= 2 && "Double quotes not found?");
115119 std::string Filename(Buffer+1, Buffer+Length-1);
116 //std::cerr << "Filename = '" << Filename << "'\n";
120 //cerr << "Filename = '" << Filename << "'\n";
117121
118122 // Save the line number and lex buffer of the includer...
119123 IncludeStack.back().LineNo = Filelineno;
2727
2828 %{
2929 #include "llvm/Config/config.h"
30 #include "llvm/Support/Streams.h"
3031 #include "Record.h"
3132 typedef std::pair*> SubClassRefTy;
3233 #include "FileParser.h"
6263 static std::vector IncludeStack;
6364
6465 std::ostream &err() {
65 if (IncludeStack.empty())
66 return std::cerr << "At end of input: ";
66 if (IncludeStack.empty()) {
67 cerr << "At end of input: ";
68 return *cerr.stream();
69 }
6770
6871 for (unsigned i = 0, e = IncludeStack.size()-1; i != e; ++i)
69 std::cerr << "Included from " << IncludeStack[i].Filename << ":"
70 << IncludeStack[i].LineNo << ":\n";
71 return std::cerr << "Parsing " << IncludeStack.back().Filename << ":"
72 << Filelineno << ": ";
72 cerr << "Included from " << IncludeStack[i].Filename << ":"
73 << IncludeStack[i].LineNo << ":\n";
74 cerr << "Parsing " << IncludeStack.back().Filename << ":"
75 << Filelineno << ": ";
76 return *cerr.stream();
7377 }
7478
7579 /// ParseFile - this function begins the parsing of the specified tablegen file.
8185 F = fopen(Filename.c_str(), "r");
8286
8387 if (F == 0) {
84 std::cerr << "Could not open input file '" + Filename + "'!\n";
88 cerr << "Could not open input file '" + Filename + "'!\n";
8589 exit (1);
8690 }
8791 IncludeStack.push_back(IncludeRec(Filename, F));
113117 }
114118 assert(Length >= 2 && "Double quotes not found?");
115119 std::string Filename(Buffer+1, Buffer+Length-1);
116 //std::cerr << "Filename = '" << Filename << "'\n";
120 //cerr << "Filename = '" << Filename << "'\n";
117121
118122 // Save the line number and lex buffer of the includer...
119123 IncludeStack.back().LineNo = Filelineno;
None
1 /* A Bison parser, made from /Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y
2 by GNU Bison version 1.28 */
3
4 #define YYBISON 1 /* Identify Bison output. */
5
0 /* A Bison parser, made by GNU Bison 2.3. */
1
2 /* Skeleton implementation for Bison's Yacc-like parsers in C
3
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5 Free Software Foundation, Inc.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
21
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45 /* Identify Bison output. */
46 #define YYBISON 1
47
48 /* Bison version. */
49 #define YYBISON_VERSION "2.3"
50
51 /* Skeleton name. */
52 #define YYSKELETON_NAME "yacc.c"
53
54 /* Pure parsers. */
55 #define YYPURE 0
56
57 /* Using locations. */
58 #define YYLSP_NEEDED 0
59
60 /* Substitute the variable and function names. */
661 #define yyparse Fileparse
7 #define yylex Filelex
62 #define yylex Filelex
863 #define yyerror Fileerror
9 #define yylval Filelval
10 #define yychar Filechar
64 #define yylval Filelval
65 #define yychar Filechar
1166 #define yydebug Filedebug
1267 #define yynerrs Filenerrs
13 #define INT 257
14 #define BIT 258
15 #define STRING 259
16 #define BITS 260
17 #define LIST 261
18 #define CODE 262
19 #define DAG 263
20 #define CLASS 264
21 #define DEF 265
22 #define MULTICLASS 266
23 #define DEFM 267
24 #define FIELD 268
25 #define LET 269
26 #define IN 270
27 #define SHLTOK 271
28 #define SRATOK 272
29 #define SRLTOK 273
30 #define STRCONCATTOK 274
31 #define INTVAL 275
32 #define ID 276
33 #define VARNAME 277
34 #define STRVAL 278
35 #define CODEFRAGMENT 279
36
37 #line 14 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
68
69
70 /* Tokens. */
71 #ifndef YYTOKENTYPE
72 # define YYTOKENTYPE
73 /* Put the tokens into the symbol table, so that GDB and other debuggers
74 know about them. */
75 enum yytokentype {
76 INT = 258,
77 BIT = 259,
78 STRING = 260,
79 BITS = 261,
80 LIST = 262,
81 CODE = 263,
82 DAG = 264,
83 CLASS = 265,
84 DEF = 266,
85 MULTICLASS = 267,
86 DEFM = 268,
87 FIELD = 269,
88 LET = 270,
89 IN = 271,
90 SHLTOK = 272,
91 SRATOK = 273,
92 SRLTOK = 274,
93 STRCONCATTOK = 275,
94 INTVAL = 276,
95 ID = 277,
96 VARNAME = 278,
97 STRVAL = 279,
98 CODEFRAGMENT = 280
99 };
100 #endif
101 /* Tokens. */
102 #define INT 258
103 #define BIT 259
104 #define STRING 260
105 #define BITS 261
106 #define LIST 262
107 #define CODE 263
108 #define DAG 264
109 #define CLASS 265
110 #define DEF 266
111 #define MULTICLASS 267
112 #define DEFM 268
113 #define FIELD 269
114 #define LET 270
115 #define IN 271
116 #define SHLTOK 272
117 #define SRATOK 273
118 #define SRLTOK 274
119 #define STRCONCATTOK 275
120 #define INTVAL 276
121 #define ID 277
122 #define VARNAME 278
123 #define STRVAL 279
124 #define CODEFRAGMENT 280
125
126
127
128
129 /* Copy the first part of user declarations. */
130 #line 14 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
38131
39132 #include "Record.h"
40133 #include "llvm/ADT/StringExtras.h"
134 #include "llvm/Support/Streams.h"
41135 #include
42136 #include
43137 #define YYERROR_VERBOSE 1
148242 }
149243
150244 // We should have a BitsInit type now...
151 assert(dynamic_cast(BI) != 0 || &(std::cerr << *BI) == 0);
245 assert(dynamic_cast(BI) != 0 || (cerr << *BI).stream() == 0);
152246 BitsInit *BInit = (BitsInit*)BI;
153247
154248 BitsInit *NewVal = new BitsInit(CurVal->getNumBits());
229323 using namespace llvm;
230324
231325
232 #line 209 "/Volumes/ProjectsDisk/cvs/llvm/utils/TableGen/FileParser.y"
233 typedef union {
326
327 /* Enabling traces. */
328 #ifndef YYDEBUG
329 # define YYDEBUG 0
330 #endif
331
332 /* Enabling verbose error messages. */
333 #ifdef YYERROR_VERBOSE
334 # undef YYERROR_VERBOSE
335 # define YYERROR_VERBOSE 1
336 #else
337 # define YYERROR_VERBOSE 0
338 #endif
339
340 /* Enabling the token table. */
341 #ifndef YYTOKEN_TABLE
342 # define YYTOKEN_TABLE 0
343 #endif
344
345 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
346 typedef union YYSTYPE
347 #line 210 "/Volumes/Gir/devel/llvm/llvm.src/utils/TableGen/FileParser.y"
348 {
234349 std::string* StrVal;
235350 int IntVal;
236351 llvm::RecTy* Ty;
242357 SubClassRefTy* SubClassRef;
243358 std::vector* SubClassList;
244359 std::vector >* DagValueList;
245 } YYSTYPE;
246 #include
247
248 #ifndef __cplusplus
249 #ifndef __STDC__
250 #define const
251 #endif
252 #endif
253
254
255
256 #define YYFINAL 188
257 #define YYFLAG -32768
258 #define YYNTBASE 41
259
260 #define YYTRANSLATE(x) ((unsigned)(x) <= 279 ? yytranslate[x] : 90)
261
262 static const char yytranslate[] = { 0,
263 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 35,
267 36, 2, 2, 37, 39, 34, 2, 2, 2, 2,
268 2, 2, 2, 2, 2, 2, 2, 38, 40, 26,
269 28, 27, 29, 2, 2, 2, 2, 2, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 32, 2, 33, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 30, 2, 31, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
289 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
290 17, 18, 19, 20, 21, 22, 23, 24, 25
360 }
361 /* Line 193 of yacc.c. */
362 #line 364 "FileParser.tab.c"
363 YYSTYPE;
364 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
365 # define YYSTYPE_IS_DECLARED 1
366 # define YYSTYPE_IS_TRIVIAL 1
367 #endif
368
369
370
371 /* Copy the second part of user declarations. */
372
373
374 /* Line 216 of yacc.c. */
375 #line 377 "FileParser.tab.c"
376
377 #ifdef short
378 # undef short
379 #endif
380
381 #ifdef YYTYPE_UINT8
382 typedef YYTYPE_UINT8 yytype_uint8;
383 #else
384 typedef unsigned char yytype_uint8;
385 #endif
386
387 #ifdef YYTYPE_INT8
388 typedef YYTYPE_INT8 yytype_int8;
389 #elif (defined __STDC__ || defined __C99__FUNC__ \
390 || defined __cplusplus || defined _MSC_VER)
391 typedef signed char yytype_int8;
392 #else
393 typedef short int yytype_int8;
394 #endif
395
396 #ifdef YYTYPE_UINT16
397 typedef YYTYPE_UINT16 yytype_uint16;
398 #else
399 typedef unsigned short int yytype_uint16;
400 #endif
401
402 #ifdef YYTYPE_INT16
403 typedef YYTYPE_INT16 yytype_int16;
404 #else
405 typedef short int yytype_int16;
406 #endif
407
408 #ifndef YYSIZE_T
409 # ifdef __SIZE_TYPE__
410 # define YYSIZE_T __SIZE_TYPE__
411 # elif defined size_t
412 # define YYSIZE_T size_t
413 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
414 || defined __cplusplus || defined _MSC_VER)
415 # include /* INFRINGES ON USER NAME SPACE */
416 # define YYSIZE_T size_t
417 # else
418 # define YYSIZE_T unsigned int
419 # endif
420 #endif
421
422 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
423
424 #ifndef YY_
425 # if YYENABLE_NLS
426 # if ENABLE_NLS
427 # include /* INFRINGES ON USER NAME SPACE */
428 # define YY_(msgid) dgettext ("bison-runtime", msgid)
429 # endif
430 # endif
431 # ifndef YY_
432 # define YY_(msgid) msgid
433 # endif
434 #endif
435
436 /* Suppress unused-variable warnings by "using" E. */
437 #if ! defined lint || defined __GNUC__
438 # define YYUSE(e) ((void) (e))
439 #else
440 # define YYUSE(e) /* empty */
441 #endif
442
443 /* Identity function, used to suppress warnings about constant conditions. */
444 #ifndef lint
445 # define YYID(n) (n)
446 #else
447 #if (defined __STDC__ || defined __C99__FUNC__ \
448 || defined __cplusplus || defined _MSC_VER)
449 static int
450 YYID (int i)
451 #else
452 static int
453 YYID (i)
454 int i;
455 #endif
456 {
457 return i;
458 }
459 #endif
460
461 #if ! defined yyoverflow || YYERROR_VERBOSE
462
463 /* The parser invokes alloca or malloc; define the necessary symbols. */
464
465 # ifdef YYSTACK_USE_ALLOCA
466 # if YYSTACK_USE_ALLOCA
467 # ifdef __GNUC__
468 # define YYSTACK_ALLOC __builtin_alloca
469 # elif defined __BUILTIN_VA_ARG_INCR
470 # include /* INFRINGES ON USER NAME SPACE */
471 # elif defined _AIX
472 # define YYSTACK_ALLOC __alloca
473 # elif defined _MSC_VER
474 # include /* INFRINGES ON USER NAME SPACE */
475 # define alloca _alloca
476 # else
477 # define YYSTACK_ALLOC alloca
478 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
479 || defined __cplusplus || defined _MSC_VER)
480 # include /* INFRINGES ON USER NAME SPACE */
481 # ifndef _STDLIB_H
482 # define _STDLIB_H 1
483 # endif
484 # endif
485 # endif
486 # endif
487 # endif
488
489 # ifdef YYSTACK_ALLOC
490 /* Pacify GCC's `empty if-body' warning. */
491 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
492 # ifndef YYSTACK_ALLOC_MAXIMUM
493 /* The OS might guarantee only one guard page at the bottom of the stack,
494 and a page size can be as small as 4096 bytes. So we cannot safely
495 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
496 to allow for a few compiler-allocated temporary stack slots. */
497 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
498 # endif
499 # else
500 # define YYSTACK_ALLOC YYMALLOC
501 # define YYSTACK_FREE YYFREE
502 # ifndef YYSTACK_ALLOC_MAXIMUM
503 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
504 # endif
505 # if (defined __cplusplus && ! defined _STDLIB_H \
506 && ! ((defined YYMALLOC || defined malloc) \
507 && (defined YYFREE || defined free)))
508 # include /* INFRINGES ON USER NAME SPACE */
509 # ifndef _STDLIB_H
510 # define _STDLIB_H 1
511 # endif
512 # endif
513 # ifndef YYMALLOC
514 # define YYMALLOC malloc
515 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
518 # endif
519 # endif
520 # ifndef YYFREE
521 # define YYFREE free
522 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
523 || defined __cplusplus || defined _MSC_VER)
524 void free (void *); /* INFRINGES ON USER NAME SPACE */
525 # endif
526 # endif
527 # endif
528 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
529
530
531 #if (! defined yyoverflow \
532 && (! defined __cplusplus \
533 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
534
535 /* A type that is properly aligned for any stack member. */
536 union yyalloc
537 {
538 yytype_int16 yyss;
539 YYSTYPE yyvs;
540 };
541
542 /* The size of the maximum gap between one aligned stack and the next. */
543 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
544
545 /* The size of an array large to enough to hold all stacks, each with
546 N elements. */
547 # define YYSTACK_BYTES(N) \
548 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
549 + YYSTACK_GAP_MAXIMUM)
550
551 /* Copy COUNT objects from FROM to TO. The source and destination do
552 not overlap. */
553 # ifndef YYCOPY
554 # if defined __GNUC__ && 1 < __GNUC__
555 # define YYCOPY(To, From, Count) \
556 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
557 # else
558 # define YYCOPY(To, From, Count) \
559 do \
560 { \
561 YYSIZE_T yyi; \
562 for (yyi = 0; yyi < (Count); yyi++) \
563 (To)[yyi] = (From)[yyi]; \
564 } \
565 while (YYID (0))
566 # endif
567 # endif
568
569 /* Relocate STACK from its old location to the new one. The
570 local variables YYSIZE and YYSTACKSIZE give the old and new number of
571 elements in the stack, and YYPTR gives the new location of the
572 stack. Advance YYPTR to a properly aligned location for the next
573 stack. */
574 # define YYSTACK_RELOCATE(Stack) \
575 do \
576 { \
577 YYSIZE_T yynewbytes; \
578 YYCOPY (&yyptr->Stack, Stack, yysize); \
579 Stack = &yyptr->Stack; \
580 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
581 yyptr += yynewbytes / sizeof (*yyptr); \
582 } \
583 while (YYID (0))
584
585 #endif
586
587 /* YYFINAL -- State number of the termination state. */
588 #define YYFINAL 27
589 /* YYLAST -- Last index in YYTABLE. */
590 #define YYLAST 204
591
592 /* YYNTOKENS -- Number of terminals. */
593 #define YYNTOKENS 41
594 /* YYNNTS -- Number of nonterminals. */
595 #define YYNNTS 50
596 /* YYNRULES -- Number of rules. */
597 #define YYNRULES 102
598 /* YYNRULES -- Number of states. */
599 #define YYNSTATES 188
600
601 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
602 #define YYUNDEFTOK 2
603 #define YYMAXUTOK 280
604
605 #define YYTRANSLATE(YYX) \
606 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
607
608 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
609 static const yytype_uint8 yytranslate[] =
610 {
611 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 35, 36, 2, 2, 37, 39, 34, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 38, 40,
617 26, 28, 27, 29, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 32, 2, 33, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 30, 2, 31, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
637 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
638 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
639 25
291640 };
292641
293 #if YYDEBUG != 0
294 static const short yyprhs[] = { 0,
295 0, 2, 4, 6, 11, 13, 18, 20, 22, 24,
296 25, 27, 28, 31, 33, 35, 37, 39, 41, 43,
297 47, 52, 57, 61, 65, 70, 75, 82, 89, 96,
298 103, 104, 107, 110, 115, 116, 118, 120, 124, 127,
299 131, 137, 142, 144, 145, 149, 150, 152, 154, 158,
300 163, 166, 173, 174, 177, 179, 183, 185, 190, 192,
301 196, 197, 200, 202, 206, 210, 211, 213, 215, 216,
302 218, 220, 222, 223, 227, 228, 229, 236, 240, 242,
303 244, 247, 249, 250, 251, 260, 261, 268, 270, 272,
304 274, 276, 281, 283, 287, 288, 293, 298, 301, 303,
305 306
642 #if YYDEBUG
643 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
644 YYRHS. */
645 static const yytype_uint16 yyprhs[] =
646 {
647 0, 0, 3, 5, 7, 9, 14, 16, 21, 23,
648 25, 27, 28, 30, 31, 34, 36, 38, 40, 42,
649 44, 46, 50, 55, 60, 64, 68, 73, 78, 85,
650 92, 99, 106, 107, 110, 113, 118, 119, 121, 123,
651 127, 130, 134, 140, 145, 147, 148, 152, 153, 155,
652 157, 161, 166, 169, 176, 177, 180, 182, 186, 188,
653 193, 195, 199, 200, 203, 205, 209, 213, 214, 216,
654 218, 219, 221, 223, 225, 226, 230, 231, 232, 239,
655 243, 245, 247, 250, 252, 253, 254, 263, 264, 271,
656 273, 275, 277, 279, 284, 286, 290, 291, 296, 301,
657 304, 306, 309
306658 };
307659
308 static const short yyrhs[] = { 22,
309 0, 5, 0, 4, 0, 6, 26, 21, 27, 0,
310 3, 0, 7, 26, 42, 27, 0, 8, 0, 9,
311 0, 41, 0, 0, 14, 0, 0, 28, 46, 0,
312 22, 0, 45, 0, 21, 0, 24, 0, 25, 0,
313 29, 0, 30, 53, 31, 0, 22, 26, 54, 27,
314 0, 46, 30, 51, 31, 0, 32, 53, 33, 0,
315 46, 34, 22, 0, 35, 45, 49, 36, 0, 46,
316 32, 51, 33, 0, 17, 35, 46, 37, 46, 36,
317 0, 18, 35, 46, 37, 46, 36, 0, 19, 35,
318 46, 37, 46, 36, 0, 20, 35, 46, 37, 46,
319 36, 0, 0, 38, 23, 0, 46, 47, 0, 48,
320 37, 46, 47, 0, 0, 48, 0, 21, 0, 21,
321 39, 21, 0, 21, 21, 0, 50, 37, 21, 0,
322 50, 37, 21, 39, 21, 0, 50, 37, 21, 21,
323 0, 50, 0, 0, 30, 51, 31, 0, 0, 54,
324 0, 46, 0, 54, 37, 46, 0, 43, 42, 22,
325 44, 0, 55, 40, 0, 15, 22, 52, 28, 46,
326 40, 0, 0, 57, 56, 0, 40, 0, 30, 57,
327 31, 0, 41, 0, 41, 26, 54, 27, 0, 59,
328 0, 60, 37, 59, 0, 0, 38, 60, 0, 55,
329 0, 62, 37, 55, 0, 26, 62, 27, 0, 0,
330 63, 0, 22, 0, 0, 65, 0, 66, 0, 66,
331 0, 0, 61, 70, 58, 0, 0, 0, 10, 67,
332 72, 64, 73, 69, 0, 11, 68, 69, 0, 74,
333 0, 75, 0, 76, 75, 0, 22, 0, 0, 0,
334 12, 77, 79, 64, 80, 30, 76, 31, 0, 0,
335 13, 22, 82, 38, 59, 40, 0, 71, 0, 74,
336 0, 78, 0, 81, 0, 22, 52, 28, 46, 0,
337 84, 0, 85, 37, 84, 0, 0, 15, 87, 85,
338 16, 0, 86, 30, 88, 31, 0, 86, 83, 0,
339 83, 0, 88, 83, 0, 88, 0
660 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
661 static const yytype_int8 yyrhs[] =
662 {
663 90, 0, -1, 22, -1, 5, -1, 4, -1, 6,
664 26, 21, 27, -1, 3, -1, 7, 26, 43, 27,
665 -1, 8, -1, 9, -1, 42, -1, -1, 14, -1,
666 -1, 28, 47, -1, 22, -1, 46, -1, 21, -1,
667 24, -1, 25, -1, 29, -1, 30, 54, 31, -1,
668 22, 26, 55, 27, -1, 47, 30, 52, 31, -1,
669 32, 54, 33, -1, 47, 34, 22, -1, 35, 46,
670 50, 36, -1, 47, 32, 52, 33, -1, 17, 35,
671 47, 37, 47, 36, -1, 18, 35, 47, 37, 47,
672 36, -1, 19, 35, 47, 37, 47, 36, -1, 20,
673 35, 47, 37, 47, 36, -1, -1, 38, 23, -1,
674 47, 48, -1, 49, 37, 47, 48, -1, -1, 49,
675 -1, 21, -1, 21, 39, 21, -1, 21, 21, -1,
676 51, 37, 21, -1, 51, 37, 21, 39, 21, -1,
677 51, 37, 21, 21, -1, 51, -1, -1, 30, 52,
678 31, -1, -1, 55, -1, 47, -1, 55, 37, 47,
679 -1, 44, 43, 22, 45, -1, 56, 40, -1, 15,
680 22, 53, 28, 47, 40, -1, -1, 58, 57, -1,
681 40, -1, 30, 58, 31, -1, 42, -1, 42, 26,
682 55, 27, -1, 60, -1, 61, 37, 60, -1, -1,
683 38, 61, -1, 56, -1, 63, 37, 56, -1, 26,
684 63, 27, -1, -1, 64, -1, 22, -1, -1, 66,
685 -1, 67, -1, 67, -1, -1, 62, 71, 59, -1,
686 -1, -1, 10, 68, 73, 65, 74, 70, -1, 11,
687 69, 70, -1, 75, -1, 76, -1, 77, 76, -1,
688 22, -1, -1, -1, 12, 78, 80, 65, 81, 30,
689 77, 31, -1, -1, 13, 22, 83, 38, 60, 40,
690 -1, 72, -1, 75, -1, 79, -1, 82, -1, 22,
691 53, 28, 47, -1, 85, -1, 86, 37, 85, -1,
692 -1, 15, 88, 86, 16, -1, 87, 30, 89, 31,
693 -1, 87, 84, -1, 84, -1, 89, 84, -1, 89,
694 -1
340695 };
341696
342 #endif
343
344 #if YYDEBUG != 0
345 static const short yyrline[] = { 0,
346 245, 267, 269, 271, 273, 275, 277, 279, 281, 285,
347 285, 287, 287, 289, 312, 314, 316, 319, 322, 324,
348 337, 365, 372, 375, 382, 385, 393, 395, 397, 399,
349 403, 406, 410, 415, 421, 424, 427, 430, 443, 457,
350 459, 472, 488, 490, 490, 494, 496, 500, 503, 507,
351 524, 526, 532, 532, 533, 533, 535, 537, 541, 546,
352 551, 554, 558, 561, 566, 567, 567, 569, 569, 571,
353 578, 596, 621, 635, 640, 642, 644, 648, 658, 672,
354 675, 679, 690, 692, 694, 699, 699, 773, 773, 774,
355 774, 776, 781, 781, 784, 784, 787, 790, 794, 794,
356 796
697 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
698 static const yytype_uint16 yyrline[] =
699 {
700 0, 246, 246, 268, 270, 272, 274, 276, 278, 280,
701 282, 286, 286, 288, 288, 290, 313, 315, 317, 320,
702 323, 325, 338, 366, 373, 376, 383, 386, 394, 396,
703 398, 400, 404, 407, 411, 416, 422, 425, 428, 431,
704 444, 458, 460, 473, 489, 491, 491, 495, 497, 501,
705 504, 508, 525, 527, 533, 533, 534, 534, 536, 538,
706 542, 547, 552, 555, 559, 562, 567, 568, 568, 570,
707 570, 572, 579, 597, 622, 622, 641, 643, 641, 649,
708 659, 673, 676, 680, 691, 693, 691, 700, 700, 774,
709 774, 775, 775, 777, 782, 782, 785, 785, 788, 791,
710 795, 795, 797
357711 };
358712 #endif
359713
360
361 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
362
363 static const char * const yytname[] = { "$","error","$undefined.","INT","BIT",
364 "STRING","BITS","LIST","CODE","DAG","CLASS","DEF","MULTICLASS","DEFM","FIELD",
365 "LET","IN","SHLTOK","SRATOK","SRLTOK","STRCONCATTOK","INTVAL","ID","VARNAME",
366 "STRVAL","CODEFRAGMENT","'<'","'>'","'='","'?'","'{'","'}'","'['","']'","'.'",
367 "'('","')'","','","':'","'-'","';'","ClassID","Type","OptPrefix","OptValue",
368 "IDValue","Value","OptVarName","DagArgListNE","DagArgList","RBitList","BitList",
369 "OptBitList","ValueList","ValueListNE","Declaration","BodyItem","BodyList","Body",
370 "SubClassRef","ClassListNE","ClassList","DeclListNE","TemplateArgList","OptTemplateArgList",
371 "OptID","ObjectName","ClassName","DefName","ObjectBody","@1","ClassInst","@2",
372 "@3","DefInst","MultiClassDef","MultiClassBody","MultiClassName","MultiClassInst",
373 "@4","@5","DefMInst","@6","Object","LETItem","LETList","LETCommand","@7","ObjectList",
374 "File", NULL
714 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
715 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
716 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
717 static const char *const yytname[] =
718 {
719 "$end", "error", "$undefined", "INT", "BIT", "STRING", "BITS", "LIST",
720 "CODE", "DAG", "CLASS", "DEF", "MULTICLASS", "DEFM", "FIELD", "LET",
721 "IN", "SHLTOK", "SRATOK", "SRLTOK", "STRCONCATTOK", "INTVAL", "ID",
722 "VARNAME", "STRVAL", "CODEFRAGMENT", "'<'", "'>'", "'='", "'?'", "'{'",
723 "'}'", "'['", "']'", "'.'", "'('", "')'", "','", "':'", "'-'", "';'",
724 "$accept", "ClassID", "Type", "OptPrefix", "OptValue", "IDValue",
725 "Value", "OptVarName", "DagArgListNE", "DagArgList", "RBitList",
726 "BitList", "OptBitList", "ValueList", "ValueListNE", "Declaration",
727 "BodyItem", "BodyList", "Body", "SubClassRef", "ClassListNE",
728 "ClassList", "DeclListNE", "TemplateArgList", "OptTemplateArgList",
729 "OptID", "ObjectName", "ClassName", "DefName", "ObjectBody", "@1",
730 "ClassInst", "@2", "@3", "DefInst", "MultiClassDef", "MultiClassBody",
731 "MultiClassName", "MultiClassInst", "@4", "@5", "DefMInst", "@6",
732 "Object", "LETItem", "LETList", "LETCommand", "@7", "ObjectList", "File", 0
375733 };
376734 #endif
377735
378 static const short yyr1[] = { 0,
379 41, 42, 42, 42, 42, 42, 42, 42, 42, 43,
380 43, 44, 44, 45, 46, 46, 46, 46, 46, 46,
381 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
382 47, 47, 48, 48, 49, 49, 50, 50, 50, 50,
383 50, 50, 51, 52, 52, 53, 53, 54, 54, 55,
384 56, 56, 57, 57, 58, 58, 59, 59, 60, 60,
385 61, 61, 62, 62, 63, 64, 64, 65, 65, 66,
386 67, 68, 70, 69, 72, 73, 71, 74, 75, 76,
387 76, 77, 79, 80, 78, 82, 81, 83, 83, 83,
388 83, 84, 85, 85, 87, 86, 83, 83, 88, 88,
389 89
736 # ifdef YYPRINT
737 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
738 token YYLEX-NUM. */
739 static const yytype_uint16 yytoknum[] =
740 {
741 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
742 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
743 275, 276, 277, 278, 279, 280, 60, 62, 61, 63,
744 123, 125, 91, 93, 46, 40, 41, 44, 58, 45,
745 59
390746 };
391
392 static const short yyr2[] = { 0,
393 1, 1, 1, 4, 1, 4, 1, 1, 1, 0,
394 1, 0, 2, 1, 1, 1, 1, 1, 1, 3,
395 4, 4, 3, 3, 4, 4, 6, 6, 6, 6,
396 0, 2, 2, 4, 0, 1, 1, 3, 2, 3,
397 5, 4, 1, 0, 3, 0, 1, 1, 3, 4,
398 2, 6, 0, 2, 1, 3, 1, 4, 1, 3,
399 0, 2, 1, 3, 3, 0, 1, 1, 0, 1,
400 1, 1, 0, 3, 0, 0, 6, 3, 1, 1,
401 2, 1, 0, 0, 8, 0, 6, 1, 1, 1,
402 1, 4, 1, 3, 0, 4, 4, 2, 1, 2,
403 1
747 # endif
748
749 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
750 static const yytype_uint8 yyr1[] =
751 {
752 0, 41, 42, 43, 43, 43, 43, 43, 43, 43,
753 43, 44, 44, 45, 45, 46, 47, 47, 47, 47,
754 47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
755 47, 47, 48, 48, 49, 49, 50, 50, 51, 51,
756 51, 51, 51, 51, 52, 53, 53, 54, 54, 55,
757 55, 56, 57, 57, 58, 58, 59, 59, 60, 60,
758 61, 61, 62, 62, 63, 63, 64, 65, 65, 66,
759 66, 67, 68, 69, 71, 70, 73, 74, 72, 75,
760 76, 77, 77, 78, 80, 81, 79, 83, 82, 84,
761 84, 84, 84, 85, 86, 86, 88, 87, 84, 84,
762 89, 89, 90
404763 };
405764
406 static const short yydefact[] = { 0,
407 69, 69, 0, 0, 95, 88, 89, 90, 91, 99,
408 0, 101, 68, 70, 71, 75, 72, 61, 82, 83,
409 86, 0, 0, 98, 100, 66, 0, 73, 78, 66,
410 0, 44, 93, 0, 0, 10, 67, 76, 1, 57,
411 59, 62, 0, 84, 0, 0, 0, 96, 0, 97,
412 11, 0, 63, 0, 61, 0, 0, 53, 55, 74,
413 0, 0, 37, 43, 0, 0, 94, 5, 3, 2,
414 0, 0, 7, 8, 9, 0, 65, 10, 77, 0,
415 0, 0, 0, 16, 14, 17, 18, 19, 46, 46,
416 0, 15, 48, 0, 60, 10, 0, 87, 39, 0,
417 0, 45, 92, 0, 0, 12, 64, 0, 0, 0,
418 0, 0, 0, 47, 0, 14, 35, 0, 0, 0,
419 58, 0, 0, 56, 0, 54, 79, 80, 0, 38,
420 40, 0, 0, 0, 50, 0, 0, 0, 0, 0,
421 20, 23, 31, 36, 0, 0, 0, 24, 49, 44,
422 51, 85, 81, 42, 0, 4, 6, 13, 0, 0,
423 0, 0, 21, 0, 33, 0, 25, 22, 26, 0,
424 41, 0, 0, 0, 0, 32, 31, 0, 27, 28,
425 29, 30, 34, 0, 52, 0, 0, 0
765 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
766 static const yytype_uint8 yyr2[] =
767 {
768 0, 2, 1, 1, 1, 4, 1, 4, 1, 1,
769 1, 0, 1, 0, 2, 1, 1, 1, 1, 1,
770 1, 3, 4, 4, 3, 3, 4, 4, 6, 6,
771 6, 6, 0, 2, 2, 4, 0, 1, 1, 3,
772 2, 3, 5, 4, 1, 0, 3, 0, 1, 1,
773 3, 4, 2, 6, 0, 2, 1, 3, 1, 4,
774 1, 3, 0, 2, 1, 3, 3, 0, 1, 1,
775 0, 1, 1, 1, 0, 3, 0, 0, 6, 3,
776 1, 1, 2, 1, 0, 0, 8, 0, 6, 1,
777 1, 1, 1, 4, 1, 3, 0, 4, 4, 2,
778 1, 2, 1
426779 };
427780
428 static const short yydefgoto[] = { 40,
429 76, 52, 135, 92, 93, 165, 144, 145, 64, 65,
430 47, 113, 114, 53, 126, 96, 60, 41, 42, 28,
431 54, 37, 38, 14, 15, 16, 18, 29, 43, 6,
432 26, 55, 7, 128, 129, 20, 8, 30, 61, 9,
433 31, 10, 33, 34, 11, 22, 12, 186
781 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
782 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
783 means the default is an error. */
784 static const yytype_uint8 yydefact[] =
785 {
786 0, 70, 70, 0, 0, 96, 89, 90, 91, 92,
787 100, 0, 102, 0, 69, 71, 72, 76, 73, 62,
788 83, 84, 87, 0, 0, 99, 101, 1, 67, 0,
789 74, 79, 67, 0, 45, 94, 0, 0, 11, 68,
790 77, 2, 58, 60, 63, 0, 85, 0, 0, 0,
791 97, 0, 98, 12, 0, 64, 0, 62, 0, 0,
792 54, 56, 75, 0, 0, 38, 44, 0, 0, 95,
793 6, 4, 3, 0, 0, 8, 9, 10, 0, 66,
794 11, 78, 0, 0, 0, 0, 17, 15, 18, 19,
795 20, 47, 47, 0, 16, 49, 0, 61, 11, 0,
796 88, 40, 0, 0, 46, 93, 0, 0, 13, 65,
797 0, 0, 0, 0, 0, 0, 48, 0, 15, 36,
798 0, 0, 0, 59, 0, 0, 57, 0, 55, 80,
799 81, 0, 39, 41, 0, 0, 0, 51, 0, 0,
800 0, 0, 0, 21, 24, 32, 37, 0, 0, 0,
801 25, 50, 45, 52, 86, 82, 43, 0, 5, 7,
802 14, 0, 0, 0, 0, 22, 0, 34, 0, 26,
803 23, 27, 0, 42, 0, 0, 0, 0, 33, 32,
804 0, 28, 29, 30, 31, 35, 0, 53
434805 };
435806
436 static const short yypact[] = { 129,
437 3, 3, 11, 19,-32768,-32768,-32768,-32768,-32768,-32768,
438 2, 129,-32768,-32768,-32768,-32768,-32768, 29,-32768,-32768,
439 -32768, 24, 129,-32768,-32768, 43, 31,-32768,-32768, 43,
440 40, 50,-32768, -6, -4, 69,-32768,-32768,-32768, 59,
441 -32768, 61, 10,-32768, 31, 81, 78,-32768, 24,-32768,
442 -32768, 15,-32768, 12, 29, 41, 31,-32768,-32768,-32768,
443 84, 68, 8, 83, 87, 41,-32768,-32768,-32768,-32768,
444 111, 120,-32768,-32768,-32768, 126,-32768, 69,-32768, 114,
445 115, 116, 117,-32768, 127,-32768,-32768,-32768, 41, 41,
446 132,-32768, 113, 27,-32768, 60, 144,-32768,-32768, 135,
447 136,-32768, 113, 137, 15, 131,-32768, 41, 41, 41,
448 41, 41, 130, 123, 133,-32768, 41, 81, 81, 140,
449 -32768, 41, 141,-32768, 124,-32768,-32768,-32768, 5,-32768,
450 9, 138, 142, 41,-32768, 67, 73, 79, 85, 45,
451 -32768,-32768, 54, 134, 139, 143, 145,-32768, 113, 50,
452 -32768,-32768,-32768,-32768, 146,-32768,-32768, 113, 41, 41,
453 41, 41,-32768, 147,-32768, 41,-32768,-32768,-32768, 148,
454 -32768, 91, 94, 99, 102,-32768, 54, 41,-32768,-32768,
455 -32768,-32768,-32768, 47,-32768, 168, 172,-32768
807 /* YYDEFGOTO[NTERM-NUM]. */
808 static const yytype_int16 yydefgoto[] =
809 {
810 -1, 42, 78, 54, 137, 94, 95, 167, 146, 147,
811 66, 67, 49, 115, 116, 55, 128, 98, 62, 43,
812 44, 30, 56, 39, 40, 15, 16, 17, 19, 31,
813 45, 6, 28, 57, 7, 130, 131, 21, 8, 32,
814 63, 9, 33, 10, 35, 36, 11, 23, 12, 13
456815 };
457816
458 static const short yypgoto[] = { -50,
459 72,-32768,-32768, 82, -66, 4,-32768,-32768,-32768, -29,
460 30, 89, -55, -44,-32768,-32768,-32768, -19,-32768,-32768,
461 -32768,-32768, 152,-32768, 181,-32768,-32768, 149,-32768,-32768,
462 -32768,-32768, -94, 55,-32768,-32768,-32768,-32768,-32768,-32768,
463 -32768, -7, 150,-32768,-32768,-32768, 162,-32768
817 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
818 STATE-NUM. */
819 #define YYPACT_NINF -97
820 static const yytype_int16 yypact[] =
821 {
822 129, 3, 3, 11, 19, -97, -97, -97, -97, -97,
823 -97, 2, 129, 48, -97, -97, -97, -97, -97, 29,
824 -97, -97, -97, 31, 129, -97, -97, -97, 43, 56,
825 -97, -97, 43, 42, 53, -97, -6, -4, 71, -97,
826 -97, -97, 72, -97, 65, 9, -97, 56, 87, 78,
827 -97, 31, -97, -97, 15, -97, 13, 29, 41, 56,
828 -97, -97, -97, 84, 80, 7, 81, 106, 41, -97,
829 -97, -97, -97, 120, 122, -97, -97, -97, 127, -97,
830 71, -97, 115, 116, 117, 118, -97, 128, -97, -97,
831 -97, 41, 41, 133, -97, 113, 27, -97, 60, 145,
832 -97, -97, 136, 137, -97, 113, 138, 15, 132, -97,
833 41, 41, 41, 41, 41, 130, 125, 131, -97, 41,
834 87, 87, 141, -97, 41, 143, -97, 126, -97, -97,
835 -97, 5, -97, 8, 140, 142, 41, -97, 67, 73,
836 79, 85, 45, -97, -97, 54, 134, 139, 146, 135,
837 -97, 113, 53, -97, -97, -97, -97, 149, -97, -97,
838 113, 41, 41, 41, 41, -97, 150, -97, 41, -97,
839 -97, -97, 144, -97, 91, 94, 99, 102, -97, 54,
840 41, -97, -97, -97, -97, -97, 47, -97
464841 };
465842
466
467 #define YYLAST 204
468
469
470 static const short yytable[] = { 103,
471 94, 75, 127, 24, 25, 1, 2, 3, 4, 48,
472 5, 1, 2, 3, 4, 2, 5, 68, 69, 70,
473 71, 72, 73, 74, 13, 62, 50, 25, 99, 154,
474 49, 23, 19, 107, 127, 152, 39, 95, 77, 58,
475 21, 136, 137, 138, 139, 32, 100, 155, 78, 59,
476 143, 125, 39, 121, 75, 149, 140, 80, 81, 82,
477 83, 84, 85, 122, 86, 87, 27, 158, 36, 88,
478 89, 163, 90, 51, 123, 91, 118, 45, 119, 46,
479 120, 122, 51, 118, 56, 119, 185, 120, 146, 147,
480 124, 164, 172, 173, 174, 175, 118, 57, 119, 177,
481 120, 63, 118, 159, 119, 66, 120, 98, 118, 160,
482 119, 184, 120, 97, 118, 161, 119, 102, 120, 101,
483 118, 162, 119, 118, 120, 119, 179, 120, 118, 180,
484 119, 118, 120, 119, 181, 120, 104, 182, 1, 2,
485 3, 4, 118, 5, 119, 105, 120, 106, 108, 109,
486 110, 111, 112, 116, 2, 130, 131, 132, 134, 122,
487 141, 148, 150, 151, 156, 142, 171, 187, 157, 176,
488 166, 188, 117, 168, 167, 178, 133, 169, 115, 170,
489 183, 44, 17, 153, 35, 0, 0, 0, 0, 0,
490 0, 0, 0, 0, 0, 0, 0, 0, 67, 0,
491 0, 0, 0, 79
843 /* YYPGOTO[NTERM-NUM]. */
844 static const yytype_int16 yypgoto[] =
845 {
846 -97, -52, 69, -97, -97, 86, -68, -5, -97, -97,
847 -97, -31, 26, 88, -57, -46, -97, -97, -97, -21,
848 -97, -97, -97, -97, 151, -97, 179, -97, -97, 147,
849 -97, -97, -97, -97, -96, 51, -97, -97, -97, -97,
850 -97, -97, -97, -7, 148, -97, -97, -97, 160, -97
492851 };
493852
494 static const short yycheck[] = { 66,
495 56, 52, 97, 11, 12, 10, 11, 12, 13, 16,
496 15, 10, 11, 12, 13, 11, 15, 3, 4, 5,
497 6, 7, 8, 9, 22, 45, 31, 35, 21, 21,
498 37, 30, 22, 78, 129, 31, 22, 57, 27, 30,
499 22, 108, 109, 110, 111, 22, 39, 39, 37, 40,
500 117, 96, 22, 27, 105, 122, 112, 17, 18, 19,
501 20, 21, 22, 37, 24, 25, 38, 134, 26, 29,
502 30, 27, 32, 14, 15, 35, 30, 38, 32, 30,
503 34, 37, 14, 30, 26, 32, 40, 34, 118, 119,
504 31, 38, 159, 160, 161, 162, 30, 37, 32, 166,
505 34, 21, 30, 37, 32, 28, 34, 40, 30, 37,
506 32, 178, 34, 30, 30, 37, 32, 31, 34, 37,
507 30, 37, 32, 30, 34, 32, 36, 34, 30, 36,
508 32, 30, 34, 32, 36, 34, 26, 36, 10, 11,
509 12, 13, 30, 15, 32, 26, 34, 22, 35, 35,
510 35, 35, 26, 22, 11, 21, 21, 21, 28, 37,
511 31, 22, 22, 40, 27, 33, 21, 0, 27, 23,
512 37, 0, 91, 31, 36, 28, 105, 33, 90, 150,
513 177, 30, 2, 129, 23, -1, -1, -1, -1, -1,
514 -1, -1, -1, -1, -1, -1, -1, -1, 49, -1,
515 -1, -1, -1, 55
853 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
854 positive, shift that token. If negative, reduce the rule which
855 number is the opposite. If zero, do what YYDEFACT says.
856 If YYTABLE_NINF, syntax error. */
857 #define YYTABLE_NINF -1
858 static const yytype_uint8 yytable[] =
859 {
860 105, 96, 77, 129, 25, 26, 1, 2, 3, 4,
861 50, 5, 1, 2, 3, 4, 2, 5, 70, 71,
862 72, 73, 74, 75, 76, 14, 64, 52, 101, 156,
863 26, 51, 24, 20, 109, 129, 154, 41, 97, 60,
864 79, 22, 138, 139, 140, 141, 102, 157, 27, 61,
865 80, 145, 127, 34, 123, 77, 151, 142, 82, 83,
866 84, 85, 86, 87, 124, 88, 89, 29, 160, 38,
867 90, 91, 165, 92, 53, 125, 93, 120, 41, 121,
868 47, 122, 124, 48, 120, 53, 121, 187, 122, 148,
869 149, 126, 166, 174, 175, 176, 177, 120, 58, 121,
870 179, 122, 59, 120, 161, 121, 68, 122, 65, 120,
871 162, 121, 186, 122, 99, 120, 163, 121, 103, 122,
872 100, 120, 164, 121, 120, 122, 121, 181, 122, 120,
873 182, 121, 120, 122, 121, 183, 122, 104, 184, 1,
874 2, 3, 4, 120, 5, 121, 106, 122, 107, 108,
875 110, 111, 112, 113, 114, 118, 2, 132, 133, 134,
876 136, 143, 124, 150, 144, 152, 153, 158, 171, 159,
877 173, 168, 180, 178, 185, 169, 135, 170, 172, 119,
878 117, 18, 155, 46, 37, 0, 0, 0, 0, 0,
879 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,
880 0, 0, 0, 0, 81
516881 };
517 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
518 #line 3 "/usr/share/bison.simple"
519 /* This file comes from bison-1.28. */
520
521 /* Skeleton output parser for bison,
522 Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
523
524 This program is free software; you can redistribute it and/or modify
525 it under the terms of the GNU General Public License as published by
526 the Free Software Foundation; either version 2, or (at your option)
527 any later version.
528
529 This program is distributed in the hope that it will be useful,
530 but WITHOUT ANY WARRANTY; without even the implied warranty of
531 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
532 GNU General Public License for more details.
533
534 You should have received a copy of the GNU General Public License
535 along with this program; if not, write to the Free Software
536 Foundation, Inc., 59 Temple Place - Suite 330,
537 Boston, MA 02111-1307, USA. */
538
539 /* As a special exception, when this file is copied by Bison into a
540 Bison output file, you may use that output file without restriction.
541 This special exception was added by the Free Software Foundation
542 in version 1.24 of Bison. */
543
544 /* This is the parser code that is written into each bison parser
545 when the %semantic_parser declaration is not specified in the grammar.
546 It was written by Richard Stallman by simplifying the hairy parser
547 used when %semantic_parser is specified. */
548
549 #ifndef YYSTACK_USE_ALLOCA
550 #ifdef alloca
551 #define YYSTACK_USE_ALLOCA
552 #else /* alloca not defined */
553 #ifdef __GNUC__
554 #define YYSTACK_USE_ALLOCA
555 #define alloca __builtin_alloca
556 #else /* not GNU C. */
557 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
558 #define YYSTACK_USE_ALLOCA
559 #include
560 #else /* not sparc */
561 /* We think this test detects Watcom and Microsoft C. */
562 /* This used to test MSDOS, but that is a bad idea
563 since that symbol is in the user namespace. */
564 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
565 #if 0 /* No need for malloc.h, which pollutes the namespace;
566 instead, just don't use alloca. */
567 #include
568 #endif
569 #else /* not MSDOS, or __TURBOC__ */
570 #if defined(_AIX)
571 /* I don't know what this was needed for, but it pollutes the namespace.
572 So I turned it off. rms, 2 May 1997. */
573 /* #include */
574 #pragma alloca
575 #define YYSTACK_USE_ALLOCA
576 #else /* not MSDOS, or __TURBOC__, or _AIX */
577 #if 0
578 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
579 and on HPUX 10. Eventually we can turn this on. */
580 #define YYSTACK_USE_ALLOCA
581 #define alloca __builtin_alloca
582 #endif /* __hpux */
583 #endif
584 #endif /* not _AIX */
585 #endif /* not MSDOS, or __TURBOC__ */
586 #endif /* not sparc */
587 #endif /* not GNU C */
588 #endif /* alloca not defined */
589 #endif /* YYSTACK_USE_ALLOCA not defined */
590
591 #ifdef YYSTACK_USE_ALLOCA
592 #define YYSTACK_ALLOC alloca
593 #else
594 #define YYSTACK_ALLOC malloc
595 #endif
596
597 /* Note: there must be only one dollar sign in this file.
598 It is replaced by the list of actions, each action
599 as one case of the switch. */
882
883 static const yytype_int16 yycheck[] =
884 {
885 68, 58, 54, 99, 11, 12, 10, 11, 12, 13,
886 16, 15, 10, 11, 12, 13, 11, 15, 3, 4,
887 5, 6, 7, 8, 9, 22, 47, 31, 21, 21,
888 37, 37, 30, 22, 80, 131, 31, 22, 59, 30,
889 27, 22, 110, 111, 112, 113, 39, 39, 0, 40,
890 37, 119, 98, 22, 27, 107, 124, 114, 17, 18,
891 19, 20, 21, 22, 37, 24, 25, 38, 136, 26,
892 29, 30, 27, 32, 14, 15, 35, 30, 22, 32,
893 38, 34, 37, 30, 30, 14, 32, 40, 34, 120,
894 121, 31, 38, 161, 162, 163, 164, 30, 26, 32,
895 168, 34, 37, 30, 37, 32, 28, 34, 21, 30,
896 37, 32, 180, 34, 30, 30, 37, 32, 37, 34,
897 40, 30, 37, 32, 30, 34, 32, 36, 34, 30,
898 36, 32, 30, 34, 32, 36, 34, 31, 36, 10,
899 11, 12, 13, 30, 15, 32, 26, 34, 26, 22,
900 35, 35, 35, 35, 26, 22, 11, 21, 21, 21,
901 28, 31, 37, 22, 33, 22, 40, 27, 33, 27,
902 21, 37, 28, 23, 179, 36, 107, 31, 152, 93,
903 92, 2, 131, 32, 24, -1, -1, -1, -1, -1,
904 -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
905 -1, -1, -1, -1, 57
906 };
907
908 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
909 symbol of state STATE-NUM. */
910 static const yytype_uint8 yystos[] =
911 {
912 0, 10, 11, 12, 13, 15, 72, 75, 79, 82,
913 84, 87, 89, 90, 22, 66, 67, 68, 67, 69,
914 22, 78, 22, 88, 30, 84, 84, 0, 73, 38,
915 62, 70, 80, 83, 22, 85, 86, 89, 26, 64,
916 65, 22, 42, 60, 61, 71, 65, 38, 30, 53,
917 16, 37, 31, 14, 44, 56, 63, 74, 26, 37,
918 30, 40, 59, 81, 60, 21, 51, 52, 28, 85,
919 3, 4, 5, 6, 7, 8, 9, 42, 43, 27,
920 37, 70, 17, 18, 19, 20, 21, 22, 24, 25,
921 29, 30, 32, 35, 46, 47, 55, 60, 58, 30,
922 40, 21, 39, 37, 31, 47, 26, 26, 22, 56,
923 35, 35, 35, 35, 26, 54, 55, 54, 22, 46,
924 30, 32, 34, 27, 37, 15, 31, 56, 57, 75,
925 76, 77, 21, 21, 21, 43, 28, 45, 47, 47,
926 47, 47, 55, 31, 33, 47, 49, 50, 52, 52,
927 22, 47, 22, 40, 31, 76, 21, 39, 27, 27,
928 47, 37, 37, 37, 37, 27, 38, 48, 37, 36,
929 31, 33, 53, 21, 47, 47, 47, 47, 23, 47,
930 28, 36, 36, 36, 36, 48, 47, 40
931 };
600932
601933 #define yyerrok (yyerrstatus = 0)
602934 #define yyclearin (yychar = YYEMPTY)
603 #define YYEMPTY -2
935 #define YYEMPTY (-2)
604936 #define YYEOF 0
937
605938 #define YYACCEPT goto yyacceptlab
606 #define YYABORT goto yyabortlab
607 #define YYERROR goto yyerrlab1
608 /* Like YYERROR except do call yyerror.
609 This remains here temporarily to ease the
610 transition to the new meaning of YYERROR, for GCC.
939 #define YYABORT goto yyabortlab
940 #define YYERROR goto yyerrorlab
941
942
943 /* Like YYERROR except do call yyerror. This remains here temporarily
944 to ease the transition to the new meaning of YYERROR, for GCC.
611945 Once GCC version 2 has supplanted version 1, this can go. */
946
612947 #define YYFAIL goto yyerrlab
948
613949 #define YYRECOVERING() (!!yyerrstatus)
614 #define YYBACKUP(token, value) \
950
951 #define YYBACKUP(Token, Value) \
615952 do \
616953 if (yychar == YYEMPTY && yylen == 1) \
617 { yychar = (token), yylval = (value); \
618 yychar1 = YYTRANSLATE (yychar); \
619 YYPOPSTACK; \
954 { \
955 yychar = (Token); \
956 yylval = (Value); \
957 yytoken = YYTRANSLATE (yychar); \
958 YYPOPSTACK (1); \
620959 goto yybackup; \
621960 } \
622961 else \
623 { yyerror ("syntax error: cannot back up"); YYERROR; } \
624 while (0)
962 { \
963 yyerror (YY_("syntax error: cannot back up")); \
964 YYERROR; \
965 } \
966 while (YYID (0))
967
625968
626969 #define YYTERROR 1
627970 #define YYERRCODE 256
628971
629 #ifndef YYPURE
630 #define YYLEX yylex()
631 #endif
632
633 #ifdef YYPURE
634 #ifdef YYLSP_NEEDED
972
973 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
974 If N is 0, then set CURRENT to the empty location which ends
975 the previous symbol: RHS[0] (always defined). */
976
977 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
978 #ifndef YYLLOC_DEFAULT
979 # define YYLLOC_DEFAULT(Current, Rhs, N) \
980 do \
981 if (YYID (N)) \
982 { \
983 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
984 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
985 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
986 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
987 } \
988 else \
989 { \
990 (Current).first_line = (Current).last_line = \
991 YYRHSLOC (Rhs, 0).last_line; \
992 (Current).first_column = (Current).last_column = \
993 YYRHSLOC (Rhs, 0).last_column; \
994 } \
995 while (YYID (0))
996 #endif
997
998
999 /* YY_LOCATION_PRINT -- Print the location on the stream.
1000 This macro was not mandated originally: define only if we know
1001 we won't break user code: when these are the locations we know. */
1002
1003 #ifndef YY_LOCATION_PRINT
1004 # if YYLTYPE_IS_TRIVIAL
1005 # define YY_LOCATION_PRINT(File, Loc) \
1006 fprintf (File, "%d.%d-%d.%d", \
1007 (Loc).first_line, (Loc).first_column, \
1008 (Loc).last_line, (Loc).last_column)
1009 # else
1010 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1011 # endif
1012 #endif
1013
1014
1015 /* YYLEX -- calling `yylex' with the right arguments. */
1016
6351017 #ifdef YYLEX_PARAM
636 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
1018 # define YYLEX yylex (YYLEX_PARAM)
6371019 #else
638 #define YYLEX yylex(&yylval, &yylloc)
639 #endif
640 #else /* not YYLSP_NEEDED */
641 #ifdef YYLEX_PARAM
642 #define YYLEX yylex(&yylval, YYLEX_PARAM)
1020 # define YYLEX yylex ()
1021 #endif
1022
1023 /* Enable debugging if requested. */
1024 #if YYDEBUG
1025
1026 # ifndef YYFPRINTF
1027 # include /* INFRINGES ON USER NAME SPACE */
1028 # define YYFPRINTF fprintf
1029 # endif
1030
1031 # define YYDPRINTF(Args) \
1032 do { \
1033 if (yydebug) \
1034 YYFPRINTF Args; \
1035 } while (YYID (0))
1036
1037 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1038 do { \
1039 if (yydebug) \
1040 { \
1041 YYFPRINTF (stderr, "%s ", Title); \
1042 yy_symbol_print (stderr, \
1043 Type, Value); \
1044 YYFPRINTF (stderr, "\n"); \
1045 } \
1046 } while (YYID (0))
1047
1048
1049 /*--------------------------------.
1050 | Print this symbol on YYOUTPUT. |
1051 `--------------------------------*/
1052
1053 /*ARGSUSED*/
1054 #if (defined __STDC__ || defined __C99__FUNC__ \
1055 || defined __cplusplus || defined _MSC_VER)
1056 static void
1057 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
6431058 #else
644 #define YYLEX yylex(&yylval)
645 #endif
646 #endif /* not YYLSP_NEEDED */
647 #endif
648
649 /* If nonreentrant, generate the variables here */
650
651 #ifndef YYPURE
652
653 int yychar; /* the lookahead symbol */
654 YYSTYPE yylval; /* the semantic value of the */
655 /* lookahead symbol */
656
657 #ifdef YYLSP_NEEDED
658 YYLTYPE yylloc; /* location data for the lookahead */
659 /* symbol */
660 #endif
661
662 int yynerrs; /* number of parse errors so far */
663 #endif /* not YYPURE */
664
665 #if YYDEBUG != 0
666 int yydebug; /* nonzero means print parse trace */
667 /* Since this is uninitialized, it does not stop multiple parsers
668 from coexisting. */
669 #endif
670
671 /* YYINITDEPTH indicates the initial size of the parser's stacks */
672
1059 static void
1060 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1061 FILE *yyoutput;
1062 int yytype;
1063 YYSTYPE const * const yyvaluep;
1064 #endif
1065 {
1066 if (!yyvaluep)
1067 return;
1068 # ifdef YYPRINT
1069 if (yytype < YYNTOKENS)
1070 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1071 # else
1072 YYUSE (yyoutput);
1073 # endif
1074 switch (yytype)
1075 {
1076 default:
1077 break;
1078 }
1079 }
1080
1081
1082 /*--------------------------------.
1083 | Print this symbol on YYOUTPUT. |
1084 `--------------------------------*/
1085
1086 #if (defined __STDC__ || defined __C99__FUNC__ \
1087 || defined __cplusplus || defined _MSC_VER)
1088 static void
1089 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1090 #else
1091 static void
1092 yy_symbol_print (yyoutput, yytype, yyvaluep)
1093 FILE *yyoutput;
1094 int yytype;
1095 YYSTYPE const * const yyvaluep;
1096 #endif
1097 {
1098 if (yytype < YYNTOKENS)
1099 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1100 else
1101 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1102
1103 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1104 YYFPRINTF (yyoutput, ")");
1105 }
1106
1107 /*------------------------------------------------------------------.
1108 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1109 | TOP (included). |
1110 `------------------------------------------------------------------*/
1111
1112 #if (defined __STDC__ || defined __C99__FUNC__ \
1113 || defined __cplusplus || defined _MSC_VER)
1114 static void
1115 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1116 #else
1117 static void
1118 yy_stack_print (bottom, top)
1119 yytype_int16 *bottom;
1120 yytype_int16 *top;
1121 #endif
1122 {
1123 YYFPRINTF (stderr, "Stack now");
1124 for (; bottom <= top; ++bottom)
1125 YYFPRINTF (stderr, " %d", *bottom);
1126 YYFPRINTF (stderr, "\n");
1127 }
1128
1129 # define YY_STACK_PRINT(Bottom, Top) \
1130 do { \
1131 if (yydebug) \
1132 yy_stack_print ((Bottom), (Top)); \
1133 } while (YYID (0))
1134
1135
1136 /*------------------------------------------------.
1137 | Report that the YYRULE is going to be reduced. |
1138 `------------------------------------------------*/
1139
1140 #if (defined __STDC__ || defined __C99__FUNC__ \
1141 || defined __cplusplus || defined _MSC_VER)
1142 static void
1143 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1144 #else
1145 static void
1146 yy_reduce_print (yyvsp, yyrule)
1147 YYSTYPE *yyvsp;
1148 int yyrule;
1149 #endif
1150 {
1151 int yynrhs = yyr2[yyrule];
1152 int yyi;
1153 unsigned long int yylno = yyrline[yyrule];
1154 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1155 yyrule - 1, yylno);
1156 /* The symbols being reduced. */
1157 for (yyi = 0; yyi < yynrhs; yyi++)
1158 {
1159 fprintf (stderr, " $%d = ", yyi + 1);
1160 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1161 &(yyvsp[(yyi + 1) - (yynrhs)])
1162 );
1163 fprintf (stderr, "\n");
1164 }
1165 }
1166
1167 # define YY_REDUCE_PRINT(Rule) \
1168 do { \
1169 if (yydebug) \
1170 yy_reduce_print (yyvsp, Rule); \
1171 } while (YYID (0))
1172
1173 /* Nonzero means print parse trace. It is left uninitialized so that
1174 multiple parsers can coexist. */
1175 int yydebug;
1176 #else /* !YYDEBUG */
1177 # define YYDPRINTF(Args)
1178 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1179 # define YY_STACK_PRINT(Bottom, Top)
1180 # define YY_REDUCE_PRINT(Rule)
1181 #endif /* !YYDEBUG */
1182
1183
1184 /* YYINITDEPTH -- initial size of the parser's stacks. */
6731185 #ifndef YYINITDEPTH
674 #define YYINITDEPTH 200
675 #endif
676
677 /* YYMAXDEPTH is the maximum size the stacks can grow to
678 (effective only if the built-in stack extension method is used). */
679
680 #if YYMAXDEPTH == 0
681 #undef YYMAXDEPTH
682 #endif
1186 # define YYINITDEPTH 200
1187 #endif
1188
1189 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1190 if the built-in stack extension method is used).
1191
1192 Do not make this value too large; the results are undefined if
1193 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1194 evaluated with infinite-precision integer arithmetic. */
6831195
6841196 #ifndef YYMAXDEPTH
685 #define YYMAXDEPTH 10000
686 #endif
1197 # define YYMAXDEPTH 10000
1198 #endif
1199
6871200
688 /* Define __yy_memcpy. Note that the size argument
689 should be passed with type unsigned int, because that is what the non-GCC
690 definitions require. With GCC, __builtin_memcpy takes an arg
691 of type size_t, but it can handle unsigned int. */
692
693 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
694 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
695 #else /* not GNU C or C++ */
696 #ifndef __cplusplus
697
698 /* This is the most reliable way to avoid incompatibilities
699 in available built-in functions on various systems. */
1201
1202 #if YYERROR_VERBOSE
1203
1204 # ifndef yystrlen
1205 # if defined __GLIBC__ && defined _STRING_H
1206 # define yystrlen strlen
1207 # else
1208 /* Return the length of YYSTR. */
1209 #if (defined __STDC__ || defined __C99__FUNC__ \
1210 || defined __cplusplus || defined _MSC_VER)
1211 static YYSIZE_T
1212 yystrlen (const char *yystr)
1213 #else
1214 static YYSIZE_T
1215 yystrlen (yystr)
1216 const char *yystr;
1217 #endif
1218 {
1219 YYSIZE_T yylen;
1220 for (yylen = 0; yystr[yylen]; yylen++)
1221 continue;
1222 return yylen;
1223 }
1224 # endif
1225 # endif
1226
1227 # ifndef yystpcpy
1228 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1229 # define yystpcpy stpcpy
1230 # else
1231 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1232 YYDEST. */
1233 #if (defined __STDC__ || defined __C99__FUNC__ \
1234 || defined __cplusplus || defined _MSC_VER)
1235 static char *
1236 yystpcpy (char *yydest, const char *yysrc)
1237 #else
1238 static char *
1239 yystpcpy (yydest, yysrc)
1240 char *yydest;
1241 const char *yysrc;
1242 #endif
1243 {
1244 char *yyd = yydest;
1245 const char *yys = yysrc;
1246
1247 while ((*yyd++ = *yys++) != '\0')
1248 continue;
1249
1250 return yyd - 1;
1251 }
1252 # endif
1253 # endif
1254
1255 # ifndef yytnamerr
1256 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1257 quotes and backslashes, so that it's suitable for yyerror. The
1258 heuristic is that double-quoting is unnecessary unless the string
1259 contains an apostrophe, a comma, or backslash (other than
1260 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1261 null, do not copy; instead, return the length of what the result
1262 would have been. */
1263 static YYSIZE_T
1264 yytnamerr (char *yyres, const char *yystr)
1265 {
1266 if (*yystr == '"')
1267 {
1268 YYSIZE_T yyn = 0;
1269 char const *yyp = yystr;
1270
1271 for (;;)
1272 switch (*++yyp)
1273 {
1274 case '\'':
1275 case ',':
1276 goto do_not_strip_quotes;
1277
1278 case '\\':
1279 if (*++yyp != '\\')
1280 goto do_not_strip_quotes;
1281 /* Fall through. */
1282 default:
1283 if (yyres)
1284 yyres[yyn] = *yyp;
1285 yyn++;
1286 break;
1287
1288 case '"':
1289 if (yyres)
1290 yyres[yyn] = '\0';
1291 return yyn;
1292 }
1293 do_not_strip_quotes: ;
1294 }
1295
1296 if (! yyres)
1297 return yystrlen (yystr);
1298
1299 return yystpcpy (yyres, yystr) - yyres;
1300 }
1301 # endif
1302
1303 /* Copy into YYRESULT an error message about the unexpected token
1304 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1305 including the terminating null byte. If YYRESULT is null, do not
1306 copy anything; just return the number of bytes that would be
1307 copied. As a special case, return 0 if an ordinary "syntax error"
1308 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1309 size calculation. */
1310 static YYSIZE_T
1311 yysyntax_error (char *yyresult, int yystate, int yychar)
1312 {
1313 int yyn = yypact[yystate];
1314
1315 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1316 return 0;
1317 else