blob: 6d66839e2fb86420c5e65f054875909c1796a4f8 [file] [log] [blame]
Chris Lattner6b944532002-10-28 01:16:38 +00001//===-- MachineFunction.cpp -----------------------------------------------===//
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +00002//
John Criswellb576c942003-10-20 19:43:21 +00003// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +00007//
John Criswellb576c942003-10-20 19:43:21 +00008//===----------------------------------------------------------------------===//
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +00009//
Chris Lattner6b944532002-10-28 01:16:38 +000010// Collect native machine code information for a function. This allows
11// target-specific information about the generated code to be stored with each
12// function.
13//
14//===----------------------------------------------------------------------===//
Chris Lattnerf2868ce2002-02-03 07:54:50 +000015
Chris Lattner16c45e92003-12-20 10:20:58 +000016#include "llvm/CodeGen/MachineFunctionPass.h"
Chris Lattner831fdcf2002-12-25 05:03:22 +000017#include "llvm/CodeGen/MachineInstr.h"
Chris Lattner831fdcf2002-12-25 05:03:22 +000018#include "llvm/CodeGen/SSARegMap.h"
Chris Lattnereb24db92002-12-28 21:08:26 +000019#include "llvm/CodeGen/MachineFrameInfo.h"
Chris Lattner4d149cd2003-01-13 00:23:03 +000020#include "llvm/CodeGen/MachineConstantPool.h"
Nate Begeman37efe672006-04-22 18:53:45 +000021#include "llvm/CodeGen/MachineJumpTableInfo.h"
Chris Lattner16c45e92003-12-20 10:20:58 +000022#include "llvm/CodeGen/Passes.h"
Chris Lattnerf2868ce2002-02-03 07:54:50 +000023#include "llvm/Target/TargetMachine.h"
Chris Lattner8bd66e62002-12-28 21:00:25 +000024#include "llvm/Target/TargetFrameInfo.h"
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000025#include "llvm/Function.h"
Misha Brukman47b14a42004-07-29 17:30:56 +000026#include "llvm/Instructions.h"
Reid Spencer551ccae2004-09-01 22:55:40 +000027#include "llvm/Support/LeakDetector.h"
28#include "llvm/Support/GraphWriter.h"
Jim Laskey851a22d2005-10-12 12:09:05 +000029#include "llvm/Config/config.h"
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +000030#include <fstream>
Reid Spencer954da372004-07-04 12:19:56 +000031#include <iostream>
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +000032#include <sstream>
Tanya Lattner792699c2004-05-24 06:11:51 +000033
Chris Lattner07f32d42003-12-20 09:17:07 +000034using namespace llvm;
Chris Lattnerf2868ce2002-02-03 07:54:50 +000035
Chris Lattnere316efc2002-10-29 23:18:43 +000036static AnnotationID MF_AID(
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +000037 AnnotationManager::getID("CodeGen::MachineCodeForFunction"));
Chris Lattnerf2868ce2002-02-03 07:54:50 +000038
Chris Lattner227c3d32002-10-28 01:12:41 +000039
Chris Lattner227c3d32002-10-28 01:12:41 +000040namespace {
Chris Lattner16c45e92003-12-20 10:20:58 +000041 struct Printer : public MachineFunctionPass {
Brian Gaeke09caa372004-01-30 21:53:46 +000042 std::ostream *OS;
Chris Lattnerd4baf0f2004-02-01 05:25:07 +000043 const std::string Banner;
Brian Gaeke09caa372004-01-30 21:53:46 +000044
45 Printer (std::ostream *_OS, const std::string &_Banner) :
46 OS (_OS), Banner (_Banner) { }
47
Chris Lattner10491642002-10-30 00:48:05 +000048 const char *getPassName() const { return "MachineFunction Printer"; }
49
50 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
51 AU.setPreservesAll();
52 }
53
Chris Lattner16c45e92003-12-20 10:20:58 +000054 bool runOnMachineFunction(MachineFunction &MF) {
Brian Gaeke09caa372004-01-30 21:53:46 +000055 (*OS) << Banner;
56 MF.print (*OS);
Chris Lattner10491642002-10-30 00:48:05 +000057 return false;
58 }
59 };
Chris Lattner227c3d32002-10-28 01:12:41 +000060}
61
Brian Gaeke09caa372004-01-30 21:53:46 +000062/// Returns a newly-created MachineFunction Printer pass. The default output
63/// stream is std::cerr; the default banner is empty.
64///
65FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
Chris Lattnerce9c41e2005-01-23 22:13:58 +000066 const std::string &Banner){
Brian Gaeke09caa372004-01-30 21:53:46 +000067 return new Printer(OS, Banner);
Chris Lattner10491642002-10-30 00:48:05 +000068}
69
Alkis Evlogimenosc81efdc2004-02-15 00:03:15 +000070namespace {
71 struct Deleter : public MachineFunctionPass {
72 const char *getPassName() const { return "Machine Code Deleter"; }
73
74 bool runOnMachineFunction(MachineFunction &MF) {
75 // Delete the annotation from the function now.
76 MachineFunction::destruct(MF.getFunction());
77 return true;
78 }
79 };
80}
81
82/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
83/// the current function, which should happen after the function has been
84/// emitted to a .s file or to memory.
85FunctionPass *llvm::createMachineCodeDeleter() {
86 return new Deleter();
87}
88
89
90
Chris Lattner227c3d32002-10-28 01:12:41 +000091//===---------------------------------------------------------------------===//
92// MachineFunction implementation
93//===---------------------------------------------------------------------===//
Chris Lattner9d5d7592005-01-29 18:41:25 +000094
Chris Lattnerbca81442005-01-30 00:09:23 +000095MachineBasicBlock* ilist_traits<MachineBasicBlock>::createSentinel() {
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +000096 MachineBasicBlock* dummy = new MachineBasicBlock();
97 LeakDetector::removeGarbageObject(dummy);
98 return dummy;
Tanya Lattner792699c2004-05-24 06:11:51 +000099}
100
101void ilist_traits<MachineBasicBlock>::transferNodesFromList(
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000102 iplist<MachineBasicBlock, ilist_traits<MachineBasicBlock> >& toList,
103 ilist_iterator<MachineBasicBlock> first,
Chris Lattner9d5d7592005-01-29 18:41:25 +0000104 ilist_iterator<MachineBasicBlock> last) {
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000105 if (Parent != toList.Parent)
106 for (; first != last; ++first)
107 first->Parent = toList.Parent;
Tanya Lattner792699c2004-05-24 06:11:51 +0000108}
Chris Lattner227c3d32002-10-28 01:12:41 +0000109
Chris Lattner10491642002-10-30 00:48:05 +0000110MachineFunction::MachineFunction(const Function *F,
Chris Lattner955fad12002-12-28 20:37:16 +0000111 const TargetMachine &TM)
Jim Laskeyf99c2322006-01-04 13:43:56 +0000112 : Annotation(MF_AID), Fn(F), Target(TM), UsedPhysRegs(0) {
Misha Brukmanb7825bc2002-11-20 18:55:27 +0000113 SSARegMapping = new SSARegMap();
Chris Lattnerad828162004-08-16 22:36:34 +0000114 MFInfo = 0;
Chris Lattnereb24db92002-12-28 21:08:26 +0000115 FrameInfo = new MachineFrameInfo();
Chris Lattner3029f922006-02-09 04:46:04 +0000116 ConstantPool = new MachineConstantPool(TM.getTargetData());
Nate Begeman37efe672006-04-22 18:53:45 +0000117 JumpTableInfo = new MachineJumpTableInfo(TM.getTargetData());
Tanya Lattner17fb34b2004-05-24 07:14:35 +0000118 BasicBlocks.Parent = this;
Chris Lattner831fdcf2002-12-25 05:03:22 +0000119}
120
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000121MachineFunction::~MachineFunction() {
Chris Lattner4b9a4002004-07-01 06:29:07 +0000122 BasicBlocks.clear();
Chris Lattner831fdcf2002-12-25 05:03:22 +0000123 delete SSARegMapping;
Chris Lattner955fad12002-12-28 20:37:16 +0000124 delete MFInfo;
125 delete FrameInfo;
Chris Lattner4d149cd2003-01-13 00:23:03 +0000126 delete ConstantPool;
Nate Begeman37efe672006-04-22 18:53:45 +0000127 delete JumpTableInfo;
Chris Lattnerce9c41e2005-01-23 22:13:58 +0000128 delete[] UsedPhysRegs;
Chris Lattner10491642002-10-30 00:48:05 +0000129}
130
131void MachineFunction::dump() const { print(std::cerr); }
132
133void MachineFunction::print(std::ostream &OS) const {
Brian Gaeke47b71642004-03-29 21:58:31 +0000134 OS << "# Machine code for " << Fn->getName () << "():\n";
Chris Lattner955fad12002-12-28 20:37:16 +0000135
136 // Print Frame Information
Chris Lattner9085d8a2003-01-16 18:35:57 +0000137 getFrameInfo()->print(*this, OS);
Nate Begeman37efe672006-04-22 18:53:45 +0000138
139 // Print JumpTable Information
140 getJumpTableInfo()->print(OS);
Chris Lattner4d149cd2003-01-13 00:23:03 +0000141
142 // Print Constant Pool
143 getConstantPool()->print(OS);
Chris Lattnera1f68ca2005-08-31 22:34:59 +0000144
145 const MRegisterInfo *MRI = getTarget().getRegisterInfo();
146
147 if (livein_begin() != livein_end()) {
148 OS << "Live Ins:";
149 for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I) {
150 if (MRI)
151 OS << " " << MRI->getName(I->first);
152 else
153 OS << " Reg #" << I->first;
154 }
155 OS << "\n";
156 }
157 if (liveout_begin() != liveout_end()) {
158 OS << "Live Outs:";
159 for (liveout_iterator I = liveout_begin(), E = liveout_end(); I != E; ++I)
160 if (MRI)
161 OS << " " << MRI->getName(*I);
162 else
163 OS << " Reg #" << *I;
164 OS << "\n";
165 }
166
Brian Gaeke90421cd2004-02-13 04:39:55 +0000167 for (const_iterator BB = begin(); BB != end(); ++BB)
168 BB->print(OS);
Brian Gaeke47b71642004-03-29 21:58:31 +0000169
170 OS << "\n# End machine code for " << Fn->getName () << "().\n\n";
Chris Lattner10491642002-10-30 00:48:05 +0000171}
172
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000173/// CFGOnly flag - This is used to control whether or not the CFG graph printer
174/// prints out the contents of basic blocks or not. This is acceptable because
175/// this code is only really used for debugging purposes.
176///
177static bool CFGOnly = false;
178
179namespace llvm {
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000180 template<>
181 struct DOTGraphTraits<const MachineFunction*> : public DefaultDOTGraphTraits {
182 static std::string getGraphName(const MachineFunction *F) {
183 return "CFG for '" + F->getFunction()->getName() + "' function";
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000184 }
185
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000186 static std::string getNodeLabel(const MachineBasicBlock *Node,
187 const MachineFunction *Graph) {
188 if (CFGOnly && Node->getBasicBlock() &&
189 !Node->getBasicBlock()->getName().empty())
190 return Node->getBasicBlock()->getName() + ":";
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000191
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000192 std::ostringstream Out;
193 if (CFGOnly) {
194 Out << Node->getNumber() << ':';
195 return Out.str();
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000196 }
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000197
198 Node->print(Out);
199
200 std::string OutStr = Out.str();
201 if (OutStr[0] == '\n') OutStr.erase(OutStr.begin());
202
203 // Process string output to make it nicer...
204 for (unsigned i = 0; i != OutStr.length(); ++i)
205 if (OutStr[i] == '\n') { // Left justify
206 OutStr[i] = '\\';
207 OutStr.insert(OutStr.begin()+i+1, 'l');
208 }
209 return OutStr;
210 }
211 };
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000212}
213
214void MachineFunction::viewCFG() const
215{
Jim Laskey851a22d2005-10-12 12:09:05 +0000216#ifndef NDEBUG
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000217 std::string Filename = "/tmp/cfg." + getFunction()->getName() + ".dot";
218 std::cerr << "Writing '" << Filename << "'... ";
219 std::ofstream F(Filename.c_str());
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000220
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000221 if (!F) {
222 std::cerr << " error opening file for writing!\n";
223 return;
224 }
225
226 WriteGraph(F, this);
227 F.close();
228 std::cerr << "\n";
229
Jim Laskey851a22d2005-10-12 12:09:05 +0000230#ifdef HAVE_GRAPHVIZ
231 std::cerr << "Running 'Graphviz' program... " << std::flush;
232 if (system((LLVM_PATH_GRAPHVIZ " " + Filename).c_str())) {
233 std::cerr << "Error viewing graph: 'Graphviz' not in path?\n";
234 } else {
235 system(("rm " + Filename).c_str());
236 return;
237 }
238#endif // HAVE_GRAPHVIZ
239
240#ifdef HAVE_GV
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000241 std::cerr << "Running 'dot' program... " << std::flush;
242 if (system(("dot -Tps -Nfontname=Courier -Gsize=7.5,10 " + Filename
243 + " > /tmp/cfg.tempgraph.ps").c_str())) {
244 std::cerr << "Error running dot: 'dot' not in path?\n";
245 } else {
246 std::cerr << "\n";
247 system("gv /tmp/cfg.tempgraph.ps");
248 }
249 system(("rm " + Filename + " /tmp/cfg.tempgraph.ps").c_str());
Jim Laskey851a22d2005-10-12 12:09:05 +0000250 return;
251#endif // HAVE_GV
252#endif // NDEBUG
253 std::cerr << "MachineFunction::viewCFG is only available in debug builds on "
254 << "systems with Graphviz or gv!\n";
255
256#ifndef NDEBUG
257 system(("rm " + Filename).c_str());
258#endif
Alkis Evlogimenos71bf4042004-07-08 00:47:58 +0000259}
260
261void MachineFunction::viewCFGOnly() const
262{
263 CFGOnly = true;
264 viewCFG();
265 CFGOnly = false;
266}
267
Chris Lattnerf2868ce2002-02-03 07:54:50 +0000268// The next two methods are used to construct and to retrieve
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000269// the MachineCodeForFunction object for the given function.
270// construct() -- Allocates and initializes for a given function and target
Chris Lattnerf2868ce2002-02-03 07:54:50 +0000271// get() -- Returns a handle to the object.
272// This should not be called before "construct()"
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000273// for a given Function.
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000274//
Misha Brukmanfce11432002-10-28 00:28:31 +0000275MachineFunction&
Chris Lattner335d5c32002-10-28 05:58:46 +0000276MachineFunction::construct(const Function *Fn, const TargetMachine &Tar)
Vikram S. Adve89e2da02002-03-18 03:36:30 +0000277{
Chris Lattnere316efc2002-10-29 23:18:43 +0000278 assert(Fn->getAnnotation(MF_AID) == 0 &&
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000279 "Object already exists for this function!");
Chris Lattner335d5c32002-10-28 05:58:46 +0000280 MachineFunction* mcInfo = new MachineFunction(Fn, Tar);
281 Fn->addAnnotation(mcInfo);
Chris Lattnerf2868ce2002-02-03 07:54:50 +0000282 return *mcInfo;
283}
284
Chris Lattner16c45e92003-12-20 10:20:58 +0000285void MachineFunction::destruct(const Function *Fn) {
Chris Lattnere316efc2002-10-29 23:18:43 +0000286 bool Deleted = Fn->deleteAnnotation(MF_AID);
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000287 assert(Deleted && "Machine code did not exist for function!");
Chris Lattnerf2868ce2002-02-03 07:54:50 +0000288}
289
Chris Lattner335d5c32002-10-28 05:58:46 +0000290MachineFunction& MachineFunction::get(const Function *F)
Vikram S. Adve89e2da02002-03-18 03:36:30 +0000291{
Chris Lattnere316efc2002-10-29 23:18:43 +0000292 MachineFunction *mc = (MachineFunction*)F->getAnnotation(MF_AID);
Chris Lattnerf2868ce2002-02-03 07:54:50 +0000293 assert(mc && "Call construct() method first to allocate the object");
294 return *mc;
295}
296
Chris Lattner831fdcf2002-12-25 05:03:22 +0000297void MachineFunction::clearSSARegMap() {
298 delete SSARegMapping;
299 SSARegMapping = 0;
300}
301
Chris Lattner955fad12002-12-28 20:37:16 +0000302//===----------------------------------------------------------------------===//
Chris Lattnereb24db92002-12-28 21:08:26 +0000303// MachineFrameInfo implementation
Chris Lattner955fad12002-12-28 20:37:16 +0000304//===----------------------------------------------------------------------===//
305
Chris Lattner9085d8a2003-01-16 18:35:57 +0000306void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
Chris Lattner62d6ad22004-06-02 05:56:52 +0000307 int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea();
Chris Lattner9085d8a2003-01-16 18:35:57 +0000308
Chris Lattner955fad12002-12-28 20:37:16 +0000309 for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
310 const StackObject &SO = Objects[i];
Chris Lattner0db07092005-05-13 22:54:44 +0000311 OS << " <fi #" << (int)(i-NumFixedObjects) << ">: ";
Chris Lattner955fad12002-12-28 20:37:16 +0000312 if (SO.Size == 0)
313 OS << "variable sized";
314 else
Chris Lattner0db07092005-05-13 22:54:44 +0000315 OS << "size is " << SO.Size << " byte" << (SO.Size != 1 ? "s," : ",");
316 OS << " alignment is " << SO.Alignment << " byte"
317 << (SO.Alignment != 1 ? "s," : ",");
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000318
Chris Lattner955fad12002-12-28 20:37:16 +0000319 if (i < NumFixedObjects)
320 OS << " fixed";
321 if (i < NumFixedObjects || SO.SPOffset != -1) {
Chris Lattner7f7bbc22004-06-11 06:37:11 +0000322 int Off = SO.SPOffset - ValOffset;
Chris Lattner955fad12002-12-28 20:37:16 +0000323 OS << " at location [SP";
Chris Lattner9085d8a2003-01-16 18:35:57 +0000324 if (Off > 0)
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000325 OS << "+" << Off;
Chris Lattner9085d8a2003-01-16 18:35:57 +0000326 else if (Off < 0)
Alkis Evlogimenos76d9dac2004-09-05 18:41:35 +0000327 OS << Off;
Chris Lattner955fad12002-12-28 20:37:16 +0000328 OS << "]";
329 }
330 OS << "\n";
331 }
332
333 if (HasVarSizedObjects)
334 OS << " Stack frame contains variable sized objects\n";
335}
336
Chris Lattner9085d8a2003-01-16 18:35:57 +0000337void MachineFrameInfo::dump(const MachineFunction &MF) const {
338 print(MF, std::cerr);
339}
Chris Lattner955fad12002-12-28 20:37:16 +0000340
341
342//===----------------------------------------------------------------------===//
Nate Begeman37efe672006-04-22 18:53:45 +0000343// MachineJumpTableInfo implementation
344//===----------------------------------------------------------------------===//
345
346/// getJumpTableIndex - Create a new jump table entry in the jump table info
347/// or return an existing one.
348///
349unsigned MachineJumpTableInfo::getJumpTableIndex(
350 std::vector<MachineBasicBlock*> &DestBBs) {
351 for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
352 if (JumpTables[i].MBBs == DestBBs)
353 return i;
354
355 JumpTables.push_back(MachineJumpTableEntry(DestBBs));
356 return JumpTables.size()-1;
357}
358
359
360void MachineJumpTableInfo::print(std::ostream &OS) const {
361 // FIXME: this is lame, maybe we could print out the MBB numbers or something
362 // like {1, 2, 4, 5, 3, 0}
363 for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
364 OS << " <jt #" << i << "> has " << JumpTables[i].MBBs.size()
365 << " entries\n";
366 }
367}
368
Nate Begeman3700a4d2006-04-22 23:52:35 +0000369unsigned MachineJumpTableInfo::getEntrySize() const {
370 return TD.getPointerSize();
371}
372
373unsigned MachineJumpTableInfo::getAlignment() const {
374 return TD.getPointerAlignment();
375}
376
Nate Begeman37efe672006-04-22 18:53:45 +0000377void MachineJumpTableInfo::dump() const { print(std::cerr); }
378
379
380//===----------------------------------------------------------------------===//
Chris Lattner4d149cd2003-01-13 00:23:03 +0000381// MachineConstantPool implementation
382//===----------------------------------------------------------------------===//
383
Chris Lattner3029f922006-02-09 04:46:04 +0000384/// getConstantPoolIndex - Create a new entry in the constant pool or return
385/// an existing one. User must specify an alignment in bytes for the object.
386///
387unsigned MachineConstantPool::getConstantPoolIndex(Constant *C,
388 unsigned Alignment) {
389 assert(Alignment && "Alignment must be specified!");
390 if (Alignment > PoolAlignment) PoolAlignment = Alignment;
391
392 // Check to see if we already have this constant.
393 //
394 // FIXME, this could be made much more efficient for large constant pools.
395 unsigned AlignMask = (1 << Alignment)-1;
396 for (unsigned i = 0, e = Constants.size(); i != e; ++i)
397 if (Constants[i].Val == C && (Constants[i].Offset & AlignMask) == 0)
398 return i;
399
400 unsigned Offset = 0;
401 if (!Constants.empty()) {
402 Offset = Constants.back().Offset;
403 Offset += TD.getTypeSize(Constants.back().Val->getType());
404 Offset = (Offset+AlignMask)&~AlignMask;
405 }
406
407 Constants.push_back(MachineConstantPoolEntry(C, Offset));
408 return Constants.size()-1;
409}
410
411
Chris Lattner4d149cd2003-01-13 00:23:03 +0000412void MachineConstantPool::print(std::ostream &OS) const {
Evan Chengb8973bd2006-01-31 22:23:14 +0000413 for (unsigned i = 0, e = Constants.size(); i != e; ++i) {
Chris Lattnerfa77d432006-02-09 04:22:52 +0000414 OS << " <cp #" << i << "> is" << *(Value*)Constants[i].Val;
Chris Lattner3029f922006-02-09 04:46:04 +0000415 OS << " , offset=" << Constants[i].Offset;
Evan Chengb8973bd2006-01-31 22:23:14 +0000416 OS << "\n";
417 }
Chris Lattner4d149cd2003-01-13 00:23:03 +0000418}
419
420void MachineConstantPool::dump() const { print(std::cerr); }