llvm.org GIT mirror llvm / e815619
Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are now cerr, cout, and NullStream resp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 12 years ago
112 changed file(s) with 2006 addition(s) and 1841 deletion(s). Raw diff Collapse all Expand all
5252 BB->getInstList().push_back(new ReturnInst(Add));
5353
5454 // Output the bytecode file to stdout
55 WriteBytecodeToFile(M, llvm_cout);
55 WriteBytecodeToFile(M, cout);
5656
5757 // Delete the module and all of its contents.
5858 delete M;
2828 #include
2929 #include
3030 #include
31 #include
3231
3332 namespace llvm {
3433
173172 ///
174173 /// Printing and debugging support
175174 ///
176 void print(llvm_ostream &O) const {
175 void print(OStream &O) const {
177176 if (O.stream()) print(*O.stream());
178177 }
179178 void print(std::ostream &O) const;
180 void dump() const { print(llvm_cerr); }
179 void dump() const { print(cerr); }
181180
182181 public:
183182 //
234233 return (I.bitvec == bitvec &&
235234 I.currentWord == currentWord && I.currentBit == currentBit);
236235 }
236 bool operator!=(const iterator& I) {
237 return !(*this == I);
238 }
237239
238240 protected:
239241 static iterator begin(BitSetVector& _bitvec) { return iterator(_bitvec); }
251253 O << "<" << (*I) << ">" << (I+1 == E? "\n" : ", ");
252254 }
253255
254 inline llvm_ostream& operator<< (llvm_ostream& O, const BitSetVector& bset) {
256 inline OStream& operator<< (OStream& O, const BitSetVector& bset) {
255257 bset.print(O);
256258 return O;
257259 }
4242 /// if (!I->isLeader()) continue; // Ignore non-leader sets.
4343 /// for (EquivalenceClasses::member_iterator MI = EC.member_begin(I);
4444 /// MI != EC.member_end(); ++MI) // Loop over members in this set.
45 /// llvm_cerr << *MI << " "; // Print member.
46 /// llvm_cerr << "\n"; // Finish set.
45 /// cerr << *MI << " "; // Print member.
46 /// cerr << "\n"; // Finish set.
4747 /// }
4848 ///
4949 /// This example prints:
155155 iterator end() const { return iterator(); }
156156 bool empty() const { return PtrList == 0; }
157157
158 void print(llvm_ostream &OS) const {
158 void print(OStream &OS) const {
159159 if (OS.stream()) print(*OS.stream());
160160 }
161161 void print(std::ostream &OS) const;
247247 bool aliasesCallSite(CallSite CS, AliasAnalysis &AA) const;
248248 };
249249
250 inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSet &AS) {
250 inline OStream& operator<<(OStream &OS, const AliasSet &AS) {
251251 AS.print(OS);
252252 return OS;
253253 }
360360 iterator begin() { return AliasSets.begin(); }
361361 iterator end() { return AliasSets.end(); }
362362
363 void print(llvm_ostream &OS) const {
363 void print(OStream &OS) const {
364364 if (OS.stream()) print(*OS.stream());
365365 }
366366 void print(std::ostream &OS) const;
389389 AliasSet *findAliasSetForCallSite(CallSite CS);
390390 };
391391
392 inline llvm_ostream& operator<<(llvm_ostream &OS, const AliasSetTracker &AST) {
392 inline OStream& operator<<(OStream &OS, const AliasSetTracker &AST) {
393393 AST.print(OS);
394394 return OS;
395395 }
151151 ///
152152 void initialize(Module &M);
153153
154 void print(llvm_ostream &o, const Module *M) const {
154 void print(OStream &o, const Module *M) const {
155155 if (o.stream()) print(*o.stream(), M);
156156 }
157157 virtual void print(std::ostream &o, const Module *M) const;
200200 /// dump - Print out this call graph node.
201201 ///
202202 void dump() const;
203 void print(llvm_ostream &OS) const {
203 void print(OStream &OS) const {
204204 if (OS.stream()) print(*OS.stream());
205205 }
206206 void print(std::ostream &OS) const;
377377
378378 /// print - Print a dot graph to the specified ostream...
379379 ///
380 void print(llvm_ostream &O) const {
380 void print(OStream &O) const {
381381 if (O.stream()) print(*O.stream());
382382 }
383383 void print(std::ostream &O) const;
384384
385 /// dump - call print(llvm_cerr), for use from the debugger...
385 /// dump - call print(cerr), for use from the debugger...
386386 ///
387387 void dump() const;
388388
361361 ///
362362 void forwardNode(DSNode *To, unsigned Offset);
363363
364 void print(llvm_ostream &O, const DSGraph *G) const {
364 void print(OStream &O, const DSGraph *G) const {
365365 if (O.stream()) print(*O.stream(), G);
366366 }
367367 void print(std::ostream &O, const DSGraph *G) const;
216216 /// the mapping in the LoopInfo class.
217217 void removeBlockFromLoop(BasicBlock *BB);
218218
219 void print(llvm_ostream &O, unsigned Depth = 0) const {
219 void print(OStream &O, unsigned Depth = 0) const {
220220 if (O.stream()) print(*O.stream(), Depth);
221221 }
222222 void print(std::ostream &O, unsigned Depth = 0) const;
282282 virtual bool runOnFunction(Function &F);
283283
284284 virtual void releaseMemory();
285 void print(llvm_ostream &O, const Module* = 0) const {
285 void print(OStream &O, const Module* = 0) const {
286286 if (O.stream()) print(*O.stream());
287287 }
288288 void print(std::ostream &O, const Module* = 0) const;
9696 /// print - Print out the internal representation of this scalar to the
9797 /// specified stream. This should really only be used for debugging
9898 /// purposes.
99 void print(llvm_ostream &OS) const {
99 void print(OStream &OS) const {
100100 if (OS.stream()) print(*OS.stream());
101101 }
102102 virtual void print(std::ostream &OS) const = 0;
106106 void dump() const;
107107 };
108108
109 inline llvm_ostream &operator<<(llvm_ostream &OS, const SCEV &S) {
109 inline OStream &operator<<(OStream &OS, const SCEV &S) {
110110 S.print(OS);
111111 return OS;
112112 }
127127 virtual bool isLoopInvariant(const Loop *L) const;
128128 virtual const Type *getType() const;
129129 virtual bool hasComputableLoopEvolution(const Loop *L) const;
130 void print(llvm_ostream &OS) const {
130 void print(OStream &OS) const {
131131 if (OS.stream()) print(*OS.stream());
132132 }
133133 virtual void print(std::ostream &OS) const;
241241 virtual bool runOnFunction(Function &F);
242242 virtual void releaseMemory();
243243 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
244 void print(llvm_ostream &OS, const Module* = 0) const {
244 void print(OStream &OS, const Module* = 0) const {
245245 if (OS.stream()) print(*OS.stream());
246246 }
247247 virtual void print(std::ostream &OS, const Module* = 0) const;
1717 #ifndef LLVM_ANALYSIS_TRACE_H
1818 #define LLVM_ANALYSIS_TRACE_H
1919
20 #include "llvm/Support/Streams.h"
2021 #include
2122 #include
2223
2324 namespace llvm {
24 class llvm_ostream;
2525 class BasicBlock;
2626 class Function;
2727 class Module;
105105
106106 /// print - Write trace to output stream.
107107 ///
108 void print (llvm_ostream &O) const;
108 void print (OStream &O) const;
109109
110110 /// dump - Debugger convenience method; writes trace to standard error
111111 /// output stream.
2424 namespace llvm {
2525
2626 class PrintModulePass : public ModulePass {
27 llvm_ostream *Out; // ostream to print on
27 OStream *Out; // ostream to print on
2828 bool DeleteStream; // Delete the ostream in our dtor?
2929 public:
30 PrintModulePass() : Out(&llvm_cerr), DeleteStream(false) {}
31 PrintModulePass(llvm_ostream *o, bool DS = false)
32 : Out(o), DeleteStream(DS) {
33 }
30 PrintModulePass() : Out(&cerr), DeleteStream(false) {}
31 PrintModulePass(OStream *o, bool DS = false)
32 : Out(o), DeleteStream(DS) {}
3433
3534 ~PrintModulePass() {
3635 if (DeleteStream) delete Out;
4847
4948 class PrintFunctionPass : public FunctionPass {
5049 std::string Banner; // String to print before each function
51 llvm_ostream *Out; // ostream to print on
50 OStream *Out; // ostream to print on
5251 bool DeleteStream; // Delete the ostream in our dtor?
5352 public:
54 PrintFunctionPass() : Banner(""), Out(&llvm_cerr), DeleteStream(false) {}
55 PrintFunctionPass(const std::string &B, llvm_ostream *o = &llvm_cout,
53 PrintFunctionPass() : Banner(""), Out(&cerr), DeleteStream(false) {}
54 PrintFunctionPass(const std::string &B, OStream *o = &cout,
5655 bool DS = false)
57 : Banner(B), Out(o), DeleteStream(DS) {
58 }
56 : Banner(B), Out(o), DeleteStream(DS) {}
5957
6058 inline ~PrintFunctionPass() {
6159 if (DeleteStream) delete Out;
1616
1717 #include "llvm/Pass.h"
1818 #include "llvm/Bytecode/Writer.h"
19 #include "llvm/Support/Streams.h"
1920
2021 namespace llvm {
2122
22 class llvm_ostream;
23
2423 class WriteBytecodePass : public ModulePass {
25 llvm_ostream *Out; // ostream to print on
24 OStream *Out; // ostream to print on
2625 bool DeleteStream;
2726 bool CompressFile;
2827 public:
2928 WriteBytecodePass()
30 : Out(&llvm_cout), DeleteStream(false), CompressFile(true) {}
31 WriteBytecodePass(llvm_ostream *o, bool DS = false, bool CF = true)
29 : Out(&cout), DeleteStream(false), CompressFile(true) {}
30 WriteBytecodePass(OStream *o, bool DS = false, bool CF = true)
3231 : Out(o), DeleteStream(DS), CompressFile(CF) {}
3332
3433 inline ~WriteBytecodePass() {
1414 #ifndef LLVM_BYTECODE_WRITER_H
1515 #define LLVM_BYTECODE_WRITER_H
1616
17 #include "llvm/Support/Streams.h"
18
1719 namespace llvm {
18 class llvm_ostream;
1920 class Module;
2021 /// WriteBytecodeToFile - Write the specified module to the specified output
2122 /// stream. If compress is set to true, try to use compression when writing
2223 /// out the file. This can never fail if M is a well-formed module.
23 void WriteBytecodeToFile(const Module *M, llvm_ostream &Out,
24 void WriteBytecodeToFile(const Module *M, OStream &Out,
2425 bool compress = true);
2526 } // End llvm namespace
2627
6161 };
6262
6363 std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
64 inline llvm_ostream& operator<<(llvm_ostream& os, const LiveRange &LR) {
64 inline OStream& operator<<(OStream& os, const LiveRange &LR) {
6565 if (os.stream()) *os.stream() << LR;
6666 return os;
6767 }
257257 return beginNumber() < other.beginNumber();
258258 }
259259
260 void print(llvm_ostream OS, const MRegisterInfo *MRI = 0) const;
260 void print(OStream OS, const MRegisterInfo *MRI = 0) const;
261261 void print(std::ostream &OS, const MRegisterInfo *MRI = 0) const {
262 print(llvm_ostream(OS), MRI);
262 print(OStream(OS), MRI);
263263 }
264264 void dump() const;
265265
270270 LiveInterval& operator=(const LiveInterval& rhs); // DO NOT IMPLEMENT
271271 };
272272
273 inline llvm_ostream &operator<<(llvm_ostream &OS, const LiveInterval &LI) {
273 inline OStream &operator<<(OStream &OS, const LiveInterval &LI) {
274274 LI.print(OS);
275275 return OS;
276276 }
188188
189189 // Debugging methods.
190190 void dump() const;
191 void print(llvm_ostream &OS) const {
191 void print(OStream &OS) const {
192192 if (OS.stream()) print(*OS.stream());
193193 }
194194 void print(std::ostream &OS) const;
225225 };
226226
227227 std::ostream& operator<<(std::ostream &OS, const MachineBasicBlock &MBB);
228 inline llvm_ostream& operator<<(llvm_ostream &OS, const MachineBasicBlock &MBB){
228 inline OStream& operator<<(OStream &OS, const MachineBasicBlock &MBB){
229229 if (OS.stream()) *OS.stream() << MBB;
230230 return OS;
231231 }
4848
4949 /// print - Implement operator<<...
5050 ///
51 void print(llvm_ostream &O) const {
51 void print(OStream &O) const {
5252 if (O.stream()) print(*O.stream());
5353 }
5454 virtual void print(std::ostream &O) const = 0;
5555 };
5656
57 inline llvm_ostream &operator<<(llvm_ostream &OS,
58 const MachineConstantPoolValue &V) {
57 inline OStream &operator<<(OStream &OS,
58 const MachineConstantPoolValue &V) {
5959 V.print(OS);
6060 return OS;
6161 }
142142 /// print - Used by the MachineFunction printer to print information about
143143 /// constant pool objects. Implemented in MachineFunction.cpp
144144 ///
145 void print(llvm_ostream &OS) const {
145 void print(OStream &OS) const {
146146 if (OS.stream()) print(*OS.stream());
147147 }
148148 void print(std::ostream &OS) const;
284284 IsDead = false;
285285 }
286286
287 friend llvm_ostream& operator<<(llvm_ostream& os, const MachineOperand& mop) {
287 friend OStream& operator<<(OStream& os, const MachineOperand& mop) {
288288 if (os.stream()) *os.stream() << mop;
289289 return os;
290290 }
396396 //
397397 // Debugging support
398398 //
399 void print(llvm_ostream &OS, const TargetMachine *TM) const {
399 void print(OStream &OS, const TargetMachine *TM) const {
400400 if (OS.stream()) print(*OS.stream(), TM);
401401 }
402402 void print(std::ostream &OS, const TargetMachine *TM) const;
403403 void dump() const;
404 friend llvm_ostream& operator<<(llvm_ostream& os, const MachineInstr& minstr){
404 friend OStream& operator<<(OStream& os, const MachineInstr& minstr){
405405 if (os.stream()) *os.stream() << minstr;
406406 return os;
407407 }
6969 void dump(int indent=0) const;
7070
7171 // Debugging support
72 void print(llvm_ostream &os) const {
72 void print(OStream &os) const {
7373 if (os.stream()) print(*os.stream());
7474 }
7575 virtual void print(std::ostream &os) const = 0;
9595 };
9696
9797 // ostream << operator for SchedGraphNode class
98 inline llvm_ostream &operator<<(llvm_ostream &os,
99 const SchedGraphNodeCommon &node) {
98 inline OStream &operator<<(OStream &os,
99 const SchedGraphNodeCommon &node) {
100100 node.print(os);
101101 return os;
102102 }
187187
188188 public:
189189 // Debugging support
190 void print(llvm_ostream &os) const {
190 void print(OStream &os) const {
191191 if (os.stream()) print(*os.stream());
192192 }
193193 void print(std::ostream &os) const;
199199 };
200200
201201 // ostream << operator for SchedGraphNode class
202 inline llvm_ostream &operator<<(llvm_ostream &os, const SchedGraphEdge &edge) {
202 inline OStream &operator<<(OStream &os, const SchedGraphEdge &edge) {
203203 edge.print(os);
204204 return os;
205205 }
294294 /// @{
295295 public:
296296 /// Print the module to an output stream
297 void print(llvm_ostream &OS) const {
297 void print(OStream &OS) const {
298298 if (OS.stream()) print(*OS.stream(), 0);
299299 }
300300 void print(std::ostream &OS) const { print(OS, 0); }
301301 /// Print the module to an output stream with AssemblyAnnotationWriter.
302 void print(llvm_ostream &OS, AssemblyAnnotationWriter *AAW) const {
302 void print(OStream &OS, AssemblyAnnotationWriter *AAW) const {
303303 if (OS.stream()) print(*OS.stream(), AAW);
304304 }
305305 void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
100100 /// provide the Module* in case the analysis doesn't need it it can just be
101101 /// ignored.
102102 ///
103 void print(llvm_ostream &O, const Module *M) const {
103 void print(OStream &O, const Module *M) const {
104104 if (O.stream()) print(*O.stream(), M);
105105 }
106106 virtual void print(std::ostream &O, const Module *M) const;
244244 struct foo {
245245 void ext() const;
246246 /* static bool classof(const bar *X) {
247 llvm_cerr << "Classof: " << X << "\n";
247 cerr << "Classof: " << X << "\n";
248248 return true;
249249 }*/
250250 };
251251
252252 template <> inline bool isa_impl(const bar &Val) {
253 llvm_cerr << "Classof: " << &Val << "\n";
253 cerr << "Classof: " << &Val << "\n";
254254 return true;
255255 }
256256
140140
141141 /// print - Print out the bounds to a stream...
142142 ///
143 void print(llvm_ostream &OS) const {
143 void print(OStream &OS) const {
144144 if (OS.stream()) print(*OS.stream());
145145 }
146146 void print(std::ostream &OS) const;
6464 /// places the std::c* I/O streams into one .cpp file and relieves the whole
6565 /// program from having to have hundreds of static c'tor/d'tors for them.
6666 ///
67 llvm_ostream getErrorOutputStream(const char *DebugType);
67 OStream getErrorOutputStream(const char *DebugType);
6868
6969 #ifdef NDEBUG
70 #define DOUT llvm_ostream()
70 #define DOUT NullStream
7171 #else
7272 #define DOUT getErrorOutputStream(DEBUG_TYPE)
7373 #endif
246246 std::string ErrMsg;
247247 sys::Path Filename = sys::Path::GetTemporaryDirectory(&ErrMsg);
248248 if (Filename.isEmpty()) {
249 llvm_cerr << "Error: " << ErrMsg << "\n";
249 cerr << "Error: " << ErrMsg << "\n";
250250 return Filename;
251251 }
252252 Filename.appendComponent(Name + ".dot");
253253 if (Filename.makeUnique(true,&ErrMsg)) {
254 llvm_cerr << "Error: " << ErrMsg << "\n";
254 cerr << "Error: " << ErrMsg << "\n";
255255 return sys::Path();
256256 }
257257
258 llvm_cerr << "Writing '" << Filename << "'... ";
258 cerr << "Writing '" << Filename << "'... ";
259259
260260 std::ofstream O(Filename.c_str());
261261
274274
275275 // Output the end of the graph
276276 W.writeFooter();
277 llvm_cerr << " done. \n";
277 cerr << " done. \n";
278278
279279 O.close();
280280
281281 } else {
282 llvm_cerr << "error opening file for writing!\n";
282 cerr << "error opening file for writing!\n";
283283 Filename.clear();
284284 }
285285
6464 virtual void passRegistered(const PassInfo *P) {
6565 if (ignorablePass(P) || !Opt) return;
6666 if (findOption(P->getPassArgument()) != getNumOptions()) {
67 llvm_cerr << "Two passes with the same argument (-"
68 << P->getPassArgument() << ") attempted to be registered!\n";
67 cerr << "Two passes with the same argument (-"
68 << P->getPassArgument() << ") attempted to be registered!\n";
6969 abort();
7070 }
7171 addLiteralOption(P->getPassArgument(), P, P->getPassName());
66 //
77 //===----------------------------------------------------------------------===//
88 //
9 // This file implements a wrapper for the std::cout and std::cerr I/O streams.
10 // It prevents the need to include to each file just to get I/O.
9 // This file implements a wrapper for the STL I/O streams. It prevents the need
10 // to include in a file just to get I/O.
1111 //
1212 //===----------------------------------------------------------------------===//
1313
1414 #ifndef LLVM_SUPPORT_STREAMS_H
1515 #define LLVM_SUPPORT_STREAMS_H
1616
17 #include <ostream> // Doesn't have static d'tors!!
17 #include <sstream>
1818
1919 namespace llvm {
2020
21 /// llvm_ostream - Acts like an ostream. It's a wrapper for the std::cerr and
22 /// std::cout ostreams. However, it doesn't require #including in
23 /// every file, which increases static c'tors & d'tors in the object code.
21 /// BaseStream - Acts like the STL streams. It's a wrapper for the std::cerr,
22 /// std::cout, std::cin, etc. streams. However, it doesn't require #including
23 /// in every file (doing so increases static c'tors & d'tors in the
24 /// object code).
2425 ///
25 class llvm_ostream {
26 std::ostream* Stream;
26 template
27 class BaseStream {
28 StreamTy *Stream;
2729 public:
28 llvm_ostream() : Stream(0) {}
29 llvm_ostream(std::ostream &OStream) : Stream(&OStream) {}
30 BaseStream() : Stream(0) {}
31 BaseStream(StreamTy &S) : Stream(&S) {}
32 BaseStream(StreamTy *S) : Stream(S) {}
3033
31 std::ostream* stream() const { return Stream; }
34 StreamTy *stream() const { return Stream; }
3235
33 inline llvm_ostream &operator << (std::ostream& (*Func)(std::ostream&)) {
36 inline BaseStream &operator << (StreamTy &(*Func)(StreamTy&)) {
3437 if (Stream) *Stream << Func;
3538 return *this;
3639 }
37
40
3841 template
39 llvm_ostream &operator << (const Ty &Thing) {
42 BaseStream &operator << (const Ty &Thing) {
4043 if (Stream) *Stream << Thing;
4144 return *this;
4245 }
4346
44 bool operator == (const std::ostream &OS) { return &OS == Stream; }
45 bool operator == (const llvm_ostream &OS) { return OS.Stream == Stream; }
47 template
48 BaseStream &operator >> (const Ty &Thing) {
49 if (Stream) *Stream >> Thing;
50 return *this;
51 }
52
53 bool operator == (const StreamTy &S) { return &S == Stream; }
54 bool operator != (const StreamTy &S) { return !(*this == S); }
55 bool operator == (const BaseStream &S) { return S.Stream == Stream; }
56 bool operator != (const BaseStream &S) { return !(*this == S); }
4657 };
4758
48 extern llvm_ostream llvm_null;
49 extern llvm_ostream llvm_cout;
50 extern llvm_ostream llvm_cerr;
59 typedef BaseStream OStream;
60 typedef BaseStream IStream;
61 typedef BaseStream StringStream;
62
63 extern OStream NullStream;
64 extern OStream cout;
65 extern OStream cerr;
66 extern IStream cin;
5167
5268 } // End llvm namespace
5369
135135 ///
136136 mutable std::vector AbstractTypeUsers;
137137 public:
138 void print(llvm_ostream &O) const {
138 void print(OStream &O) const {
139139 if (O.stream()) print(*O.stream());
140140 }
141141 void print(std::ostream &O) const;
7474
7575 /// print - Implement operator<< on Value...
7676 ///
77 void print(llvm_ostream &O) const {
77 void print(OStream &O) const {
7878 if (O.stream()) print(*O.stream());
7979 }
8080 virtual void print(std::ostream &O) const = 0;
3838 }
3939
4040 void printLine(const char *Desc, unsigned Val, unsigned Sum) {
41 llvm_cerr << " " << Val << " " << Desc << " responses ("
42 << Val*100/Sum << "%)\n";
41 cerr << " " << Val << " " << Desc << " responses ("
42 << Val*100/Sum << "%)\n";
4343 }
4444 ~AliasAnalysisCounter() {
4545 unsigned AASum = No+May+Must;
4646 unsigned MRSum = NoMR+JustRef+JustMod+MR;
4747 if (AASum + MRSum) { // Print a report if any counted queries occurred...
48 llvm_cerr
49 << "\n===== Alias Analysis Counter Report =====\n"
50 << " Analysis counted: " << Name << "\n"
51 << " " << AASum << " Total Alias Queries Performed\n";
48 cerr << "\n===== Alias Analysis Counter Report =====\n"
49 << " Analysis counted: " << Name << "\n"
50 << " " << AASum << " Total Alias Queries Performed\n";
5251 if (AASum) {
5352 printLine("no alias", No, AASum);
5453 printLine("may alias", May, AASum);
5554 printLine("must alias", Must, AASum);
56 llvm_cerr
57 << " Alias Analysis Counter Summary: " << No*100/AASum << "%/"
58 << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";
55 cerr << " Alias Analysis Counter Summary: " << No*100/AASum << "%/"
56 << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";
5957 }
6058
61 llvm_cerr
62 << " " << MRSum << " Total Mod/Ref Queries Performed\n";
59 cerr << " " << MRSum << " Total Mod/Ref Queries Performed\n";
6360 if (MRSum) {
6461 printLine("no mod/ref", NoMR, MRSum);
6562 printLine("ref", JustRef, MRSum);
6663 printLine("mod", JustMod, MRSum);
6764 printLine("mod/ref", MR, MRSum);
68 llvm_cerr
69 << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/"
70 << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
71 << MR*100/MRSum <<"%\n\n";
65 cerr << " Mod/Ref Analysis Counter Summary: " <
66 << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
67 << MR*100/MRSum <<"%\n\n";
7268 }
7369 }
7470 }
132128 }
133129
134130 if (PrintAll || (PrintAllFailures && R == MayAlias)) {
135 llvm_cerr << AliasString << ":\t";
136 llvm_cerr << "[" << V1Size << "B] ";
131 cerr << AliasString << ":\t";
132 cerr << "[" << V1Size << "B] ";
137133 WriteAsOperand(std::cerr, V1, true, M) << ", ";
138 llvm_cerr << "[" << V2Size << "B] ";
134 cerr << "[" << V2Size << "B] ";
139135 WriteAsOperand(std::cerr, V2, true, M) << "\n";
140136 }
141137
156152 }
157153
158154 if (PrintAll || (PrintAllFailures && R == ModRef)) {
159 llvm_cerr << MRString << ": Ptr: ";
160 llvm_cerr << "[" << Size << "B] ";
155 cerr << MRString << ": Ptr: ";
156 cerr << "[" << Size << "B] ";
161157 WriteAsOperand(std::cerr, P, true, M);
162 llvm_cerr << "\t<->" << *CS.getInstruction();
158 cerr << "\t<->" << *CS.getInstruction();
163159 }
164160 return R;
165161 }
7878 static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2,
7979 Module *M) {
8080 if (P) {
81 llvm_cerr << " " << Msg << ":\t";
81 cerr << " " << Msg << ":\t";
8282 WriteAsOperand(std::cerr, V1, true, M) << ", ";
8383 WriteAsOperand(std::cerr, V2, true, M) << "\n";
8484 }
8888 PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
8989 Module *M) {
9090 if (P) {
91 llvm_cerr << " " << Msg << ": Ptr: ";
91 cerr << " " << Msg << ": Ptr: ";
9292 WriteAsOperand(std::cerr, Ptr, true, M);
93 llvm_cerr << "\t<->" << *I;
93 cerr << "\t<->" << *I;
9494 }
9595 }
9696
124124
125125 if (PrintNoAlias || PrintMayAlias || PrintMustAlias ||
126126 PrintNoModRef || PrintMod || PrintRef || PrintModRef)
127 llvm_cerr << "Function: " << F.getName() << ": " << Pointers.size()
128 << " pointers, " << CallSites.size() << " call sites\n";
127 cerr << "Function: " << F.getName() << ": " << Pointers.size()
128 << " pointers, " << CallSites.size() << " call sites\n";
129129
130130 // iterate over the worklist, and run the full (n^2)/2 disambiguations
131131 for (std::set::iterator I1 = Pointers.begin(), E = Pointers.end();
150150 PrintResults("MustAlias", PrintMustAlias, *I1, *I2, F.getParent());
151151 ++MustAlias; break;
152152 default:
153 llvm_cerr << "Unknown alias query result!\n";
153 cerr << "Unknown alias query result!\n";
154154 }
155155 }
156156 }
180180 PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent());
181181 ++ModRef; break;
182182 default:
183 llvm_cerr << "Unknown alias query result!\n";
183 cerr << "Unknown alias query result!\n";
184184 }
185185 }
186186 }
189189 }
190190
191191 static void PrintPercent(unsigned Num, unsigned Sum) {
192 llvm_cerr << "(" << Num*100ULL/Sum << "."
192 cerr << "(" << Num*100ULL/Sum << "."
193193 << ((Num*1000ULL/Sum) % 10) << "%)\n";
194194 }
195195
196196 bool AAEval::doFinalization(Module &M) {
197197 unsigned AliasSum = NoAlias + MayAlias + MustAlias;
198 llvm_cerr << "===== Alias Analysis Evaluator Report =====\n";
198 cerr << "===== Alias Analysis Evaluator Report =====\n";
199199 if (AliasSum == 0) {
200 llvm_cerr << " Alias Analysis Evaluator Summary: No pointers!\n";
200 cerr << " Alias Analysis Evaluator Summary: No pointers!\n";
201201 } else {
202 llvm_cerr << " " << AliasSum << " Total Alias Queries Performed\n";
203 llvm_cerr << " " << NoAlias << " no alias responses ";
202 cerr << " " << AliasSum << " Total Alias Queries Performed\n";
203 cerr << " " << NoAlias << " no alias responses ";
204204 PrintPercent(NoAlias, AliasSum);
205 llvm_cerr << " " << MayAlias << " may alias responses ";
205 cerr << " " << MayAlias << " may alias responses ";
206206 PrintPercent(MayAlias, AliasSum);
207 llvm_cerr << " " << MustAlias << " must alias responses ";
207 cerr << " " << MustAlias << " must alias responses ";
208208 PrintPercent(MustAlias, AliasSum);
209 llvm_cerr << " Alias Analysis Evaluator Pointer Alias Summary: "
210 << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
211 << MustAlias*100/AliasSum << "%\n";
209 cerr << " Alias Analysis Evaluator Pointer Alias Summary: "
210 << NoAlias*100/AliasSum << "%/" << MayAlias*100/AliasSum << "%/"
211 << MustAlias*100/AliasSum << "%\n";
212212 }
213213
214214 // Display the summary for mod/ref analysis
215215 unsigned ModRefSum = NoModRef + Mod + Ref + ModRef;
216216 if (ModRefSum == 0) {
217 llvm_cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";
217 cerr << " Alias Analysis Mod/Ref Evaluator Summary: no mod/ref!\n";
218218 } else {
219 llvm_cerr << " " << ModRefSum << " Total ModRef Queries Performed\n";
220 llvm_cerr << " " << NoModRef << " no mod/ref responses ";
219 cerr << " " << ModRefSum << " Total ModRef Queries Performed\n";
220 cerr << " " << NoModRef << " no mod/ref responses ";
221221 PrintPercent(NoModRef, ModRefSum);
222 llvm_cerr << " " << Mod << " mod responses ";
222 cerr << " " << Mod << " mod responses ";
223223 PrintPercent(Mod, ModRefSum);
224 llvm_cerr << " " << Ref << " ref responses ";
224 cerr << " " << Ref << " ref responses ";
225225 PrintPercent(Ref, ModRefSum);
226 llvm_cerr << " " << ModRef << " mod & ref responses ";
226 cerr << " " << ModRef << " mod & ref responses ";
227227 PrintPercent(ModRef, ModRefSum);
228 llvm_cerr << " Alias Analysis Evaluator Mod/Ref Summary: "
229 << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
230 << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
228 cerr << " Alias Analysis Evaluator Mod/Ref Summary: "
229 << NoModRef*100/ModRefSum << "%/" << Mod*100/ModRefSum << "%/"
230 << Ref*100/ModRefSum << "%/" << ModRef*100/ModRefSum << "%\n";
231231 }
232232
233233 return false;
542542 OS << "\n";
543543 }
544544
545 void AliasSet::dump() const { print (llvm_cerr); }
546 void AliasSetTracker::dump() const { print(llvm_cerr); }
545 void AliasSet::dump() const { print (cerr); }
546 void AliasSetTracker::dump() const { print(cerr); }
547547
548548 //===----------------------------------------------------------------------===//
549549 // AliasSetPrinter Pass
563563
564564 for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I)
565565 Tracker->add(&*I);
566 Tracker->print(llvm_cerr);
566 Tracker->print(cerr);
567567 delete Tracker;
568568 return false;
569569 }
744744 assert(Offset1
745745
746746 if ((uint64_t)(Offset2-Offset1) >= SizeMax) {
747 //llvm_cerr << "Determined that these two GEP's don't alias ["
748 // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
747 //cerr << "Determined that these two GEP's don't alias ["
748 // << SizeMax << " bytes]: \n" << *GEP1 << *GEP2;
749749 return NoAlias;
750750 }
751751 }
9191 struct CFGPrinter : public FunctionPass {
9292 virtual bool runOnFunction(Function &F) {
9393 std::string Filename = "cfg." + F.getName() + ".dot";
94 llvm_cerr << "Writing '" << Filename << "'...";
94 cerr << "Writing '" << Filename << "'...";
9595 std::ofstream File(Filename.c_str());
9696
9797 if (File.good())
9898 WriteGraph(File, (const Function*)&F);
9999 else
100 llvm_cerr << " error opening file for writing!";
101 llvm_cerr << "\n";
100 cerr << " error opening file for writing!";
101 cerr << "\n";
102102 return false;
103103 }
104104
369369 /// dump - Allow printing from a debugger easily...
370370 ///
371371 void ConstantRange::dump() const {
372 print(llvm_cerr);
373 }
372 print(cerr);
373 }
500500 DSG->getNodeForValue(F->arg_begin()).mergeWith(N);
501501
502502 } else {
503 llvm_cerr << "Unrecognized external function: " << F->getName() << "\n";
503 cerr << "Unrecognized external function: " << F->getName() << "\n";
504504 abort();
505505 }
506506
587587 ++NumBUInlines;
588588 } else {
589589 if (!Printed)
590 llvm_cerr << "In Fns: " << Graph.getFunctionNames() << "\n";
591 llvm_cerr << " calls " << CalledFuncs.size()
592 << " fns from site: " << CS.getCallSite().getInstruction()
593 << " " << *CS.getCallSite().getInstruction();
594 llvm_cerr << " Fns =";
590 cerr << "In Fns: " << Graph.getFunctionNames() << "\n";
591 cerr << " calls " << CalledFuncs.size()
592 << " fns from site: " << CS.getCallSite().getInstruction()
593 << " " << *CS.getCallSite().getInstruction();
594 cerr << " Fns =";
595595 unsigned NumPrinted = 0;
596596
597597 for (std::vector::iterator I = CalledFuncs.begin(),
598598 E = CalledFuncs.end(); I != E; ++I) {
599 if (NumPrinted++ < 8) llvm_cerr << " " << (*I)->getName();
599 if (NumPrinted++ < 8) cerr << " " << (*I)->getName();
600600
601601 // Add the call edges to the call graph.
602602 ActualCallees.insert(std::make_pair(TheCall, *I));
603603 }
604 llvm_cerr << "\n";
604 cerr << "\n";
605605
606606 // See if we already computed a graph for this set of callees.
607607 std::sort(CalledFuncs.begin(), CalledFuncs.end());
644644 // Clean up the final graph!
645645 GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
646646 } else {
647 llvm_cerr << "***\n*** RECYCLED GRAPH ***\n***\n";
647 cerr << "***\n*** RECYCLED GRAPH ***\n***\n";
648648 }
649649
650650 GI = IndCallGraph.first;
684684 E = MainSM.global_end(); I != E; ++I)
685685 RC.getClonedNH(MainSM[*I]);
686686
687 //Graph.writeGraphToFile(llvm_cerr, "bu_" + F.getName());
687 //Graph.writeGraphToFile(cerr, "bu_" + F.getName());
688688 }
689689
690690 static const Function *getFnForValue(const Value *V) {
745745 return;
746746 }
747747
748 llvm_cerr << *From;
749 llvm_cerr << *To;
748 cerr << *From;
749 cerr << *To;
750750 assert(0 && "Do not know how to copy this yet!");
751751 abort();
752752 }
1616 //
1717 //===----------------------------------------------------------------------===//
1818
19 #include "llvm/Analysis/DataStructure/CallTargets.h"
1920 #include "llvm/Module.h"
2021 #include "llvm/Instructions.h"
2122 #include "llvm/Analysis/DataStructure/DataStructure.h"
2223 #include "llvm/Analysis/DataStructure/DSGraph.h"
23 #include "llvm/Analysis/DataStructure/CallTargets.h"
2424 #include "llvm/ADT/Statistic.h"
2525 #include "llvm/Support/Streams.h"
26 #include "llvm/Constants.h"
2627 #include
27 #include "llvm/Constants.h"
2828 using namespace llvm;
2929
3030 namespace {
5757 }
5858 if (N->isComplete() && !IndMap[cs].size()) {
5959 ++CompleteEmpty;
60 llvm_cerr << "Call site empty: '"
61 << cs.getInstruction()->getName()
62 << "' In '"
63 << cs.getInstruction()->getParent()->getParent()->getName()
64 << "'\n";
60 cerr << "Call site empty: '"
61 << cs.getInstruction()->getName()
62 << "' In '"
63 << cs.getInstruction()->getParent()->getParent()->getName()
64 << "'\n";
6565 }
6666 } else {
6767 ++DirCall;
2424 #include "llvm/ADT/STLExtras.h"
2525 #include "llvm/ADT/SCCIterator.h"
2626 #include "llvm/ADT/Statistic.h"
27 #include "llvm/Support/Streams.h"
2827 #include "llvm/Support/Timer.h"
2928 #include
3029 #include
12621261 }
12631262
12641263 // dump - Allow inspection of graph in a debugger.
1265 void DSGraph::dump() const { print(llvm_cerr); }
1264 void DSGraph::dump() const { print(cerr); }
12661265
12671266
12681267 /// remapLinks - Change all of the Links in the current node according to the
9191 totalNumCallees += Callees.size();
9292 ++numIndirectCalls;
9393 } else
94 llvm_cerr << "WARNING: No callee in Function '" << F.getName()
95 << "' at call: \n"
96 << *I->getCallSite().getInstruction();
94 cerr << "WARNING: No callee in Function '" << F.getName()
95 << "' at call: \n"
96 << *I->getCallSite().getInstruction();
9797 }
9898
9999 TotalNumCallees += totalNumCallees;
100100 NumIndirectCalls += numIndirectCalls;
101101
102102 if (numIndirectCalls)
103 llvm_cout << " In function " << F.getName() << ": "
104 << (totalNumCallees / (double) numIndirectCalls)
105 << " average callees per indirect call\n";
103 cout << " In function " << F.getName() << ": "
104 << (totalNumCallees / (double) numIndirectCalls)
105 << " average callees per indirect call\n";
106106 }
107107
108108 DSNode *DSGraphStats::getNodeForValue(Value *V) {
8989 if (MainFunc && !MainFunc->isExternal()) {
9090 processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
9191 } else {
92 llvm_cerr << "Fold Graphs: No 'main' function found!\n";
92 cerr << "Fold Graphs: No 'main' function found!\n";
9393 }
9494
9595 for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
8383 DSGC::DSGC() {
8484 if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() &&
8585 CheckFlags.empty() && AbortIfMerged.empty()) {
86 llvm_cerr << "The -datastructure-gc is useless if you don't specify any"
87 " -dsgc-* options. See the -help-hidden output for a list.\n";
86 cerr << "The -datastructure-gc is useless if you don't specify any"
87 << " -dsgc-* options. See the -help-hidden output for a list.\n";
8888 abort();
8989 }
9090 }
122122 for (DSGraph::node_const_iterator I = G.node_begin(), E = G.node_end();
123123 I != E; ++I)
124124 if (I->isNodeCompletelyFolded()) {
125 llvm_cerr << "Node is collapsed: ";
126 I->print(llvm_cerr, &G);
125 cerr << "Node is collapsed: ";
126 I->print(cerr, &G);
127127 abort();
128128 }
129129 }
141141 E = CheckFlags.end(); I != E; ++I) {
142142 std::string::size_type ColonPos = I->rfind(':');
143143 if (ColonPos == std::string::npos) {
144 llvm_cerr << "Error: '" << *I
145 << "' is an invalid value for the --dsgc-check-flags option!\n";
144 cerr << "Error: '" << *I
145 << "' is an invalid value for the --dsgc-check-flags option!\n";
146146 abort();
147147 }
148148
157157 case 'M': Flags |= DSNode::Modified; break;
158158 case 'R': Flags |= DSNode::Read; break;
159159 case 'A': Flags |= DSNode::Array; break;
160 default: llvm_cerr << "Invalid DSNode flag!\n"; abort();
160 default: cerr << "Invalid DSNode flag!\n"; abort();
161161 }
162162 CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags;
163163 }
175175
176176 // Verify it is not collapsed if it is not supposed to be...
177177 if (N->isNodeCompletelyFolded() && AbortIfCollapsedS.count(Name)) {
178 llvm_cerr << "Node for value '%" << Name << "' is collapsed: ";
179 N->print(llvm_cerr, &G);
178 cerr << "Node for value '%" << Name << "' is collapsed: ";
179 N->print(cerr, &G);
180180 abort();
181181 }
182182
183183 if (CheckFlagsM.count(Name) && CheckFlagsM[Name] != N->getNodeFlags()) {
184 llvm_cerr << "Node flags are not as expected for node: " << Name
185 << " (" << CheckFlagsM[Name] << ":" <getNodeFlags()
186 << ")\n";
187 N->print(llvm_cerr, &G);
184 cerr << "Node flags are not as expected for node: " << Name
185 << " (" << CheckFlagsM[Name] << ":" <getNodeFlags()
186 << ")\n";
187 N->print(cerr, &G);
188188 abort();
189189 }
190190
191191 // Verify that it is not merged if it is not supposed to be...
192192 if (AbortIfMergedS.count(Name)) {
193193 if (AbortIfMergedNodes.count(N)) {
194 llvm_cerr << "Nodes for values '%" << Name << "' and '%"
195 << AbortIfMergedNodes[N] << "' is merged: ";
196 N->print(llvm_cerr, &G);
194 cerr << "Nodes for values '%" << Name << "' and '%"
195 << AbortIfMergedNodes[N] << "' is merged: ";
196 N->print(cerr, &G);
197197 abort();
198198 }
199199 AbortIfMergedNodes[N] = Name;
433433 // Variable index into a node. We must merge all of the elements of the
434434 // sequential type here.
435435 if (isa(STy))
436 llvm_cerr << "Pointer indexing not handled yet!\n";
436 cerr << "Pointer indexing not handled yet!\n";
437437 else {
438438 const ArrayType *ATy = cast(STy);
439439 unsigned ElSize = TD.getTypeSize(CurTy);
10601060 if (DisableDirectCallOpt || !isa(Callee)) {
10611061 CalleeNode = getValueDest(*Callee).getNode();
10621062 if (CalleeNode == 0) {
1063 llvm_cerr << "WARNING: Program is calling through a null pointer?\n"<< *I;
1063 cerr << "WARNING: Program is calling through a null pointer?\n"<< *I;
10641064 return; // Calling a null pointer?
10651065 }
10661066 }
3636 Statistic NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)");
3737 }
3838
39 void DSNode::dump() const { print(llvm_cerr, 0); }
39 void DSNode::dump() const { print(cerr, 0); }
4040
4141 static std::string getCaption(const DSNode *N, const DSGraph *G) {
4242 std::stringstream OS;
5252 }
5353
5454 // print - Implement the Pass::print method...
55 void print(llvm_ostream O, const Module *M) const {
55 void print(OStream O, const Module *M) const {
5656 if (O.stream()) print(*O.stream(), M);
5757 }
5858 void print(std::ostream &O, const Module *M) const {
532532 case Instruction::BitCast:
533533 return getNodeForConstantPointer(CE->getOperand(0));
534534 default:
535 llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n";
535 cerr << "Constant Expr not yet handled: " << *CE << "\n";
536536 assert(0);
537537 }
538538 } else {
559559 case Instruction::BitCast:
560560 return getNodeForConstantPointerTarget(CE->getOperand(0));
561561 default:
562 llvm_cerr << "Constant Expr not yet handled: " << *CE << "\n";
562 cerr << "Constant Expr not yet handled: " << *CE << "\n";
563563 assert(0);
564564 }
565565 } else {
785785 return;
786786 default:
787787 // Is this something we aren't handling yet?
788 llvm_cerr << "Unknown instruction: " << I;
788 cerr << "Unknown instruction: " << I;
789789 abort();
790790 }
791791 }
11031103
11041104 void Andersens::PrintNode(Node *N) {
11051105 if (N == &GraphNodes[UniversalSet]) {
1106 llvm_cerr << "";
1106 cerr << "";
11071107 return;
11081108 } else if (N == &GraphNodes[NullPtr]) {
1109 llvm_cerr << "";
1109 cerr << "";
11101110 return;
11111111 } else if (N == &GraphNodes[NullObject]) {
1112 llvm_cerr << "";
1112 cerr << "";
11131113 return;
11141114 }
11151115
11181118 if (Function *F = dyn_cast(V)) {
11191119 if (isa(F->getFunctionType()->getReturnType()) &&
11201120 N == getReturnNode(F)) {
1121 llvm_cerr << F->getName() << ":retval";
1121 cerr << F->getName() << ":retval";
11221122 return;
11231123 } else if (F->getFunctionType()->isVarArg() && N == getVarargNode(F)) {
1124 llvm_cerr << F->getName() << ":vararg";
1124 cerr << F->getName() << ":vararg";
11251125 return;
11261126 }
11271127 }
11281128
11291129 if (Instruction *I = dyn_cast(V))
1130 llvm_cerr << I->getParent()->getParent()->getName() << ":";
1130 cerr << I->getParent()->getParent()->getName() << ":";
11311131 else if (Argument *Arg = dyn_cast(V))
1132 llvm_cerr << Arg->getParent()->getName() << ":";
1132 cerr << Arg->getParent()->getName() << ":";
11331133
11341134 if (V->hasName())
1135 llvm_cerr << V->getName();
1135 cerr << V->getName();
11361136 else
1137 llvm_cerr << "(unnamed)";
1137 cerr << "(unnamed)";
11381138
11391139 if (isa(V) || isa(V))
11401140 if (N == getObject(V))
1141 llvm_cerr << "";
1141 cerr << "";
11421142 }
11431143
11441144 void Andersens::PrintConstraints() {
1145 llvm_cerr << "Constraints:\n";
1145 cerr << "Constraints:\n";
11461146 for (unsigned i = 0, e = Constraints.size(); i != e; ++i) {
1147 llvm_cerr << " #" << i << ": ";
1147 cerr << " #" << i << ": ";
11481148 Constraint &C = Constraints[i];
11491149 if (C.Type == Constraint::Store)
1150 llvm_cerr << "*";
1150 cerr << "*";
11511151 PrintNode(C.Dest);
1152 llvm_cerr << " = ";
1152 cerr << " = ";
11531153 if (C.Type == Constraint::Load)
1154 llvm_cerr << "*";
1154 cerr << "*";
11551155 PrintNode(C.Src);
1156 llvm_cerr << "\n";
1156 cerr << "\n";
11571157 }
11581158 }
11591159
11601160 void Andersens::PrintPointsToGraph() {
1161 llvm_cerr << "Points-to graph:\n";
1161 cerr << "Points-to graph:\n";
11621162 for (unsigned i = 0, e = GraphNodes.size(); i != e; ++i) {
11631163 Node *N = &GraphNodes[i];
1164 llvm_cerr << "[" << (N->end() - N->begin()) << "] ";
1164 cerr << "[" << (N->end() - N->begin()) << "] ";
11651165 PrintNode(N);
1166 llvm_cerr << "\t--> ";
1166 cerr << "\t--> ";
11671167 for (Node::iterator I = N->begin(), E = N->end(); I != E; ++I) {
1168 if (I != N->begin()) llvm_cerr << ", ";
1168 if (I != N->begin()) cerr << ", ";
11691169 PrintNode(*I);
11701170 }
1171 llvm_cerr << "\n";
1172 }
1173 }
1171 cerr << "\n";
1172 }
1173 }
7373 AU.setPreservesAll();
7474 }
7575
76 void print(llvm_ostream &o, const Module *M) const {
76 void print(OStream &o, const Module *M) const {
7777 if (o.stream()) print(*o.stream(), M);
7878 }
7979
9494 /// dump - Print out this call graph.
9595 ///
9696 inline void dump() const {
97 print(llvm_cerr, Mod);
97 print(cerr, Mod);
9898 }
9999
100100 CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; }
211211 }
212212
213213 void CallGraph::dump() const {
214 print(llvm_cerr, 0);
214 print(cerr, 0);
215215 }
216216
217217 //===----------------------------------------------------------------------===//
274274 OS << "\n";
275275 }
276276
277 void CallGraphNode::dump() const { print(llvm_cerr); }
277 void CallGraphNode::dump() const { print(cerr); }
278278
279279 void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) {
280280 for (unsigned i = CalledFunctions.size(); ; --i) {
4242 #include "llvm/Instruction.def"
4343
4444 void visitInstruction(Instruction &I) {
45 llvm_cerr << "Instruction Count does not know about " << I;
45 cerr << "Instruction Count does not know about " << I;
4646 abort();
4747 }
4848 public:
7979 }
8080
8181 void Loop::dump() const {
82 print(llvm_cerr);
82 print(cerr);
8383 }
8484
8585
3636 // Read the number of entries...
3737 unsigned NumEntries;
3838 if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) {
39 llvm_cerr << ToolName << ": data packet truncated!\n";
39 cerr << ToolName << ": data packet truncated!\n";
4040 perror(0);
4141 exit(1);
4242 }
4747
4848 // Read in the block of data...
4949 if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) {
50 llvm_cerr << ToolName << ": data packet truncated!\n";
50 cerr << ToolName << ": data packet truncated!\n";
5151 perror(0);
5252 exit(1);
5353 }
7474 Module &TheModule) : M(TheModule) {
7575 FILE *F = fopen(Filename.c_str(), "r");
7676 if (F == 0) {
77 llvm_cerr << ToolName << ": Error opening '" << Filename << "': ";
77 cerr << ToolName << ": Error opening '" << Filename << "': ";
7878 perror(0);
7979 exit(1);
8080 }
9292 case ArgumentInfo: {
9393 unsigned ArgLength;
9494 if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) {
95 llvm_cerr << ToolName << ": arguments packet truncated!\n";
95 cerr << ToolName << ": arguments packet truncated!\n";
9696 perror(0);
9797 exit(1);
9898 }
103103
104104 if (ArgLength)
105105 if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) {
106 llvm_cerr << ToolName << ": arguments packet truncated!\n";
106 cerr << ToolName << ": arguments packet truncated!\n";
107107 perror(0);
108108 exit(1);
109109 }
128128 break;
129129
130130 default:
131 llvm_cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";
131 cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";
132132 exit(1);
133133 }
134134 }
155155 Counts.push_back(std::make_pair(BlockCounts[i].first->getParent(),
156156 BlockCounts[i].second));
157157 } else {
158 llvm_cerr << "Function counts are not available!\n";
158 cerr << "Function counts are not available!\n";
159159 }
160160 return;
161161 }
199199 if (SuccNum >= TI->getNumSuccessors()) {
200200 static bool Warned = false;
201201 if (!Warned) {
202 llvm_cerr << "WARNING: profile info doesn't seem to match"
203 << " the program!\n";
202 cerr << "WARNING: profile info doesn't seem to match"
203 << " the program!\n";
204204 Warned = true;
205205 }
206206 } else {
225225 }
226226
227227 } else {
228 llvm_cerr << "Block counts are not available!\n";
228 cerr << "Block counts are not available!\n";
229229 }
230230 return;
231231 }
246246 void ProfileInfoLoader::getEdgeCounts(std::vector
247247 unsigned> > &Counts) {
248248 if (EdgeCounts.empty()) {
249 llvm_cerr << "Edge counts not available, and no synthesis "
250 << "is implemented yet!\n";
249 cerr << "Edge counts not available, and no synthesis "
250 << "is implemented yet!\n";
251251 return;
252252 }
253253
267267 //
268268 void ProfileInfoLoader::getBBTrace(std::vector &Trace) {
269269 if (BBTrace.empty ()) {
270 llvm_cerr << "Basic block trace is not available!\n";
271 return;
272 }
273 llvm_cerr << "Basic block trace loading is not implemented yet!\n";
274 }
275
270 cerr << "Basic block trace is not available!\n";
271 return;
272 }
273 cerr << "Basic block trace loading is not implemented yet!\n";
274 }
7575 TerminatorInst *TI = BB->getTerminator();
7676 if (SuccNum >= TI->getNumSuccessors()) {
7777 if (!PrintedWarning) {
78 llvm_cerr << "WARNING: profile information is inconsistent with "
79 << "the current program!\n";
78 cerr << "WARNING: profile information is inconsistent with "
79 << "the current program!\n";
8080 PrintedWarning = true;
8181 }
8282 } else {
117117 //
118118 SCEV::~SCEV() {}
119119 void SCEV::dump() const {
120 print(llvm_cerr);
120 print(cerr);
121121 }
122122
123123 /// getValueRange - Return the tightest constant bounds that this value is
15571557 break;
15581558 default:
15591559 #if 0
1560 llvm_cerr << "ComputeIterationCount ";
1560 cerr << "ComputeIterationCount ";
15611561 if (ExitCond->getOperand(0)->getType()->isUnsigned())
1562 llvm_cerr << "[unsigned] ";
1563 llvm_cerr << *LHS << " "
1564 << Instruction::getOpcodeName(Cond) << " " << *RHS << "\n";
1562 cerr << "[unsigned] ";
1563 cerr << *LHS << " "
1564 << Instruction::getOpcodeName(Cond) << " " << *RHS << "\n";
15651565 #endif
15661566 break;
15671567 }
16771677 if (!isa(Result)) break; // Couldn't decide for sure
16781678 if (cast(Result)->getValue() == false) {
16791679 #if 0
1680 llvm_cerr << "\n***\n*** Computed loop count " << *ItCst
1681 << "\n*** From global " << *GV << "*** BB: " << *L->getHeader()
1682 << "***\n";
1680 cerr << "\n***\n*** Computed loop count " << *ItCst
1681 << "\n*** From global " << *GV << "*** BB: " << *L->getHeader()
1682 << "***\n";
16831683 #endif
16841684 ++NumArrayLenItCounts;
16851685 return SCEVConstant::get(ItCst); // Found terminating iteration!
21462146 SCEVConstant *R2 = dyn_cast(Roots.second);
21472147 if (R1) {
21482148 #if 0
2149 llvm_cerr << "HFTZ: " << *V << " - sol#1: " << *R1
2150 << " sol#2: " << *R2 << "\n";
2149 cerr << "HFTZ: " << *V << " - sol#1: " << *R1
2150 << " sol#2: " << *R2 << "\n";
21512151 #endif
21522152 // Pick the smallest positive root value.
21532153 assert(R1->getType()->isUnsigned()&&"Didn't canonicalize to unsigned?");
22752275 default: break;
22762276 }
22772277
2278 //llvm_cerr << "Computed Loop Trip Count as: " <<
2279 // *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n";
2278 //cerr << "Computed Loop Trip Count as: "
2279 // << *SCEV::getMinusSCEV(RHS, AddRec->getOperand(0)) << "\n";
22802280 return SCEV::getMinusSCEV(RHS, AddRec->getOperand(0));
22812281 }
22822282
24912491 for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
24922492 PrintLoopInfo(OS, SE, *I);
24932493
2494 llvm_cerr << "Loop " << L->getHeader()->getName() << ": ";
2494 cerr << "Loop " << L->getHeader()->getName() << ": ";
24952495
24962496 std::vector ExitBlocks;
24972497 L->getExitBlocks(ExitBlocks);
24982498 if (ExitBlocks.size() != 1)
2499 llvm_cerr << " ";
2499 cerr << " ";
25002500
25012501 if (SE->hasLoopInvariantIterationCount(L)) {
2502 llvm_cerr << *SE->getIterationCount(L) << " iterations! ";
2502 cerr << *SE->getIterationCount(L) << " iterations! ";
25032503 } else {
2504 llvm_cerr << "Unpredictable iteration count. ";
2505 }
2506
2507 llvm_cerr << "\n";
2504 cerr << "Unpredictable iteration count. ";
2505 }
2506
2507 cerr << "\n";
25082508 }
25092509
25102510 void ScalarEvolution::print(std::ostream &OS, const Module* ) const {
1212 //
1313 //===----------------------------------------------------------------------===//
1414
15 #include "llvm/Analysis/ScalarEvolutionExpander.h"
1516 #include "llvm/Analysis/LoopInfo.h"
16 #include "llvm/Analysis/ScalarEvolutionExpander.h"
17
1817 using namespace llvm;
1918
2019 /// InsertCastOfTo - Insert a cast of V to the specified type, doing what
174173 SCEVHandle IH = SCEVUnknown::get(I); // Get I as a "symbolic" SCEV.
175174
176175 SCEVHandle V = S->evaluateAtIteration(IH);
177 //llvm_cerr << "Evaluated: " << *this << "\n to: " << *V << "\n";
176 //cerr << "Evaluated: " << *this << "\n to: " << *V << "\n";
178177
179178 return expandInTy(V, Ty);
180179 }
2424 return getEntryBasicBlock()->getParent();
2525 }
2626
27
2827 Module *Trace::getModule() const {
2928 return getFunction()->getParent();
3029 }
3130
3231 /// print - Write trace to output stream.
3332 ///
34 void Trace::print(llvm_ostream &O) const {
33 void Trace::print(OStream &O) const {
3534 Function *F = getFunction ();
3635 O << "; Trace from function " << F->getName() << ", blocks:\n";
3736 for (const_iterator i = begin(), e = end(); i != e; ++i) {
4746 /// output stream.
4847 ///
4948 void Trace::dump() const {
50 print(llvm_cerr);
49 print(cerr);
5150 }
None /* A Bison parser, made by GNU Bison 2.1. */
1
2 /* Skeleton parser for Yacc-like parsing with Bison,
3 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
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.
46
57 This program is free software; you can redistribute it and/or modify
68 it under the terms of the GNU General Public License as published by
1719 Foundation, Inc., 51 Franklin Street, Fifth Floor,
1820 Boston, MA 02110-1301, USA. */
1921
20 /* As a special exception, when this file is copied by Bison into a
21 Bison output file, you may use that output file without restriction.
22 This special exception was added by the Free Software Foundation
23 in version 1.24 of Bison. */
24
25 /* Written by Richard Stallman by simplifying the original so called
26 ``semantic'' parser. */
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. */
2737
2838 /* All symbols defined below should begin with yy or YY, to avoid
2939 infringing on user name space. This should be done even for local
3646 #define YYBISON 1
3747
3848 /* Bison version. */
39 #define YYBISON_VERSION "2.1"
49 #define YYBISON_VERSION "2.3"
4050
4151 /* Skeleton name. */
4252 #define YYSKELETON_NAME "yacc.c"
355365
356366
357367 /* Copy the first part of user declarations. */
358 #line 14 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
368 #line 14 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
359369
360370 #include "ParserInternals.h"
361371 #include "llvm/CallingConv.h"
402412 //
403413 //#define DEBUG_UPREFS 1
404414 #ifdef DEBUG_UPREFS
405 #define UR_OUT(X) llvm_cerr << X
415 #define UR_OUT(X) cerr << X
406416 #else
407417 #define UR_OUT(X)
408418 #endif
12151225 # define YYTOKEN_TABLE 0
12161226 #endif
12171227
1218 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
1219 #line 855 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
1220 typedef union YYSTYPE {
1228 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
1229 typedef union YYSTYPE
1230 #line 855 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
1231 {
12211232 llvm::Module *ModuleVal;
12221233 llvm::Function *FunctionVal;
12231234 std::pair *ArgVal;
12581269 llvm::Module::Endianness Endianness;
12591270 llvm::ICmpInst::Predicate IPredicate;
12601271 llvm::FCmpInst::Predicate FPredicate;
1261 } YYSTYPE;
1262 /* Line 196 of yacc.c. */
1263 #line 1265 "llvmAsmParser.tab.c"
1272 }
1273 /* Line 193 of yacc.c. */
1274 #line 1276 "llvmAsmParser.tab.c"
1275 YYSTYPE;
12641276 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
12651277 # define YYSTYPE_IS_DECLARED 1
12661278 # define YYSTYPE_IS_TRIVIAL 1
12711283 /* Copy the second part of user declarations. */
12721284
12731285
1274 /* Line 219 of yacc.c. */
1275 #line 1277 "llvmAsmParser.tab.c"
1276
1277 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
1278 # define YYSIZE_T __SIZE_TYPE__
1286 /* Line 216 of yacc.c. */
1287 #line 1289 "llvmAsmParser.tab.c"
1288
1289 #ifdef short
1290 # undef short
12791291 #endif
1280 #if ! defined (YYSIZE_T) && defined (size_t)
1281 # define YYSIZE_T size_t
1292
1293 #ifdef YYTYPE_UINT8
1294 typedef YYTYPE_UINT8 yytype_uint8;
1295 #else
1296 typedef unsigned char yytype_uint8;
12821297 #endif
1283 #if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
1284 # include /* INFRINGES ON USER NAME SPACE */
1285 # define YYSIZE_T size_t
1298
1299 #ifdef YYTYPE_INT8
1300 typedef YYTYPE_INT8 yytype_int8;
1301 #elif (defined __STDC__ || defined __C99__FUNC__ \
1302 || defined __cplusplus || defined _MSC_VER)
1303 typedef signed char yytype_int8;
1304 #else
1305 typedef short int yytype_int8;
12861306 #endif
1287 #if ! defined (YYSIZE_T)
1288 # define YYSIZE_T unsigned int
1307
1308 #ifdef YYTYPE_UINT16
1309 typedef YYTYPE_UINT16 yytype_uint16;
1310 #else
1311 typedef unsigned short int yytype_uint16;
12891312 #endif
1313
1314 #ifdef YYTYPE_INT16
1315 typedef YYTYPE_INT16 yytype_int16;
1316 #else
1317 typedef short int yytype_int16;
1318 #endif
1319
1320 #ifndef YYSIZE_T
1321 # ifdef __SIZE_TYPE__
1322 # define YYSIZE_T __SIZE_TYPE__
1323 # elif defined size_t
1324 # define YYSIZE_T size_t
1325 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
1326 || defined __cplusplus || defined _MSC_VER)
1327 # include /* INFRINGES ON USER NAME SPACE */
1328 # define YYSIZE_T size_t
1329 # else
1330 # define YYSIZE_T unsigned int
1331 # endif
1332 #endif
1333
1334 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
12901335
12911336 #ifndef YY_
12921337 # if YYENABLE_NLS
13001345 # endif
13011346 #endif
13021347
1303 #if ! defined (yyoverflow) || YYERROR_VERBOSE
1348 /* Suppress unused-variable warnings by "using" E. */
1349 #if ! defined lint || defined __GNUC__
1350 # define YYUSE(e) ((void) (e))
1351 #else
1352 # define YYUSE(e) /* empty */
1353 #endif
1354
1355 /* Identity function, used to suppress warnings about constant conditions. */
1356 #ifndef lint
1357 # define YYID(n) (n)
1358 #else
1359 #if (defined __STDC__ || defined __C99__FUNC__ \
1360 || defined __cplusplus || defined _MSC_VER)
1361 static int
1362 YYID (int i)
1363 #else
1364 static int
1365 YYID (i)
1366 int i;
1367 #endif
1368 {
1369 return i;
1370 }
1371 #endif
1372
1373 #if ! defined yyoverflow || YYERROR_VERBOSE
13041374
13051375 /* The parser invokes alloca or malloc; define the necessary symbols. */
13061376
13081378 # if YYSTACK_USE_ALLOCA
13091379 # ifdef __GNUC__
13101380 # define YYSTACK_ALLOC __builtin_alloca
1381 # elif defined __BUILTIN_VA_ARG_INCR
1382 # include /* INFRINGES ON USER NAME SPACE */
1383 # elif defined _AIX
1384 # define YYSTACK_ALLOC __alloca
1385 # elif defined _MSC_VER
1386 # include /* INFRINGES ON USER NAME SPACE */
1387 # define alloca _alloca
13111388 # else
13121389 # define YYSTACK_ALLOC alloca
1313 # if defined (__STDC__) || defined (__cplusplus)
1390 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1391 || defined __cplusplus || defined _MSC_VER)
13141392 # include /* INFRINGES ON USER NAME SPACE */
1315 # define YYINCLUDED_STDLIB_H
1393 # ifndef _STDLIB_H
1394 # define _STDLIB_H 1
1395 # endif
13161396 # endif
13171397 # endif
13181398 # endif
13191399 # endif
13201400
13211401 # ifdef YYSTACK_ALLOC
1322 /* Pacify GCC's `empty if-body' warning. */
1323 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
1402 /* Pacify GCC's `empty if-body' warning. */
1403 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
13241404 # ifndef YYSTACK_ALLOC_MAXIMUM
13251405 /* The OS might guarantee only one guard page at the bottom of the stack,
13261406 and a page size can be as small as 4096 bytes. So we cannot safely
13271407 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
13281408 to allow for a few compiler-allocated temporary stack slots. */
1329 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
1409 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
13301410 # endif
13311411 # else
13321412 # define YYSTACK_ALLOC YYMALLOC
13331413 # define YYSTACK_FREE YYFREE
13341414 # ifndef YYSTACK_ALLOC_MAXIMUM
1335 # define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
1415 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
13361416 # endif
1337 # ifdef __cplusplus
1338 extern "C" {
1417 # if (defined __cplusplus && ! defined _STDLIB_H \
1418 && ! ((defined YYMALLOC || defined malloc) \
1419 && (defined YYFREE || defined free)))
1420 # include /* INFRINGES ON USER NAME SPACE */
1421 # ifndef _STDLIB_H
1422 # define _STDLIB_H 1
1423 # endif
13391424 # endif
13401425 # ifndef YYMALLOC
13411426 # define YYMALLOC malloc
1342 # if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
1343 && (defined (__STDC__) || defined (__cplusplus)))
1427 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1428 || defined __cplusplus || defined _MSC_VER)
13441429 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
13451430 # endif
13461431 # endif
13471432 # ifndef YYFREE
13481433 # define YYFREE free
1349 # if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
1350 && (defined (__STDC__) || defined (__cplusplus)))
1434 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
13511436 void free (void *); /* INFRINGES ON USER NAME SPACE */
13521437 # endif
13531438 # endif
1354 # ifdef __cplusplus
1355 }
1356 # endif
13571439 # endif
1358 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
1359
1360
1361 #if (! defined (yyoverflow) \
1362 && (! defined (__cplusplus) \
1363 || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1440 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
1441
1442
1443 #if (! defined yyoverflow \
1444 && (! defined __cplusplus \
1445 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
13641446
13651447 /* A type that is properly aligned for any stack member. */
13661448 union yyalloc
13671449 {
1368 short int yyss;
1450 yytype_int16 yyss;
13691451 YYSTYPE yyvs;
13701452 };
13711453
13751457 /* The size of an array large to enough to hold all stacks, each with
13761458 N elements. */
13771459 # define YYSTACK_BYTES(N) \
1378 ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
1460 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
13791461 + YYSTACK_GAP_MAXIMUM)
13801462
13811463 /* Copy COUNT objects from FROM to TO. The source and destination do
13821464 not overlap. */
13831465 # ifndef YYCOPY
1384 # if defined (__GNUC__) && 1 < __GNUC__
1466 # if defined __GNUC__ && 1 < __GNUC__
13851467 # define YYCOPY(To, From, Count) \
13861468 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
13871469 # else
13921474 for (yyi = 0; yyi < (Count); yyi++) \
13931475 (To)[yyi] = (From)[yyi]; \
13941476 } \
1395 while (0)
1477 while (YYID (0))
13961478 # endif
13971479 # endif
13981480
14101492 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
14111493 yyptr += yynewbytes / sizeof (*yyptr); \
14121494 } \
1413 while (0)
1495 while (YYID (0))
14141496
14151497 #endif
14161498
1417 #if defined (__STDC__) || defined (__cplusplus)
1418 typedef signed char yysigned_char;
1419 #else
1420 typedef short int yysigned_char;
1421 #endif
1422
1423 /* YYFINAL -- State number of the termination state. */
1499 /* YYFINAL -- State number of the termination state. */
14241500 #define YYFINAL 4
14251501 /* YYLAST -- Last index in YYTABLE. */
14261502 #define YYLAST 1509
14271503
1428 /* YYNTOKENS -- Number of terminals. */
1504 /* YYNTOKENS -- Number of terminals. */
14291505 #define YYNTOKENS 159
1430 /* YYNNTS -- Number of nonterminals. */
1506 /* YYNNTS -- Number of nonterminals. */
14311507 #define YYNNTS 78
1432 /* YYNRULES -- Number of rules. */
1508 /* YYNRULES -- Number of rules. */
14331509 #define YYNRULES 297
1434 /* YYNRULES -- Number of states. */
1510 /* YYNRULES -- Number of states. */
14351511 #define YYNSTATES 578
14361512
14371513 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
14421518 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
14431519
14441520 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
1445 static const unsigned char yytranslate[] =
1521 static const yytype_uint8 yytranslate[] =
14461522 {
14471523 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
14481524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
14891565 #if YYDEBUG
14901566 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
14911567 YYRHS. */
1492 static const unsigned short int yyprhs[] =
1568 static const yytype_uint16 yyprhs[] =
14931569 {
14941570 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
14951571 19, 21, 23, 25, 27, 29, 31, 33, 35, 37,
15231599 884, 888, 895, 899, 906, 909, 914, 921
15241600 };
15251601
1526 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1527 static const short int yyrhs[] =
1602 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1603 static const yytype_int16 yyrhs[] =
15281604 {
15291605 193, 0, -1, 5, -1, 6, -1, 3, -1, 4,
15301606 -1, 78, -1, 79, -1, 80, -1, 81, -1, 82,
16221698 };
16231699
16241700 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
1625 static const unsigned short int yyrline[] =
1701 static const yytype_uint16 yyrline[] =
16261702 {
16271703 0, 990, 990, 991, 999, 1000, 1010, 1010, 1010, 1010,
16281704 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1012, 1012,
16591735
16601736 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
16611737 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1662 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
1738 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
16631739 static const char *const yytname[] =
16641740 {
16651741 "$end", "error", "$undefined", "ESINT64VAL", "EUINT64VAL", "SINTVAL",
17071783 # ifdef YYPRINT
17081784 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
17091785 token YYLEX-NUM. */
1710 static const unsigned short int yytoknum[] =
1786 static const yytype_uint16 yytoknum[] =
17111787 {
17121788 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
17131789 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
17291805 # endif
17301806
17311807 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1732 static const unsigned char yyr1[] =
1808 static const yytype_uint8 yyr1[] =
17331809 {
17341810 0, 159, 160, 160, 161, 161, 162, 162, 162, 162,
17351811 162, 162, 162, 162, 162, 163, 163, 163, 164, 164,
17641840 };
17651841
17661842 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1767 static const unsigned char yyr2[] =
1843 static const yytype_uint8 yyr2[] =
17681844 {
17691845 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
17701846 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
18011877 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
18021878 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
18031879 means the default is an error. */
1804 static const unsigned short int yydefact[] =
1880 static const yytype_uint16 yydefact[] =
18051881 {
18061882 191, 0, 86, 177, 1, 176, 224, 79, 80, 81,
18071883 82, 83, 84, 85, 0, 87, 248, 173, 174, 248,
18631939 0, 0, 0, 260, 0, 0, 259, 256
18641940 };
18651941
1866 /* YYDEFGOTO[NTERM-NUM]. */
1867 static const short int yydefgoto[] =
1942 /* YYDEFGOTO[NTERM-NUM]. */
1943 static const yytype_int16 yydefgoto[] =
18681944 {
18691945 -1, 86, 299, 316, 317, 318, 319, 320, 253, 270,
18701946 211, 212, 241, 213, 25, 15, 37, 497, 355, 436,
18791955 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
18801956 STATE-NUM. */
18811957 #define YYPACT_NINF -517
1882 static const short int yypact[] =
1958 static const yytype_int16 yypact[] =
18831959 {
18841960 -517, 40, 69, 528, -517, -517, -517, -517, -517, -517,
18851961 -517, -517, -517, -517, 16, 90, 76, -517, -517, 5,
19422018 };
19432019
19442020 /* YYPGOTO[NTERM-NUM]. */
1945 static const short int yypgoto[] =
2021 static const yytype_int16 yypgoto[] =
19462022 {
19472023 -517, -517, -517, 286, 288, 291, 317, 320, 134, 80,
19482024 -127, -125, -502, -517, 340, 391, -114, -517, -265, 14,
19592035 number is the opposite. If zero, do what YYDEFACT says.
19602036 If YYTABLE_NINF, syntax error. */
19612037 #define YYTABLE_NINF -173
1962 static const short int yytable[] =
2038 static const yytype_int16 yytable[] =
19632039 {
19642040 89, 225, 106, 239, 228, 240, 26, 357, 414, 377,
19652041 378, 94, 400, 416, 434, 123, 89, 242, 215, 119,
21142190 0, 82, 0, 0, 83, 0, 0, 84, 0, 85
21152191 };
21162192
2117 static const short int yycheck[] =
2193 static const yytype_int16 yycheck[] =
21182194 {
21192195 37, 125, 53, 130, 128, 130, 3, 272, 15, 293,
21202196 294, 29, 154, 15, 34, 157, 53, 131, 112, 85,
22712347
22722348 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
22732349 symbol of state STATE-NUM. */
2274 static const unsigned char yystos[] =
2350 static const yytype_uint8 yystos[] =
22752351 {
22762352 0, 193, 194, 195, 0, 25, 31, 41, 42, 43,
22772353 44, 45, 46, 47, 62, 174, 212, 214, 216, 223,
23582434 yychar = (Token); \
23592435 yylval = (Value); \
23602436 yytoken = YYTRANSLATE (yychar); \
2361 YYPOPSTACK; \
2437 YYPOPSTACK (1); \
23622438 goto yybackup; \
23632439 } \
23642440 else \
23662442 yyerror (YY_("syntax error: cannot back up")); \
23672443 YYERROR; \
23682444 } \
2369 while (0)
2445 while (YYID (0))
23702446
23712447
23722448 #define YYTERROR 1
23812457 #ifndef YYLLOC_DEFAULT
23822458 # define YYLLOC_DEFAULT(Current, Rhs, N) \
23832459 do \
2384 if (N) \
2460 if (YYID (N)) \
23852461 { \
23862462 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
23872463 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
23952471 (Current).first_column = (Current).last_column = \
23962472 YYRHSLOC (Rhs, 0).last_column; \
23972473 } \
2398 while (0)
2474 while (YYID (0))
23992475 #endif
24002476
24012477
24072483 # if YYLTYPE_IS_TRIVIAL
24082484 # define YY_LOCATION_PRINT(File, Loc) \
24092485 fprintf (File, "%d.%d-%d.%d", \
2410 (Loc).first_line, (Loc).first_column, \
2411 (Loc).last_line, (Loc).last_column)
2486 (Loc).first_line, (Loc).first_column, \
2487 (Loc).last_line, (Loc).last_column)
24122488 # else
24132489 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
24142490 # endif
24352511 do { \
24362512 if (yydebug) \
24372513 YYFPRINTF Args; \
2438 } while (0)
2439
2440 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2441 do { \
2442 if (yydebug) \
2443 { \
2444 YYFPRINTF (stderr, "%s ", Title); \
2445 yysymprint (stderr, \
2446 Type, Value); \
2447 YYFPRINTF (stderr, "\n"); \
2448 } \
2449 } while (0)
2514 } while (YYID (0))
2515
2516 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
2517 do { \
2518 if (yydebug) \
2519 { \
2520 YYFPRINTF (stderr, "%s ", Title); \
2521 yy_symbol_print (stderr, \
2522 Type, Value); \
2523 YYFPRINTF (stderr, "\n"); \
2524 } \
2525 } while (YYID (0))
2526
2527
2528 /*--------------------------------.
2529 | Print this symbol on YYOUTPUT. |
2530 `--------------------------------*/
2531
2532 /*ARGSUSED*/
2533 #if (defined __STDC__ || defined __C99__FUNC__ \
2534 || defined __cplusplus || defined _MSC_VER)
2535 static void
2536 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2537 #else
2538 static void
2539 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
2540 FILE *yyoutput;
2541 int yytype;
2542 YYSTYPE const * const yyvaluep;
2543 #endif
2544 {
2545 if (!yyvaluep)
2546 return;
2547 # ifdef YYPRINT
2548 if (yytype < YYNTOKENS)
2549 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2550 # else
2551 YYUSE (yyoutput);
2552 # endif
2553 switch (yytype)
2554 {
2555 default:
2556 break;
2557 }
2558 }
2559
2560
2561 /*--------------------------------.
2562 | Print this symbol on YYOUTPUT. |
2563 `--------------------------------*/
2564
2565 #if (defined __STDC__ || defined __C99__FUNC__ \
2566 || defined __cplusplus || defined _MSC_VER)
2567 static void
2568 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
2569 #else
2570 static void
2571 yy_symbol_print (yyoutput, yytype, yyvaluep)
2572 FILE *yyoutput;
2573 int yytype;
2574 YYSTYPE const * const yyvaluep;
2575 #endif
2576 {
2577 if (yytype < YYNTOKENS)
2578 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2579 else
2580 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2581
2582 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
2583 YYFPRINTF (yyoutput, ")");
2584 }
24502585
24512586 /*------------------------------------------------------------------.
24522587 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
24532588 | TOP (included). |
24542589 `------------------------------------------------------------------*/
24552590
2456 #if defined (__STDC__) || defined (__cplusplus)
2591 #if (defined __STDC__ || defined __C99__FUNC__ \
2592 || defined __cplusplus || defined _MSC_VER)
24572593 static void
2458 yy_stack_print (short int *bottom, short int *top)
2594 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
24592595 #else
24602596 static void
24612597 yy_stack_print (bottom, top)
2462 short int *bottom;
2463 short int *top;
2598 yytype_int16 *bottom;
2599 yytype_int16 *top;
24642600 #endif
24652601 {
24662602 YYFPRINTF (stderr, "Stack now");
2467 for (/* Nothing. */; bottom <= top; ++bottom)
2603 for (; bottom <= top; ++bottom)
24682604 YYFPRINTF (stderr, " %d", *bottom);
24692605 YYFPRINTF (stderr, "\n");
24702606 }
24732609 do { \
24742610 if (yydebug) \
24752611 yy_stack_print ((Bottom), (Top)); \
2476 } while (0)
2612 } while (YYID (0))
24772613
24782614
24792615 /*------------------------------------------------.
24802616 | Report that the YYRULE is going to be reduced. |
24812617 `------------------------------------------------*/
24822618
2483 #if defined (__STDC__) || defined (__cplusplus)
2619 #if (defined __STDC__ || defined __C99__FUNC__ \
2620 || defined __cplusplus || defined _MSC_VER)
24842621 static void
2485 yy_reduce_print (int yyrule)
2622 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
24862623 #else
24872624 static void
2488 yy_reduce_print (yyrule)
2625 yy_reduce_print (yyvsp, yyrule)
2626 YYSTYPE *yyvsp;
24892627 int yyrule;
24902628 #endif
24912629 {
2630 int yynrhs = yyr2[yyrule];
24922631 int yyi;
24932632 unsigned long int yylno = yyrline[yyrule];
2494 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
2495 yyrule - 1, yylno);
2496 /* Print the symbols being reduced, and their result. */
2497 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
2498 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
2499 YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
2633 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
2634 yyrule - 1, yylno);
2635 /* The symbols being reduced. */
2636 for (yyi = 0; yyi < yynrhs; yyi++)
2637 {
2638 fprintf (stderr, " $%d = ", yyi + 1);
2639 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
2640 &(yyvsp[(yyi + 1) - (yynrhs)])
2641 );
2642 fprintf (stderr, "\n");
2643 }
25002644 }
25012645
25022646 # define YY_REDUCE_PRINT(Rule) \
25032647 do { \
25042648 if (yydebug) \
2505 yy_reduce_print (Rule); \
2506 } while (0)
2649 yy_reduce_print (yyvsp, Rule); \
2650 } while (YYID (0))
25072651
25082652 /* Nonzero means print parse trace. It is left uninitialized so that
25092653 multiple parsers can coexist. */
25372681 #if YYERROR_VERBOSE
25382682
25392683 # ifndef yystrlen
2540 # if defined (__GLIBC__) && defined (_STRING_H)
2684 # if defined __GLIBC__ && defined _STRING_H
25412685 # define yystrlen strlen
25422686 # else
25432687 /* Return the length of YYSTR. */
2688 #if (defined __STDC__ || defined __C99__FUNC__ \
2689 || defined __cplusplus || defined _MSC_VER)
25442690 static YYSIZE_T
2545 # if defined (__STDC__) || defined (__cplusplus)
25462691 yystrlen (const char *yystr)
2547 # else
2692 #else
2693 static YYSIZE_T
25482694 yystrlen (yystr)
2549 const char *yystr;
2550 # endif
2695 const char *yystr;
2696 #endif
25512697 {
2552 const char *yys = yystr;
2553
2554 while (*yys++ != '\0')
2698 YYSIZE_T yylen;
2699 for (yylen = 0; yystr[yylen]; yylen++)
25552700 continue;
2556
2557 return yys - yystr - 1;
2701 return yylen;
25582702 }
25592703 # endif
25602704 # endif
25612705
25622706 # ifndef yystpcpy
2563 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
2707 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
25642708 # define yystpcpy stpcpy
25652709 # else
25662710 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
25672711 YYDEST. */
2712 #if (defined __STDC__ || defined __C99__FUNC__ \
2713 || defined __cplusplus || defined _MSC_VER)
25682714 static char *
2569 # if defined (__STDC__) || defined (__cplusplus)
25702715 yystpcpy (char *yydest, const char *yysrc)
2571 # else
2716 #else
2717 static char *
25722718 yystpcpy (yydest, yysrc)
2573 char *yydest;
2574 const char *yysrc;
2575 # endif
2719 char *yydest;
2720 const char *yysrc;
2721 #endif
25762722 {
25772723 char *yyd = yydest;
25782724 const char *yys = yysrc;
25982744 {
25992745 if (*yystr == '"')
26002746 {
2601 size_t yyn = 0;
2747 YYSIZE_T yyn = 0;
26022748 char const *yyp = yystr;
26032749
26042750 for (;;)
26332779 }
26342780 # endif
26352781
2782 /* Copy into YYRESULT an error message about the unexpected token
2783 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2784 including the terminating null byte. If YYRESULT is null, do not
2785 copy anything; just return the number of bytes that would be
2786 copied. As a special case, return 0 if an ordinary "syntax error"
2787 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2788 size calculation. */
2789 static YYSIZE_T
2790 yysyntax_error (char *yyresult, int yystate, int yychar)
2791 {
2792 int yyn = yypact[yystate];
2793
2794 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2795 return 0;
2796 else
2797 {
2798 int yytype = YYTRANSLATE (yychar);
2799 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2800 YYSIZE_T yysize = yysize0;
2801 YYSIZE_T yysize1;
2802 int yysize_overflow = 0;
2803 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2804 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2805 int yyx;
2806
2807 # if 0
2808 /* This is so xgettext sees the translatable formats that are
2809 constructed on the fly. */
2810 YY_("syntax error, unexpected %s");
2811 YY_("syntax error, unexpected %s, expecting %s");
2812 YY_("syntax error, unexpected %s, expecting %s or %s");
2813 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2814 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2815 # endif
2816 char *yyfmt;
2817 char const *yyf;
2818 static char const yyunexpected[] = "syntax error, unexpected %s";
2819 static char const yyexpecting[] = ", expecting %s";
2820 static char const yyor[] = " or %s";
2821 char yyformat[sizeof yyunexpected
2822 + sizeof yyexpecting - 1
2823 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2824 * (sizeof yyor - 1))];
2825 char const *yyprefix = yyexpecting;
2826
2827 /* Start YYX at -YYN if negative to avoid negative indexes in
2828 YYCHECK. */
2829 int yyxbegin = yyn < 0 ? -yyn : 0;
2830
2831 /* Stay within bounds of both yycheck and yytname. */
2832 int yychecklim = YYLAST - yyn + 1;
2833 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2834 int yycount = 1;
2835
2836 yyarg[0] = yytname[yytype];
2837 yyfmt = yystpcpy (yyformat, yyunexpected);
2838
2839 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2840 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2841 {
2842 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2843 {
2844 yycount = 1;
2845 yysize = yysize0;
2846 yyformat[sizeof yyunexpected - 1] = '\0';
2847 break;
2848 }
2849 yyarg[yycount++] = yytname[yyx];
2850 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2851 yysize_overflow |= (yysize1 < yysize);
2852 yysize = yysize1;
2853 yyfmt = yystpcpy (yyfmt, yyprefix);
2854 yyprefix = yyor;
2855 }
2856
2857 yyf = YY_(yyformat);
2858 yysize1 = yysize + yystrlen (yyf);
2859 yysize_overflow |= (yysize1 < yysize);
2860 yysize = yysize1;
2861
2862 if (yysize_overflow)
2863 return YYSIZE_MAXIMUM;
2864
2865 if (yyresult)
2866 {
2867 /* Avoid sprintf, as that infringes on the user's name space.
2868 Don't have undefined behavior even if the translation
2869 produced a string with the wrong number of "%s"s. */
2870 char *yyp = yyresult;
2871 int yyi = 0;
2872 while ((*yyp = *yyf) != '\0')
2873 {
2874 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2875 {
2876 yyp += yytnamerr (yyp, yyarg[yyi++]);
2877 yyf += 2;
2878 }
2879 else
2880 {
2881 yyp++;
2882 yyf++;
2883 }
2884 }
2885 }
2886 return yysize;
2887 }
2888 }
26362889 #endif /* YYERROR_VERBOSE */
2637
26382890
26392891
2640 #if YYDEBUG
2641 /*--------------------------------.
2642 | Print this symbol on YYOUTPUT. |
2643 `--------------------------------*/
2644
2645 #if defined (__STDC__) || defined (__cplusplus)
2646 static void
2647 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
2648 #else
2649 static void
2650 yysymprint (yyoutput, yytype, yyvaluep)
2651 FILE *yyoutput;
2652 int yytype;
2653 YYSTYPE *yyvaluep;
2654 #endif
2655 {
2656 /* Pacify ``unused variable'' warnings. */
2657 (void) yyvaluep;
2658
2659 if (yytype < YYNTOKENS)
2660 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
2661 else
2662 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
2663
2664
2665 # ifdef YYPRINT
2666 if (yytype < YYNTOKENS)
2667 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
2668 # endif
2669 switch (yytype)
2670 {
2671 default:
2672 break;
2673 }
2674 YYFPRINTF (yyoutput, ")");
2675 }
2676
2677 #endif /* ! YYDEBUG */
26782892 /*-----------------------------------------------.
26792893 | Release the memory associated to this symbol. |
26802894 `-----------------------------------------------*/
26812895
2682 #if defined (__STDC__) || defined (__cplusplus)
2896 /*ARGSUSED*/
2897 #if (defined __STDC__ || defined __C99__FUNC__ \
2898 || defined __cplusplus || defined _MSC_VER)
26832899 static void
26842900 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
26852901 #else
26902906 YYSTYPE *yyvaluep;
26912907 #endif
26922908 {
2693 /* Pacify ``unused variable'' warnings. */
2694 (void) yyvaluep;
2909 YYUSE (yyvaluep);
26952910
26962911 if (!yymsg)
26972912 yymsg = "Deleting";
27012916 {
27022917
27032918 default:
2704 break;
2919 break;
27052920 }
27062921 }
27072922
27092924 /* Prevent warnings from -Wmissing-prototypes. */
27102925
27112926 #ifdef YYPARSE_PARAM
2712 # if defined (__STDC__) || defined (__cplusplus)
2927 #if defined __STDC__ || defined __cplusplus
27132928 int yyparse (void *YYPARSE_PARAM);
2714 # else
2929 #else
27152930 int yyparse ();
2716 # endif
2931 #endif
27172932 #else /* ! YYPARSE_PARAM */
2718 #if defined (__STDC__) || defined (__cplusplus)
2933 #if defined __STDC__ || defined __cplusplus
27192934 int yyparse (void);
27202935 #else
27212936 int yyparse ();
27402955 `----------*/
27412956
27422957 #ifdef YYPARSE_PARAM
2743 # if defined (__STDC__) || defined (__cplusplus)
2744 int yyparse (void *YYPARSE_PARAM)
2745 # else
2746 int yyparse (YYPARSE_PARAM)
2747 void *YYPARSE_PARAM;
2748 # endif
2958 #if (defined __STDC__ || defined __C99__FUNC__ \
2959 || defined __cplusplus || defined _MSC_VER)
2960 int
2961 yyparse (void *YYPARSE_PARAM)
2962 #else
2963 int
2964 yyparse (YYPARSE_PARAM)
2965 void *YYPARSE_PARAM;
2966 #endif
27492967 #else /* ! YYPARSE_PARAM */
2750 #if defined (__STDC__) || defined (__cplusplus)
2968 #if (defined __STDC__ || defined __C99__FUNC__ \
2969 || defined __cplusplus || defined _MSC_VER)
27512970 int
27522971 yyparse (void)
27532972 #else
27652984 int yyerrstatus;
27662985 /* Look-ahead token as an internal (translated) token number. */
27672986 int yytoken = 0;
2987 #if YYERROR_VERBOSE
2988 /* Buffer for error messages, and its allocated size. */
2989 char yymsgbuf[128];
2990 char *yymsg = yymsgbuf;
2991 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2992 #endif
27682993
27692994 /* Three stacks and their tools:
27702995 `yyss': related to states,
27753000 to reallocate them elsewhere. */
27763001
27773002 /* The state stack. */
2778 short int yyssa[YYINITDEPTH];
2779 short int *yyss = yyssa;
2780 short int *yyssp;
3003 yytype_int16 yyssa[YYINITDEPTH];
3004 yytype_int16 *yyss = yyssa;
3005 yytype_int16 *yyssp;
27813006
27823007 /* The semantic value stack. */
27833008 YYSTYPE yyvsa[YYINITDEPTH];
27863011
27873012
27883013
2789 #define YYPOPSTACK (yyvsp--, yyssp--)
3014 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
27903015
27913016 YYSIZE_T yystacksize = YYINITDEPTH;
27923017
27953020 YYSTYPE yyval;
27963021
27973022
2798 /* When reducing, the number of symbols on the RHS of the reduced
2799 rule. */
2800 int yylen;
3023 /* The number of symbols on the RHS of the reduced rule.
3024 Keep to zero when no symbol should be popped. */
3025 int yylen = 0;
28013026
28023027 YYDPRINTF ((stderr, "Starting parse\n"));
28033028
28213046 `------------------------------------------------------------*/
28223047 yynewstate:
28233048 /* In all cases, when you get here, the value and location stacks
2824 have just been pushed. so pushing a state here evens the stacks.
2825 */
3049 have just been pushed. So pushing a state here evens the stacks. */
28263050 yyssp++;
28273051
28283052 yysetstate:
28353059
28363060 #ifdef yyoverflow
28373061 {
2838 /* Give user a chance to reallocate the stack. Use copies of
3062 /* Give user a chance to reallocate the stack. Use copies of
28393063 these so that the &'s don't force the real ones into
28403064 memory. */
28413065 YYSTYPE *yyvs1 = yyvs;
2842 short int *yyss1 = yyss;
3066 yytype_int16 *yyss1 = yyss;
28433067
28443068
28453069 /* Each stack pointer address is followed by the size of the
28673091 yystacksize = YYMAXDEPTH;
28683092
28693093 {
2870 short int *yyss1 = yyss;
3094 yytype_int16 *yyss1 = yyss;
28713095 union yyalloc *yyptr =
28723096 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
28733097 if (! yyptr)
29023126 `-----------*/
29033127 yybackup:
29043128
2905 /* Do appropriate processing given the current state. */
2906 /* Read a look-ahead token if we need one and don't already have one. */
2907 /* yyresume: */
3129 /* Do appropriate processing given the current state. Read a
3130 look-ahead token if we need one and don't already have one. */
29083131
29093132 /* First try to decide what to do without reference to look-ahead token. */
2910
29113133 yyn = yypact[yystate];
29123134 if (yyn == YYPACT_NINF)
29133135 goto yydefault;
29493171 if (yyn == YYFINAL)
29503172 YYACCEPT;
29513173
2952 /* Shift the look-ahead token. */
2953 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2954
2955 /* Discard the token being shifted unless it is eof. */
2956 if (yychar != YYEOF)
2957 yychar = YYEMPTY;
2958
2959 *++yyvsp = yylval;
2960
2961
29623174 /* Count tokens shifted since error; after three, turn off error
29633175 status. */
29643176 if (yyerrstatus)
29653177 yyerrstatus--;
29663178
3179 /* Shift the look-ahead token. */
3180 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
3181
3182 /* Discard the shifted token unless it is eof. */
3183 if (yychar != YYEOF)
3184 yychar = YYEMPTY;
3185
29673186 yystate = yyn;
3187 *++yyvsp = yylval;
3188
29683189 goto yynewstate;
29693190
29703191
30003221 switch (yyn)
30013222 {
30023223 case 3:
3003 #line 991 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3004 {
3005 if ((yyvsp[0].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range!
3224 #line 991 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3225 {
3226 if ((yyvsp[(1) - (1)].UIntVal) > (uint32_t)INT32_MAX) // Outside of my range!
30063227 GEN_ERROR("Value too large for type!");
3007 (yyval.SIntVal) = (int32_t)(yyvsp[0].UIntVal);
3228 (yyval.SIntVal) = (int32_t)(yyvsp[(1) - (1)].UIntVal);
30083229 CHECK_FOR_ERROR
30093230 ;}
30103231 break;
30113232
30123233 case 5:
3013 #line 1000 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3014 {
3015 if ((yyvsp[0].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range!
3234 #line 1000 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3235 {
3236 if ((yyvsp[(1) - (1)].UInt64Val) > (uint64_t)INT64_MAX) // Outside of my range!
30163237 GEN_ERROR("Value too large for type!");
3017 (yyval.SInt64Val) = (int64_t)(yyvsp[0].UInt64Val);
3238 (yyval.SInt64Val) = (int64_t)(yyvsp[(1) - (1)].UInt64Val);
30183239 CHECK_FOR_ERROR
30193240 ;}
30203241 break;
30213242
30223243 case 39:
3023 #line 1017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3244 #line 1017 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30243245 { (yyval.IPredicate) = ICmpInst::ICMP_EQ; ;}
30253246 break;
30263247
30273248 case 40:
3028 #line 1017 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3249 #line 1017 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30293250 { (yyval.IPredicate) = ICmpInst::ICMP_NE; ;}
30303251 break;
30313252
30323253 case 41:
3033 #line 1018 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3254 #line 1018 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30343255 { (yyval.IPredicate) = ICmpInst::ICMP_SLT; ;}
30353256 break;
30363257
30373258 case 42:
3038 #line 1018 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3259 #line 1018 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30393260 { (yyval.IPredicate) = ICmpInst::ICMP_SGT; ;}
30403261 break;
30413262
30423263 case 43:
3043 #line 1019 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3264 #line 1019 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30443265 { (yyval.IPredicate) = ICmpInst::ICMP_SLE; ;}
30453266 break;
30463267
30473268 case 44:
3048 #line 1019 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3269 #line 1019 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30493270 { (yyval.IPredicate) = ICmpInst::ICMP_SGE; ;}
30503271 break;
30513272
30523273 case 45:
3053 #line 1020 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3274 #line 1020 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30543275 { (yyval.IPredicate) = ICmpInst::ICMP_ULT; ;}
30553276 break;
30563277
30573278 case 46:
3058 #line 1020 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3279 #line 1020 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30593280 { (yyval.IPredicate) = ICmpInst::ICMP_UGT; ;}
30603281 break;
30613282
30623283 case 47:
3063 #line 1021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3284 #line 1021 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30643285 { (yyval.IPredicate) = ICmpInst::ICMP_ULE; ;}
30653286 break;
30663287
30673288 case 48:
3068 #line 1021 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3289 #line 1021 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30693290 { (yyval.IPredicate) = ICmpInst::ICMP_UGE; ;}
30703291 break;
30713292
30723293 case 49:
3073 #line 1025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3294 #line 1025 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30743295 { (yyval.FPredicate) = FCmpInst::FCMP_OEQ; ;}
30753296 break;
30763297
30773298 case 50:
3078 #line 1025 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3299 #line 1025 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30793300 { (yyval.FPredicate) = FCmpInst::FCMP_ONE; ;}
30803301 break;
30813302
30823303 case 51:
3083 #line 1026 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3304 #line 1026 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30843305 { (yyval.FPredicate) = FCmpInst::FCMP_OLT; ;}
30853306 break;
30863307
30873308 case 52:
3088 #line 1026 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3309 #line 1026 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30893310 { (yyval.FPredicate) = FCmpInst::FCMP_OGT; ;}
30903311 break;
30913312
30923313 case 53:
3093 #line 1027 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3314 #line 1027 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30943315 { (yyval.FPredicate) = FCmpInst::FCMP_OLE; ;}
30953316 break;
30963317
30973318 case 54:
3098 #line 1027 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3319 #line 1027 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
30993320 { (yyval.FPredicate) = FCmpInst::FCMP_OGE; ;}
31003321 break;
31013322
31023323 case 55:
3103 #line 1028 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3324 #line 1028 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31043325 { (yyval.FPredicate) = FCmpInst::FCMP_ORD; ;}
31053326 break;
31063327
31073328 case 56:
3108 #line 1028 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3329 #line 1028 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31093330 { (yyval.FPredicate) = FCmpInst::FCMP_UNO; ;}
31103331 break;
31113332
31123333 case 57:
3113 #line 1029 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3334 #line 1029 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31143335 { (yyval.FPredicate) = FCmpInst::FCMP_UEQ; ;}
31153336 break;
31163337
31173338 case 58:
3118 #line 1029 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3339 #line 1029 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31193340 { (yyval.FPredicate) = FCmpInst::FCMP_UNE; ;}
31203341 break;
31213342
31223343 case 59:
3123 #line 1030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3344 #line 1030 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31243345 { (yyval.FPredicate) = FCmpInst::FCMP_ULT; ;}
31253346 break;
31263347
31273348 case 60:
3128 #line 1030 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3349 #line 1030 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31293350 { (yyval.FPredicate) = FCmpInst::FCMP_UGT; ;}
31303351 break;
31313352
31323353 case 61:
3133 #line 1031 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3354 #line 1031 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31343355 { (yyval.FPredicate) = FCmpInst::FCMP_ULE; ;}
31353356 break;
31363357
31373358 case 62:
3138 #line 1031 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3359 #line 1031 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31393360 { (yyval.FPredicate) = FCmpInst::FCMP_UGE; ;}
31403361 break;
31413362
31423363 case 63:
3143 #line 1032 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3364 #line 1032 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31443365 { (yyval.FPredicate) = FCmpInst::FCMP_TRUE; ;}
31453366 break;
31463367
31473368 case 64:
3148 #line 1033 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3369 #line 1033 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31493370 { (yyval.FPredicate) = FCmpInst::FCMP_FALSE; ;}
31503371 break;
31513372
31523373 case 77:
3153 #line 1044 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3154 {
3155 (yyval.StrVal) = (yyvsp[-1].StrVal);
3374 #line 1044 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3375 {
3376 (yyval.StrVal) = (yyvsp[(1) - (2)].StrVal);
31563377 CHECK_FOR_ERROR
31573378 ;}
31583379 break;
31593380
31603381 case 78:
3161 #line 1048 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3382 #line 1048 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31623383 {
31633384 (yyval.StrVal) = 0;
31643385 CHECK_FOR_ERROR
31663387 break;
31673388
31683389 case 79:
3169 #line 1053 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3390 #line 1053 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31703391 { (yyval.Linkage) = GlobalValue::InternalLinkage; ;}
31713392 break;
31723393
31733394 case 80:
3174 #line 1054 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3395 #line 1054 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31753396 { (yyval.Linkage) = GlobalValue::LinkOnceLinkage; ;}
31763397 break;
31773398
31783399 case 81:
3179 #line 1055 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3400 #line 1055 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31803401 { (yyval.Linkage) = GlobalValue::WeakLinkage; ;}
31813402 break;
31823403
31833404 case 82:
3184 #line 1056 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3405 #line 1056 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31853406 { (yyval.Linkage) = GlobalValue::AppendingLinkage; ;}
31863407 break;
31873408
31883409 case 83:
3189 #line 1057 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3410 #line 1057 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31903411 { (yyval.Linkage) = GlobalValue::DLLImportLinkage; ;}
31913412 break;
31923413
31933414 case 84:
3194 #line 1058 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3415 #line 1058 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
31953416 { (yyval.Linkage) = GlobalValue::DLLExportLinkage; ;}
31963417 break;
31973418
31983419 case 85:
3199 #line 1059 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3420 #line 1059 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32003421 { (yyval.Linkage) = GlobalValue::ExternalWeakLinkage; ;}
32013422 break;
32023423
32033424 case 86:
3204 #line 1060 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3425 #line 1060 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32053426 { (yyval.Linkage) = GlobalValue::ExternalLinkage; ;}
32063427 break;
32073428
32083429 case 87:
3209 #line 1062 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3430 #line 1062 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32103431 { (yyval.UIntVal) = CallingConv::C; ;}
32113432 break;
32123433
32133434 case 88:
3214 #line 1063 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3435 #line 1063 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32153436 { (yyval.UIntVal) = CallingConv::C; ;}
32163437 break;
32173438
32183439 case 89:
3219 #line 1064 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3440 #line 1064 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32203441 { (yyval.UIntVal) = CallingConv::CSRet; ;}
32213442 break;
32223443
32233444 case 90:
3224 #line 1065 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3445 #line 1065 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32253446 { (yyval.UIntVal) = CallingConv::Fast; ;}
32263447 break;
32273448
32283449 case 91:
3229 #line 1066 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3450 #line 1066 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32303451 { (yyval.UIntVal) = CallingConv::Cold; ;}
32313452 break;
32323453
32333454 case 92:
3234 #line 1067 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3455 #line 1067 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32353456 { (yyval.UIntVal) = CallingConv::X86_StdCall; ;}
32363457 break;
32373458
32383459 case 93:
3239 #line 1068 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3460 #line 1068 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32403461 { (yyval.UIntVal) = CallingConv::X86_FastCall; ;}
32413462 break;
32423463
32433464 case 94:
3244 #line 1069 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3245 {
3246 if ((unsigned)(yyvsp[0].UInt64Val) != (yyvsp[0].UInt64Val))
3465 #line 1069 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3466 {
3467 if ((unsigned)(yyvsp[(2) - (2)].UInt64Val) != (yyvsp[(2) - (2)].UInt64Val))
32473468 GEN_ERROR("Calling conv too large!");
3248 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3469 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
32493470 CHECK_FOR_ERROR
32503471 ;}
32513472 break;
32523473
32533474 case 95:
3254 #line 1078 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3475 #line 1078 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32553476 { (yyval.UIntVal) = 0; ;}
32563477 break;
32573478
32583479 case 96:
3259 #line 1079 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3260 {
3261 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3480 #line 1079 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3481 {
3482 (yyval.UIntVal) = (yyvsp[(2) - (2)].UInt64Val);
32623483 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
32633484 GEN_ERROR("Alignment must be a power of two!");
32643485 CHECK_FOR_ERROR
32663487 break;
32673488
32683489 case 97:
3269 #line 1085 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3490 #line 1085 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32703491 { (yyval.UIntVal) = 0; ;}
32713492 break;
32723493
32733494 case 98:
3274 #line 1086 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3275 {
3276 (yyval.UIntVal) = (yyvsp[0].UInt64Val);
3495 #line 1086 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3496 {
3497 (yyval.UIntVal) = (yyvsp[(3) - (3)].UInt64Val);
32773498 if ((yyval.UIntVal) != 0 && !isPowerOf2_32((yyval.UIntVal)))
32783499 GEN_ERROR("Alignment must be a power of two!");
32793500 CHECK_FOR_ERROR
32813502 break;
32823503
32833504 case 99:
3284 #line 1094 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3285 {
3286 for (unsigned i = 0, e = strlen((yyvsp[0].StrVal)); i != e; ++i)
3287 if ((yyvsp[0].StrVal)[i] == '"' || (yyvsp[0].StrVal)[i] == '\\')
3505 #line 1094 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3506 {
3507 for (unsigned i = 0, e = strlen((yyvsp[(2) - (2)].StrVal)); i != e; ++i)
3508 if ((yyvsp[(2) - (2)].StrVal)[i] == '"' || (yyvsp[(2) - (2)].StrVal)[i] == '\\')
32883509 GEN_ERROR("Invalid character in section name!");
3289 (yyval.StrVal) = (yyvsp[0].StrVal);
3510 (yyval.StrVal) = (yyvsp[(2) - (2)].StrVal);
32903511 CHECK_FOR_ERROR
32913512 ;}
32923513 break;
32933514
32943515 case 100:
3295 #line 1102 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3516 #line 1102 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
32963517 { (yyval.StrVal) = 0; ;}
32973518 break;
32983519
32993520 case 101:
3300 #line 1103 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3301 { (yyval.StrVal) = (yyvsp[0].StrVal); ;}
3521 #line 1103 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3522 { (yyval.StrVal) = (yyvsp[(1) - (1)].StrVal); ;}
33023523 break;
33033524
33043525 case 102:
3305 #line 1108 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3526 #line 1108 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33063527 {;}
33073528 break;
33083529
33093530 case 103:
3310 #line 1109 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3531 #line 1109 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33113532 {;}
33123533 break;
33133534
33143535 case 104:
3315 #line 1110 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3316 {
3317 CurGV->setSection((yyvsp[0].StrVal));
3318 free((yyvsp[0].StrVal));
3536 #line 1110 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3537 {
3538 CurGV->setSection((yyvsp[(1) - (1)].StrVal));
3539 free((yyvsp[(1) - (1)].StrVal));
33193540 CHECK_FOR_ERROR
33203541 ;}
33213542 break;
33223543
33233544 case 105:
3324 #line 1115 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3325 {
3326 if ((yyvsp[0].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[0].UInt64Val)))
3545 #line 1115 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3546 {
3547 if ((yyvsp[(2) - (2)].UInt64Val) != 0 && !isPowerOf2_32((yyvsp[(2) - (2)].UInt64Val)))
33273548 GEN_ERROR("Alignment must be a power of two!");
3328 CurGV->setAlignment((yyvsp[0].UInt64Val));
3549 CurGV->setAlignment((yyvsp[(2) - (2)].UInt64Val));
33293550 CHECK_FOR_ERROR
33303551 ;}
33313552 break;
33323553
33333554 case 107:
3334 #line 1129 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3335 { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
3555 #line 1129 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3556 { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); ;}
33363557 break;
33373558
33383559 case 109:
3339 #line 1130 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3340 { (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType)); ;}
3560 #line 1130 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3561 { (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType)); ;}
33413562 break;
33423563
33433564 case 110:
3344 #line 1132 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3565 #line 1132 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33453566 {
33463567 if (!UpRefs.empty())
3347 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[0].TypeVal))->getDescription());
3348 (yyval.TypeVal) = (yyvsp[0].TypeVal);
3568 GEN_ERROR("Invalid upreference in type: " + (*(yyvsp[(1) - (1)].TypeVal))->getDescription());
3569 (yyval.TypeVal) = (yyvsp[(1) - (1)].TypeVal);
33493570 CHECK_FOR_ERROR
33503571 ;}
33513572 break;
33523573
33533574 case 124:
3354 #line 1144 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3575 #line 1144 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33553576 {
33563577 (yyval.TypeVal) = new PATypeHolder(OpaqueType::get());
33573578 CHECK_FOR_ERROR
33593580 break;
33603581
33613582 case 125:
3362 #line 1148 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3363 {
3364 (yyval.TypeVal) = new PATypeHolder((yyvsp[0].PrimType));
3583 #line 1148 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
3584 {
3585 (yyval.TypeVal) = new PATypeHolder((yyvsp[(1) - (1)].PrimType));
33653586 CHECK_FOR_ERROR
33663587 ;}
33673588 break;
33683589
33693590 case 126:
3370 #line 1152 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3591 #line 1152 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33713592 { // Named types are also simple types...
3372 const Type* tmp = getTypeVal((yyvsp[0].ValIDVal));
3593 const Type* tmp = getTypeVal((yyvsp[(1) - (1)].ValIDVal));
33733594 CHECK_FOR_ERROR
33743595 (yyval.TypeVal) = new PATypeHolder(tmp);
33753596 ;}
33763597 break;
33773598
33783599 case 127:
3379 #line 1160 "/proj/llvm/llvm-1/lib/AsmParser/llvmAsmParser.y"
3600 #line 1160 "/Volumes/Gir/devel/llvm/llvm.src/lib/AsmParser/llvmAsmParser.y"
33803601 { // Type UpReference
3381 if ((yyvsp[0].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
3602 if ((yyvsp[(2) - (2)].UInt64Val) > (uint64_t)~0U) GEN_ERROR("Value out of range!");
33823603 OpaqueType *OT = OpaqueType::get(); // Use temporary placeholder
3383 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[0].UInt64Val), OT)); // Add to vector...
3604 UpRefs.push_back(UpRefRecord((unsigned)(yyvsp[(2) - (2)].UInt64Val), OT)); // Add to vector...
33843605 (yyval.TypeVal) = new PATypeHolder(OT);
33853606 UR_OUT("New Upreference!\n");
33863607 CHECK_FOR_ERROR
33883609 break;
3389<