blob: c5cac1d7fef36a92e0fee780ac6e5487484434ee [file] [log] [blame]
Chris Lattnerc7bc3bb2003-10-13 05:34:24 +00001//===- PassManagerT.h - Container for Passes --------------------*- C++ -*-===//
John Criswell29265fe2003-10-21 15:17:13 +00002//
3// 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.
7//
8//===----------------------------------------------------------------------===//
Chris Lattner67d25652002-01-30 23:20:39 +00009//
Chris Lattnerd0e9bd12002-04-28 20:42:50 +000010// This file defines the PassManagerT class. This class is used to hold,
Chris Lattner67d25652002-01-30 23:20:39 +000011// maintain, and optimize execution of Pass's. The PassManager class ensures
12// that analysis results are available before a pass runs, and that Pass's are
13// destroyed when the PassManager is destroyed.
14//
Chris Lattnerd0e9bd12002-04-28 20:42:50 +000015// The PassManagerT template is instantiated three times to do its job. The
16// public PassManager class is a Pimpl around the PassManagerT<Module> interface
17// to avoid having all of the PassManager clients being exposed to the
18// implementation details herein.
Chris Lattner67d25652002-01-30 23:20:39 +000019//
20//===----------------------------------------------------------------------===//
21
Chris Lattnerd0e9bd12002-04-28 20:42:50 +000022#ifndef LLVM_PASSMANAGER_T_H
23#define LLVM_PASSMANAGER_T_H
Chris Lattner67d25652002-01-30 23:20:39 +000024
25#include "llvm/Pass.h"
Chris Lattner198cf422002-07-30 16:27:02 +000026#include "Support/CommandLine.h"
Chris Lattnered6504b2002-09-08 19:00:07 +000027#include "Support/LeakDetector.h"
Chris Lattneraf751b82002-10-01 19:54:07 +000028#include "Support/Timer.h"
Chris Lattnerc8e66542002-04-27 06:56:12 +000029#include <algorithm>
Chris Lattner395c27a2002-07-31 18:04:17 +000030#include <iostream>
Brian Gaeke960707c2003-11-11 22:41:34 +000031
32namespace llvm {
33
Chris Lattnera454b5b2002-04-28 05:14:06 +000034class Annotable;
Chris Lattner67d25652002-01-30 23:20:39 +000035
Chris Lattner67d25652002-01-30 23:20:39 +000036//===----------------------------------------------------------------------===//
Chris Lattner198cf422002-07-30 16:27:02 +000037// Pass debugging information. Often it is useful to find out what pass is
38// running when a crash occurs in a utility. When this library is compiled with
39// debugging on, a command line option (--debug-pass) is enabled that causes the
40// pass name to be printed before it executes.
41//
42
43// Different debug levels that can be enabled...
44enum PassDebugLevel {
Chris Lattner1e4867f2002-07-30 19:51:02 +000045 None, Arguments, Structure, Executions, Details
Chris Lattner198cf422002-07-30 16:27:02 +000046};
47
48static cl::opt<enum PassDebugLevel>
49PassDebugging("debug-pass", cl::Hidden,
50 cl::desc("Print PassManager debugging information"),
51 cl::values(
52 clEnumVal(None , "disable debug output"),
Chris Lattner1e4867f2002-07-30 19:51:02 +000053 clEnumVal(Arguments , "print pass arguments to pass to 'opt'"),
Chris Lattner198cf422002-07-30 16:27:02 +000054 clEnumVal(Structure , "print pass structure before run()"),
55 clEnumVal(Executions, "print pass name before it is executed"),
56 clEnumVal(Details , "print pass details when it is executed"),
57 0));
58
59//===----------------------------------------------------------------------===//
Chris Lattner57d2ba32002-04-04 19:35:24 +000060// PMDebug class - a set of debugging functions, that are not to be
61// instantiated by the template.
Chris Lattner67d25652002-01-30 23:20:39 +000062//
63struct PMDebug {
Chris Lattner1e4867f2002-07-30 19:51:02 +000064 static void PerformPassStartupStuff(Pass *P) {
65 // If debugging is enabled, print out argument information...
66 if (PassDebugging >= Arguments) {
67 std::cerr << "Pass Arguments: ";
68 PrintArgumentInformation(P);
69 std::cerr << "\n";
70
71 // Print the pass execution structure
72 if (PassDebugging >= Structure)
73 P->dumpPassStructure();
74 }
Chris Lattner198cf422002-07-30 16:27:02 +000075 }
Chris Lattner1e4867f2002-07-30 19:51:02 +000076
77 static void PrintArgumentInformation(const Pass *P);
Chris Lattnera454b5b2002-04-28 05:14:06 +000078 static void PrintPassInformation(unsigned,const char*,Pass *, Annotable *);
Chris Lattnerac3e0602002-01-31 18:32:27 +000079 static void PrintAnalysisSetInfo(unsigned,const char*,Pass *P,
Chris Lattnerc8e66542002-04-27 06:56:12 +000080 const std::vector<AnalysisID> &);
Chris Lattner67d25652002-01-30 23:20:39 +000081};
82
83
Chris Lattnere2eb99e2002-04-29 04:04:29 +000084//===----------------------------------------------------------------------===//
85// TimingInfo Class - This class is used to calculate information about the
86// amount of time each pass takes to execute. This only happens when
87// -time-passes is enabled on the command line.
88//
Chris Lattner6a33d6f2002-08-01 19:33:09 +000089
Chris Lattnere2eb99e2002-04-29 04:04:29 +000090class TimingInfo {
Chris Lattneraf751b82002-10-01 19:54:07 +000091 std::map<Pass*, Timer> TimingData;
92 TimerGroup TG;
93
94 // Private ctor, must use 'create' member
95 TimingInfo() : TG("... Pass execution timing report ...") {}
Chris Lattnere2eb99e2002-04-29 04:04:29 +000096public:
Chris Lattnere2eb99e2002-04-29 04:04:29 +000097 // TimingDtor - Print out information about timing information
Chris Lattneraf751b82002-10-01 19:54:07 +000098 ~TimingInfo() {
99 // Delete all of the timers...
100 TimingData.clear();
101 // TimerGroup is deleted next, printing the report.
102 }
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000103
Chris Lattnere7e09442003-08-14 05:20:28 +0000104 // createTheTimeInfo - This method either initializes the TheTimeInfo pointer
105 // to a non null value (if the -time-passes option is enabled) or it leaves it
106 // null. It may be called multiple times.
107 static void createTheTimeInfo();
108
Chris Lattneraf751b82002-10-01 19:54:07 +0000109 void passStarted(Pass *P) {
Chris Lattnerd5fc9022002-10-01 20:08:11 +0000110 if (dynamic_cast<AnalysisResolver*>(P)) return;
Chris Lattneraf751b82002-10-01 19:54:07 +0000111 std::map<Pass*, Timer>::iterator I = TimingData.find(P);
112 if (I == TimingData.end())
Chris Lattner52db2712002-10-01 20:12:06 +0000113 I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first;
Chris Lattneraf751b82002-10-01 19:54:07 +0000114 I->second.startTimer();
115 }
116 void passEnded(Pass *P) {
Chris Lattnerd5fc9022002-10-01 20:08:11 +0000117 if (dynamic_cast<AnalysisResolver*>(P)) return;
Chris Lattneraf751b82002-10-01 19:54:07 +0000118 std::map<Pass*, Timer>::iterator I = TimingData.find(P);
119 assert (I != TimingData.end() && "passStarted/passEnded not nested right!");
120 I->second.stopTimer();
121 }
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000122};
123
Chris Lattnere7e09442003-08-14 05:20:28 +0000124static TimingInfo *TheTimeInfo;
125
Chris Lattner6e041bd2002-08-21 22:17:09 +0000126//===----------------------------------------------------------------------===//
Chris Lattner67d25652002-01-30 23:20:39 +0000127// Declare the PassManagerTraits which will be specialized...
128//
129template<class UnitType> class PassManagerTraits; // Do not define.
130
131
132//===----------------------------------------------------------------------===//
133// PassManagerT - Container object for passes. The PassManagerT destructor
134// deletes all passes contained inside of the PassManagerT, so you shouldn't
135// delete passes manually, and all passes should be dynamically allocated.
136//
137template<typename UnitType>
138class PassManagerT : public PassManagerTraits<UnitType>,public AnalysisResolver{
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000139 typedef PassManagerTraits<UnitType> Traits;
140 typedef typename Traits::PassClass PassClass;
141 typedef typename Traits::SubPassClass SubPassClass;
142 typedef typename Traits::BatcherClass BatcherClass;
143 typedef typename Traits::ParentClass ParentClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000144
Chris Lattner4c9cd822003-06-23 19:16:20 +0000145 friend class PassManagerTraits<UnitType>::PassClass;
146 friend class PassManagerTraits<UnitType>::SubPassClass;
Chris Lattner41baa982003-11-05 05:15:42 +0000147 friend class PassManagerTraits<UnitType>;
Chris Lattneree0788d2002-09-25 21:59:11 +0000148 friend class ImmutablePass;
Chris Lattner67d25652002-01-30 23:20:39 +0000149
Chris Lattner73503172002-07-29 21:03:38 +0000150 std::vector<PassClass*> Passes; // List of passes to run
Chris Lattneree0788d2002-09-25 21:59:11 +0000151 std::vector<ImmutablePass*> ImmutablePasses; // List of immutable passes
Chris Lattner67d25652002-01-30 23:20:39 +0000152
153 // The parent of this pass manager...
Chris Lattnerac3e0602002-01-31 18:32:27 +0000154 ParentClass * const Parent;
Chris Lattner67d25652002-01-30 23:20:39 +0000155
156 // The current batcher if one is in use, or null
157 BatcherClass *Batcher;
158
159 // CurrentAnalyses - As the passes are being run, this map contains the
160 // analyses that are available to the current pass for use. This is accessed
161 // through the getAnalysis() function in this class and in Pass.
162 //
163 std::map<AnalysisID, Pass*> CurrentAnalyses;
164
Chris Lattnerac3e0602002-01-31 18:32:27 +0000165 // LastUseOf - This map keeps track of the last usage in our pipeline of a
166 // particular pass. When executing passes, the memory for .first is free'd
167 // after .second is run.
168 //
169 std::map<Pass*, Pass*> LastUseOf;
170
Chris Lattner67d25652002-01-30 23:20:39 +0000171public:
172 PassManagerT(ParentClass *Par = 0) : Parent(Par), Batcher(0) {}
173 ~PassManagerT() {
174 // Delete all of the contained passes...
Chris Lattnera82ee2d2002-07-24 22:08:53 +0000175 for (typename std::vector<PassClass*>::iterator
176 I = Passes.begin(), E = Passes.end(); I != E; ++I)
Chris Lattner67d25652002-01-30 23:20:39 +0000177 delete *I;
Chris Lattneree0788d2002-09-25 21:59:11 +0000178
179 for (std::vector<ImmutablePass*>::iterator
180 I = ImmutablePasses.begin(), E = ImmutablePasses.end(); I != E; ++I)
181 delete *I;
Chris Lattner67d25652002-01-30 23:20:39 +0000182 }
183
184 // run - Run all of the queued passes on the specified module in an optimal
185 // way.
186 virtual bool runOnUnit(UnitType *M) {
187 bool MadeChanges = false;
188 closeBatcher();
189 CurrentAnalyses.clear();
190
Chris Lattnere7e09442003-08-14 05:20:28 +0000191 TimingInfo::createTheTimeInfo();
192
Chris Lattneree0788d2002-09-25 21:59:11 +0000193 // Add any immutable passes to the CurrentAnalyses set...
Chris Lattner480b37d2002-09-25 22:26:52 +0000194 for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) {
195 ImmutablePass *IPass = ImmutablePasses[i];
196 if (const PassInfo *PI = IPass->getPassInfo()) {
197 CurrentAnalyses[PI] = IPass;
Chris Lattneree0788d2002-09-25 21:59:11 +0000198
199 const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
200 for (unsigned i = 0, e = II.size(); i != e; ++i)
Chris Lattner480b37d2002-09-25 22:26:52 +0000201 CurrentAnalyses[II[i]] = IPass;
Chris Lattneree0788d2002-09-25 21:59:11 +0000202 }
Chris Lattner480b37d2002-09-25 22:26:52 +0000203 }
Chris Lattneree0788d2002-09-25 21:59:11 +0000204
Chris Lattnerac3e0602002-01-31 18:32:27 +0000205 // LastUserOf - This contains the inverted LastUseOfMap...
206 std::map<Pass *, std::vector<Pass*> > LastUserOf;
207 for (std::map<Pass*, Pass*>::iterator I = LastUseOf.begin(),
208 E = LastUseOf.end(); I != E; ++I)
209 LastUserOf[I->second].push_back(I->first);
210
211
Chris Lattner67d25652002-01-30 23:20:39 +0000212 // Output debug information...
Chris Lattner1e4867f2002-07-30 19:51:02 +0000213 if (Parent == 0) PMDebug::PerformPassStartupStuff(this);
Chris Lattner67d25652002-01-30 23:20:39 +0000214
215 // Run all of the passes
216 for (unsigned i = 0, e = Passes.size(); i < e; ++i) {
217 PassClass *P = Passes[i];
218
Chris Lattnera454b5b2002-04-28 05:14:06 +0000219 PMDebug::PrintPassInformation(getDepth(), "Executing Pass", P,
220 (Annotable*)M);
Chris Lattner67d25652002-01-30 23:20:39 +0000221
222 // Get information about what analyses the pass uses...
Chris Lattnerc8e66542002-04-27 06:56:12 +0000223 AnalysisUsage AnUsage;
224 P->getAnalysisUsage(AnUsage);
225 PMDebug::PrintAnalysisSetInfo(getDepth(), "Required", P,
226 AnUsage.getRequiredSet());
Chris Lattner67d25652002-01-30 23:20:39 +0000227
Chris Lattner216edd42002-08-30 20:25:01 +0000228 // All Required analyses should be available to the pass as it runs! Here
229 // we fill in the AnalysisImpls member of the pass so that it can
230 // successfully use the getAnalysis() method to retrieve the
231 // implementations it needs.
232 //
233 P->AnalysisImpls.clear();
234 P->AnalysisImpls.reserve(AnUsage.getRequiredSet().size());
235 for (std::vector<const PassInfo *>::const_iterator
Chris Lattnerc8e66542002-04-27 06:56:12 +0000236 I = AnUsage.getRequiredSet().begin(),
237 E = AnUsage.getRequiredSet().end(); I != E; ++I) {
Chris Lattner216edd42002-08-30 20:25:01 +0000238 Pass *Impl = getAnalysisOrNullUp(*I);
239 if (Impl == 0) {
240 std::cerr << "Analysis '" << (*I)->getPassName()
241 << "' used but not available!";
242 assert(0 && "Analysis used but not available!");
243 } else if (PassDebugging == Details) {
244 if ((*I)->getPassName() != std::string(Impl->getPassName()))
245 std::cerr << " Interface '" << (*I)->getPassName()
246 << "' implemented by '" << Impl->getPassName() << "'\n";
247 }
248 P->AnalysisImpls.push_back(std::make_pair(*I, Impl));
Chris Lattner67d25652002-01-30 23:20:39 +0000249 }
Chris Lattner67d25652002-01-30 23:20:39 +0000250
251 // Run the sub pass!
Chris Lattnere7e09442003-08-14 05:20:28 +0000252 if (TheTimeInfo) TheTimeInfo->passStarted(P);
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000253 bool Changed = runPass(P, M);
Chris Lattnere7e09442003-08-14 05:20:28 +0000254 if (TheTimeInfo) TheTimeInfo->passEnded(P);
Chris Lattnerf2f31bd2002-02-01 04:53:36 +0000255 MadeChanges |= Changed;
Chris Lattner67d25652002-01-30 23:20:39 +0000256
Chris Lattnered6504b2002-09-08 19:00:07 +0000257 // Check for memory leaks by the pass...
258 LeakDetector::checkForGarbage(std::string("after running pass '") +
259 P->getPassName() + "'");
260
Chris Lattnerf2f31bd2002-02-01 04:53:36 +0000261 if (Changed)
262 PMDebug::PrintPassInformation(getDepth()+1, "Made Modification", P,
Chris Lattnera454b5b2002-04-28 05:14:06 +0000263 (Annotable*)M);
Chris Lattnerc8e66542002-04-27 06:56:12 +0000264 PMDebug::PrintAnalysisSetInfo(getDepth(), "Preserved", P,
265 AnUsage.getPreservedSet());
Chris Lattner67d25652002-01-30 23:20:39 +0000266
Chris Lattnerc8e66542002-04-27 06:56:12 +0000267
268 // Erase all analyses not in the preserved set...
Chris Lattner820d9712002-10-21 20:00:28 +0000269 if (!AnUsage.getPreservesAll()) {
Chris Lattnerc8e66542002-04-27 06:56:12 +0000270 const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
271 for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(),
272 E = CurrentAnalyses.end(); I != E; )
273 if (std::find(PreservedSet.begin(), PreservedSet.end(), I->first) !=
274 PreservedSet.end())
275 ++I; // This analysis is preserved, leave it in the available set...
276 else {
Chris Lattneree0788d2002-09-25 21:59:11 +0000277 if (!dynamic_cast<ImmutablePass*>(I->second)) {
Chris Lattnerade85ec2003-02-14 05:34:36 +0000278 std::map<AnalysisID, Pass*>::iterator J = I++;
279 CurrentAnalyses.erase(J); // Analysis not preserved!
Chris Lattneree0788d2002-09-25 21:59:11 +0000280 } else {
281 ++I;
282 }
Chris Lattnerc8e66542002-04-27 06:56:12 +0000283 }
284 }
285
Chris Lattner73503172002-07-29 21:03:38 +0000286 // Add the current pass to the set of passes that have been run, and are
287 // thus available to users.
288 //
Chris Lattner216edd42002-08-30 20:25:01 +0000289 if (const PassInfo *PI = P->getPassInfo()) {
Chris Lattner73503172002-07-29 21:03:38 +0000290 CurrentAnalyses[PI] = P;
Chris Lattnerac3e0602002-01-31 18:32:27 +0000291
Chris Lattner216edd42002-08-30 20:25:01 +0000292 // This pass is the current implementation of all of the interfaces it
293 // implements as well.
294 //
295 const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
296 for (unsigned i = 0, e = II.size(); i != e; ++i)
297 CurrentAnalyses[II[i]] = P;
298 }
299
Chris Lattnerac3e0602002-01-31 18:32:27 +0000300 // Free memory for any passes that we are the last use of...
301 std::vector<Pass*> &DeadPass = LastUserOf[P];
302 for (std::vector<Pass*>::iterator I = DeadPass.begin(),E = DeadPass.end();
303 I != E; ++I) {
304 PMDebug::PrintPassInformation(getDepth()+1, "Freeing Pass", *I,
Chris Lattnera454b5b2002-04-28 05:14:06 +0000305 (Annotable*)M);
Chris Lattnerac3e0602002-01-31 18:32:27 +0000306 (*I)->releaseMemory();
307 }
Chris Lattner6b6f5402002-09-29 22:50:22 +0000308
309 // Make sure to remove dead passes from the CurrentAnalyses list...
310 for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin();
311 I != CurrentAnalyses.end(); ) {
312 std::vector<Pass*>::iterator DPI = std::find(DeadPass.begin(),
313 DeadPass.end(), I->second);
314 if (DPI != DeadPass.end()) { // This pass is dead now... remove it
315 std::map<AnalysisID, Pass*>::iterator IDead = I++;
316 CurrentAnalyses.erase(IDead);
317 } else {
318 ++I; // Move on to the next element...
319 }
320 }
Chris Lattner67d25652002-01-30 23:20:39 +0000321 }
Chris Lattnere7e09442003-08-14 05:20:28 +0000322
Chris Lattner67d25652002-01-30 23:20:39 +0000323 return MadeChanges;
324 }
325
Chris Lattnerac3e0602002-01-31 18:32:27 +0000326 // dumpPassStructure - Implement the -debug-passes=PassStructure option
327 virtual void dumpPassStructure(unsigned Offset = 0) {
Chris Lattner480b37d2002-09-25 22:26:52 +0000328 // Print out the immutable passes...
329 for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i)
330 ImmutablePasses[i]->dumpPassStructure(0);
331
Chris Lattnerac3e0602002-01-31 18:32:27 +0000332 std::cerr << std::string(Offset*2, ' ') << Traits::getPMName()
333 << " Pass Manager\n";
Chris Lattnera82ee2d2002-07-24 22:08:53 +0000334 for (typename std::vector<PassClass*>::iterator
335 I = Passes.begin(), E = Passes.end(); I != E; ++I) {
Chris Lattnerac3e0602002-01-31 18:32:27 +0000336 PassClass *P = *I;
337 P->dumpPassStructure(Offset+1);
338
339 // Loop through and see which classes are destroyed after this one...
340 for (std::map<Pass*, Pass*>::iterator I = LastUseOf.begin(),
341 E = LastUseOf.end(); I != E; ++I) {
342 if (P == I->second) {
Chris Lattner73503172002-07-29 21:03:38 +0000343 std::cerr << "--" << std::string(Offset*2, ' ');
Chris Lattnerac3e0602002-01-31 18:32:27 +0000344 I->first->dumpPassStructure(0);
345 }
346 }
347 }
348 }
Chris Lattnerac3e0602002-01-31 18:32:27 +0000349
Chris Lattner60430422003-04-24 20:07:38 +0000350 Pass *getImmutablePassOrNull(const PassInfo *ID) const {
351 for (unsigned i = 0, e = ImmutablePasses.size(); i != e; ++i) {
352 const PassInfo *IPID = ImmutablePasses[i]->getPassInfo();
353 if (IPID == ID)
354 return ImmutablePasses[i];
355
356 // This pass is the current implementation of all of the interfaces it
357 // implements as well.
358 //
359 const std::vector<const PassInfo*> &II =
360 IPID->getInterfacesImplemented();
361 for (unsigned j = 0, e = II.size(); j != e; ++j)
362 if (II[j] == ID) return ImmutablePasses[i];
363 }
364 return 0;
365 }
366
Chris Lattner6e041bd2002-08-21 22:17:09 +0000367 Pass *getAnalysisOrNullDown(const PassInfo *ID) const {
Chris Lattner216edd42002-08-30 20:25:01 +0000368 std::map<AnalysisID, Pass*>::const_iterator I = CurrentAnalyses.find(ID);
Chris Lattner6e041bd2002-08-21 22:17:09 +0000369
370 if (I != CurrentAnalyses.end())
371 return I->second; // Found it.
372
Chris Lattner60430422003-04-24 20:07:38 +0000373 if (Pass *P = getImmutablePassOrNull(ID))
374 return P;
375
Chris Lattner6e041bd2002-08-21 22:17:09 +0000376 if (Batcher)
377 return ((AnalysisResolver*)Batcher)->getAnalysisOrNullDown(ID);
378 return 0;
Chris Lattnerac3e0602002-01-31 18:32:27 +0000379 }
380
Chris Lattner6e041bd2002-08-21 22:17:09 +0000381 Pass *getAnalysisOrNullUp(const PassInfo *ID) const {
Chris Lattner216edd42002-08-30 20:25:01 +0000382 std::map<AnalysisID, Pass*>::const_iterator I = CurrentAnalyses.find(ID);
Chris Lattner6e041bd2002-08-21 22:17:09 +0000383 if (I != CurrentAnalyses.end())
384 return I->second; // Found it.
385
386 if (Parent) // Try scanning...
387 return Parent->getAnalysisOrNullUp(ID);
Chris Lattner60430422003-04-24 20:07:38 +0000388 else if (!ImmutablePasses.empty())
389 return getImmutablePassOrNull(ID);
Chris Lattner6e041bd2002-08-21 22:17:09 +0000390 return 0;
Chris Lattnerac3e0602002-01-31 18:32:27 +0000391 }
392
393 // markPassUsed - Inform higher level pass managers (and ourselves)
394 // that these analyses are being used by this pass. This is used to
395 // make sure that analyses are not free'd before we have to use
396 // them...
397 //
Chris Lattner6e041bd2002-08-21 22:17:09 +0000398 void markPassUsed(const PassInfo *P, Pass *User) {
Chris Lattner216edd42002-08-30 20:25:01 +0000399 std::map<AnalysisID, Pass*>::const_iterator I = CurrentAnalyses.find(P);
Chris Lattner6e041bd2002-08-21 22:17:09 +0000400
Chris Lattnerac3e0602002-01-31 18:32:27 +0000401 if (I != CurrentAnalyses.end()) {
402 LastUseOf[I->second] = User; // Local pass, extend the lifetime
403 } else {
404 // Pass not in current available set, must be a higher level pass
Misha Brukman632df282002-10-29 23:06:16 +0000405 // available to us, propagate to parent pass manager... We tell the
Chris Lattnerac3e0602002-01-31 18:32:27 +0000406 // parent that we (the passmanager) are using the analysis so that it
407 // frees the analysis AFTER this pass manager runs.
408 //
Chris Lattneree0788d2002-09-25 21:59:11 +0000409 if (Parent) {
410 Parent->markPassUsed(P, this);
411 } else {
Chris Lattner60430422003-04-24 20:07:38 +0000412 assert(getAnalysisOrNullUp(P) &&
413 dynamic_cast<ImmutablePass*>(getAnalysisOrNullUp(P)) &&
414 "Pass available but not found! "
Chris Lattneree0788d2002-09-25 21:59:11 +0000415 "Perhaps this is a module pass requiring a function pass?");
416 }
Chris Lattnerac3e0602002-01-31 18:32:27 +0000417 }
418 }
Chris Lattneree0788d2002-09-25 21:59:11 +0000419
Chris Lattnerac3e0602002-01-31 18:32:27 +0000420 // Return the number of parent PassManagers that exist
421 virtual unsigned getDepth() const {
422 if (Parent == 0) return 0;
423 return 1 + Parent->getDepth();
424 }
425
Chris Lattner1e4867f2002-07-30 19:51:02 +0000426 virtual unsigned getNumContainedPasses() const { return Passes.size(); }
427 virtual const Pass *getContainedPass(unsigned N) const {
428 assert(N < Passes.size() && "Pass number out of range!");
429 return Passes[N];
430 }
431
Chris Lattner6e041bd2002-08-21 22:17:09 +0000432 // add - Add a pass to the queue of passes to run. This gives ownership of
Chris Lattner67d25652002-01-30 23:20:39 +0000433 // the Pass to the PassManager. When the PassManager is destroyed, the pass
Chris Lattnerac3e0602002-01-31 18:32:27 +0000434 // will be destroyed as well, so there is no need to delete the pass. This
435 // implies that all passes MUST be new'd.
Chris Lattner67d25652002-01-30 23:20:39 +0000436 //
437 void add(PassClass *P) {
438 // Get information about what analyses the pass uses...
Chris Lattnerc8e66542002-04-27 06:56:12 +0000439 AnalysisUsage AnUsage;
440 P->getAnalysisUsage(AnUsage);
441 const std::vector<AnalysisID> &Required = AnUsage.getRequiredSet();
Chris Lattner67d25652002-01-30 23:20:39 +0000442
443 // Loop over all of the analyses used by this pass,
Chris Lattnerc8e66542002-04-27 06:56:12 +0000444 for (std::vector<AnalysisID>::const_iterator I = Required.begin(),
445 E = Required.end(); I != E; ++I) {
Chris Lattner67d25652002-01-30 23:20:39 +0000446 if (getAnalysisOrNullDown(*I) == 0)
Chris Lattner26750072002-07-27 01:12:17 +0000447 add((PassClass*)(*I)->createPass());
Chris Lattner67d25652002-01-30 23:20:39 +0000448 }
449
450 // Tell the pass to add itself to this PassManager... the way it does so
451 // depends on the class of the pass, and is critical to laying out passes in
452 // an optimal order..
453 //
Chris Lattnerc8e66542002-04-27 06:56:12 +0000454 P->addToPassManager(this, AnUsage);
Chris Lattner67d25652002-01-30 23:20:39 +0000455 }
456
Brian Gaeke2cc4b9d2003-08-14 06:07:57 +0000457 // add - H4x0r an ImmutablePass into a PassManager that might not be
458 // expecting one.
459 //
460 void add(ImmutablePass *P) {
461 // Get information about what analyses the pass uses...
462 AnalysisUsage AnUsage;
463 P->getAnalysisUsage(AnUsage);
464 const std::vector<AnalysisID> &Required = AnUsage.getRequiredSet();
Chris Lattner67d25652002-01-30 23:20:39 +0000465
Brian Gaeke2cc4b9d2003-08-14 06:07:57 +0000466 // Loop over all of the analyses used by this pass,
467 for (std::vector<AnalysisID>::const_iterator I = Required.begin(),
468 E = Required.end(); I != E; ++I) {
469 if (getAnalysisOrNullDown(*I) == 0)
470 add((PassClass*)(*I)->createPass());
471 }
472
473 // Add the ImmutablePass to this PassManager.
474 addPass(P, AnUsage);
475 }
476
477private:
Chris Lattner67d25652002-01-30 23:20:39 +0000478 // addPass - These functions are used to implement the subclass specific
479 // behaviors present in PassManager. Basically the add(Pass*) method ends up
480 // reflecting its behavior into a Pass::addToPassManager call. Subclasses of
481 // Pass override it specifically so that they can reflect the type
482 // information inherent in "this" back to the PassManager.
483 //
484 // For generic Pass subclasses (which are interprocedural passes), we simply
485 // add the pass to the end of the pass list and terminate any accumulation of
Chris Lattnerc8e66542002-04-27 06:56:12 +0000486 // FunctionPass's that are present.
Chris Lattner67d25652002-01-30 23:20:39 +0000487 //
Chris Lattnerc8e66542002-04-27 06:56:12 +0000488 void addPass(PassClass *P, AnalysisUsage &AnUsage) {
489 const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();
Chris Lattnerc8e66542002-04-27 06:56:12 +0000490
Chris Lattner73503172002-07-29 21:03:38 +0000491 // FIXME: If this pass being added isn't killed by any of the passes in the
492 // batcher class then we can reorder to pass to execute before the batcher
493 // does, which will potentially allow us to batch more passes!
Chris Lattner67d25652002-01-30 23:20:39 +0000494 //
Chris Lattner73503172002-07-29 21:03:38 +0000495 //const std::vector<AnalysisID> &ProvidedSet = AnUsage.getProvidedSet();
496 if (Batcher /*&& ProvidedSet.empty()*/)
Chris Lattner67d25652002-01-30 23:20:39 +0000497 closeBatcher(); // This pass cannot be batched!
498
499 // Set the Resolver instance variable in the Pass so that it knows where to
500 // find this object...
501 //
502 setAnalysisResolver(P, this);
503 Passes.push_back(P);
504
Chris Lattnerac3e0602002-01-31 18:32:27 +0000505 // Inform higher level pass managers (and ourselves) that these analyses are
506 // being used by this pass. This is used to make sure that analyses are not
507 // free'd before we have to use them...
508 //
Chris Lattnerc8e66542002-04-27 06:56:12 +0000509 for (std::vector<AnalysisID>::const_iterator I = RequiredSet.begin(),
510 E = RequiredSet.end(); I != E; ++I)
Chris Lattnerac3e0602002-01-31 18:32:27 +0000511 markPassUsed(*I, P); // Mark *I as used by P
512
Chris Lattnerc8e66542002-04-27 06:56:12 +0000513 // Erase all analyses not in the preserved set...
Chris Lattner820d9712002-10-21 20:00:28 +0000514 if (!AnUsage.getPreservesAll()) {
Chris Lattnerc8e66542002-04-27 06:56:12 +0000515 const std::vector<AnalysisID> &PreservedSet = AnUsage.getPreservedSet();
516 for (std::map<AnalysisID, Pass*>::iterator I = CurrentAnalyses.begin(),
Chris Lattneree0788d2002-09-25 21:59:11 +0000517 E = CurrentAnalyses.end(); I != E; ) {
518 if (std::find(PreservedSet.begin(), PreservedSet.end(), I->first) ==
519 PreservedSet.end()) { // Analysis not preserved!
520 CurrentAnalyses.erase(I); // Remove from available analyses
Chris Lattnerc8e66542002-04-27 06:56:12 +0000521 I = CurrentAnalyses.begin();
Chris Lattneree0788d2002-09-25 21:59:11 +0000522 } else {
523 ++I;
Chris Lattnerc8e66542002-04-27 06:56:12 +0000524 }
Chris Lattneree0788d2002-09-25 21:59:11 +0000525 }
Chris Lattnerc8e66542002-04-27 06:56:12 +0000526 }
Chris Lattner67d25652002-01-30 23:20:39 +0000527
Chris Lattner73503172002-07-29 21:03:38 +0000528 // Add this pass to the currently available set...
Chris Lattner216edd42002-08-30 20:25:01 +0000529 if (const PassInfo *PI = P->getPassInfo()) {
Chris Lattner73503172002-07-29 21:03:38 +0000530 CurrentAnalyses[PI] = P;
Chris Lattnerac3e0602002-01-31 18:32:27 +0000531
Chris Lattner216edd42002-08-30 20:25:01 +0000532 // This pass is the current implementation of all of the interfaces it
533 // implements as well.
534 //
535 const std::vector<const PassInfo*> &II = PI->getInterfacesImplemented();
536 for (unsigned i = 0, e = II.size(); i != e; ++i)
537 CurrentAnalyses[II[i]] = P;
538 }
539
Chris Lattnerac3e0602002-01-31 18:32:27 +0000540 // For now assume that our results are never used...
541 LastUseOf[P] = P;
Chris Lattner67d25652002-01-30 23:20:39 +0000542 }
543
Chris Lattnerc8e66542002-04-27 06:56:12 +0000544 // For FunctionPass subclasses, we must be sure to batch the FunctionPass's
545 // together in a BatcherClass object so that all of the analyses are run
546 // together a function at a time.
Chris Lattner67d25652002-01-30 23:20:39 +0000547 //
Chris Lattnerc8e66542002-04-27 06:56:12 +0000548 void addPass(SubPassClass *MP, AnalysisUsage &AnUsage) {
Chris Lattner67d25652002-01-30 23:20:39 +0000549 if (Batcher == 0) // If we don't have a batcher yet, make one now.
550 Batcher = new BatcherClass(this);
Chris Lattner73503172002-07-29 21:03:38 +0000551 // The Batcher will queue the passes up
Chris Lattnerc8e66542002-04-27 06:56:12 +0000552 MP->addToPassManager(Batcher, AnUsage);
Chris Lattner67d25652002-01-30 23:20:39 +0000553 }
554
555 // closeBatcher - Terminate the batcher that is being worked on.
556 void closeBatcher() {
557 if (Batcher) {
558 Passes.push_back(Batcher);
559 Batcher = 0;
560 }
561 }
Chris Lattneree0788d2002-09-25 21:59:11 +0000562
563public:
564 // When an ImmutablePass is added, it gets added to the top level pass
565 // manager.
566 void addPass(ImmutablePass *IP, AnalysisUsage &AU) {
567 if (Parent) { // Make sure this request goes to the top level passmanager...
568 Parent->addPass(IP, AU);
569 return;
570 }
571
572 // Set the Resolver instance variable in the Pass so that it knows where to
573 // find this object...
574 //
575 setAnalysisResolver(IP, this);
576 ImmutablePasses.push_back(IP);
Chris Lattnerd4ed5c62003-02-26 19:10:57 +0000577
578 // All Required analyses should be available to the pass as it initializes!
579 // Here we fill in the AnalysisImpls member of the pass so that it can
580 // successfully use the getAnalysis() method to retrieve the implementations
581 // it needs.
582 //
583 IP->AnalysisImpls.clear();
584 IP->AnalysisImpls.reserve(AU.getRequiredSet().size());
585 for (std::vector<const PassInfo *>::const_iterator
586 I = AU.getRequiredSet().begin(),
587 E = AU.getRequiredSet().end(); I != E; ++I) {
588 Pass *Impl = getAnalysisOrNullUp(*I);
589 if (Impl == 0) {
590 std::cerr << "Analysis '" << (*I)->getPassName()
591 << "' used but not available!";
592 assert(0 && "Analysis used but not available!");
593 } else if (PassDebugging == Details) {
594 if ((*I)->getPassName() != std::string(Impl->getPassName()))
595 std::cerr << " Interface '" << (*I)->getPassName()
596 << "' implemented by '" << Impl->getPassName() << "'\n";
597 }
598 IP->AnalysisImpls.push_back(std::make_pair(*I, Impl));
599 }
Chris Lattneree0788d2002-09-25 21:59:11 +0000600
Chris Lattnerd4ed5c62003-02-26 19:10:57 +0000601 // Initialize the immutable pass...
602 IP->initializePass();
Chris Lattneree0788d2002-09-25 21:59:11 +0000603 }
Chris Lattner67d25652002-01-30 23:20:39 +0000604};
605
606
607
608//===----------------------------------------------------------------------===//
609// PassManagerTraits<BasicBlock> Specialization
610//
611// This pass manager is used to group together all of the BasicBlockPass's
612// into a single unit.
613//
614template<> struct PassManagerTraits<BasicBlock> : public BasicBlockPass {
615 // PassClass - The type of passes tracked by this PassManager
616 typedef BasicBlockPass PassClass;
617
618 // SubPassClass - The types of classes that should be collated together
619 // This is impossible to match, so BasicBlock instantiations of PassManagerT
620 // do not collate.
621 //
622 typedef PassManagerT<Module> SubPassClass;
623
624 // BatcherClass - The type to use for collation of subtypes... This class is
625 // never instantiated for the PassManager<BasicBlock>, but it must be an
626 // instance of PassClass to typecheck.
627 //
628 typedef PassClass BatcherClass;
629
630 // ParentClass - The type of the parent PassManager...
Chris Lattner4e8c4872002-03-23 22:51:58 +0000631 typedef PassManagerT<Function> ParentClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000632
Chris Lattner2eaac392002-01-31 00:40:44 +0000633 // PMType - The type of the passmanager that subclasses this class
634 typedef PassManagerT<BasicBlock> PMType;
635
Chris Lattner67d25652002-01-30 23:20:39 +0000636 // runPass - Specify how the pass should be run on the UnitType
637 static bool runPass(PassClass *P, BasicBlock *M) {
638 // todo, init and finalize
Chris Lattner113f4f42002-06-25 16:13:24 +0000639 return P->runOnBasicBlock(*M);
Chris Lattner67d25652002-01-30 23:20:39 +0000640 }
641
Chris Lattnerac3e0602002-01-31 18:32:27 +0000642 // getPMName() - Return the name of the unit the PassManager operates on for
643 // debugging.
644 const char *getPMName() const { return "BasicBlock"; }
Chris Lattner37104aa2002-04-29 14:57:45 +0000645 virtual const char *getPassName() const { return "BasicBlock Pass Manager"; }
Chris Lattnerac3e0602002-01-31 18:32:27 +0000646
Chris Lattner2eaac392002-01-31 00:40:44 +0000647 // Implement the BasicBlockPass interface...
Chris Lattner113f4f42002-06-25 16:13:24 +0000648 virtual bool doInitialization(Module &M);
Chris Lattnerbae3c672002-09-12 17:06:40 +0000649 virtual bool doInitialization(Function &F);
Chris Lattner113f4f42002-06-25 16:13:24 +0000650 virtual bool runOnBasicBlock(BasicBlock &BB);
Chris Lattnerbae3c672002-09-12 17:06:40 +0000651 virtual bool doFinalization(Function &F);
Chris Lattner113f4f42002-06-25 16:13:24 +0000652 virtual bool doFinalization(Module &M);
Chris Lattnercb429062002-04-30 18:50:17 +0000653
654 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
655 AU.setPreservesAll();
656 }
Chris Lattner67d25652002-01-30 23:20:39 +0000657};
658
659
660
661//===----------------------------------------------------------------------===//
Chris Lattner4e8c4872002-03-23 22:51:58 +0000662// PassManagerTraits<Function> Specialization
Chris Lattner67d25652002-01-30 23:20:39 +0000663//
Chris Lattnerc8e66542002-04-27 06:56:12 +0000664// This pass manager is used to group together all of the FunctionPass's
Chris Lattner67d25652002-01-30 23:20:39 +0000665// into a single unit.
666//
Chris Lattnerc8e66542002-04-27 06:56:12 +0000667template<> struct PassManagerTraits<Function> : public FunctionPass {
Chris Lattner67d25652002-01-30 23:20:39 +0000668 // PassClass - The type of passes tracked by this PassManager
Chris Lattnerc8e66542002-04-27 06:56:12 +0000669 typedef FunctionPass PassClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000670
671 // SubPassClass - The types of classes that should be collated together
672 typedef BasicBlockPass SubPassClass;
673
674 // BatcherClass - The type to use for collation of subtypes...
675 typedef PassManagerT<BasicBlock> BatcherClass;
676
677 // ParentClass - The type of the parent PassManager...
678 typedef PassManagerT<Module> ParentClass;
679
680 // PMType - The type of the passmanager that subclasses this class
Chris Lattner4e8c4872002-03-23 22:51:58 +0000681 typedef PassManagerT<Function> PMType;
Chris Lattner67d25652002-01-30 23:20:39 +0000682
683 // runPass - Specify how the pass should be run on the UnitType
Chris Lattnerc8e66542002-04-27 06:56:12 +0000684 static bool runPass(PassClass *P, Function *F) {
Chris Lattner113f4f42002-06-25 16:13:24 +0000685 return P->runOnFunction(*F);
Chris Lattner67d25652002-01-30 23:20:39 +0000686 }
687
Chris Lattnerac3e0602002-01-31 18:32:27 +0000688 // getPMName() - Return the name of the unit the PassManager operates on for
689 // debugging.
Chris Lattner4e8c4872002-03-23 22:51:58 +0000690 const char *getPMName() const { return "Function"; }
Chris Lattner37104aa2002-04-29 14:57:45 +0000691 virtual const char *getPassName() const { return "Function Pass Manager"; }
Chris Lattnerac3e0602002-01-31 18:32:27 +0000692
Chris Lattnerc8e66542002-04-27 06:56:12 +0000693 // Implement the FunctionPass interface...
Chris Lattner113f4f42002-06-25 16:13:24 +0000694 virtual bool doInitialization(Module &M);
695 virtual bool runOnFunction(Function &F);
696 virtual bool doFinalization(Module &M);
Chris Lattnercb429062002-04-30 18:50:17 +0000697
698 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
699 AU.setPreservesAll();
700 }
Chris Lattner67d25652002-01-30 23:20:39 +0000701};
702
703
704
705//===----------------------------------------------------------------------===//
706// PassManagerTraits<Module> Specialization
707//
708// This is the top level PassManager implementation that holds generic passes.
709//
710template<> struct PassManagerTraits<Module> : public Pass {
711 // PassClass - The type of passes tracked by this PassManager
712 typedef Pass PassClass;
713
714 // SubPassClass - The types of classes that should be collated together
Chris Lattnerc8e66542002-04-27 06:56:12 +0000715 typedef FunctionPass SubPassClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000716
717 // BatcherClass - The type to use for collation of subtypes...
Chris Lattner4e8c4872002-03-23 22:51:58 +0000718 typedef PassManagerT<Function> BatcherClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000719
720 // ParentClass - The type of the parent PassManager...
Chris Lattnerac3e0602002-01-31 18:32:27 +0000721 typedef AnalysisResolver ParentClass;
Chris Lattner67d25652002-01-30 23:20:39 +0000722
723 // runPass - Specify how the pass should be run on the UnitType
Chris Lattner113f4f42002-06-25 16:13:24 +0000724 static bool runPass(PassClass *P, Module *M) { return P->run(*M); }
Chris Lattner67d25652002-01-30 23:20:39 +0000725
Chris Lattnerac3e0602002-01-31 18:32:27 +0000726 // getPMName() - Return the name of the unit the PassManager operates on for
727 // debugging.
728 const char *getPMName() const { return "Module"; }
Chris Lattner37104aa2002-04-29 14:57:45 +0000729 virtual const char *getPassName() const { return "Module Pass Manager"; }
Chris Lattnerac3e0602002-01-31 18:32:27 +0000730
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000731 // run - Implement the PassManager interface...
Chris Lattner113f4f42002-06-25 16:13:24 +0000732 bool run(Module &M) {
Chris Lattnere7e09442003-08-14 05:20:28 +0000733 return ((PassManagerT<Module>*)this)->runOnUnit(&M);
Chris Lattnere2eb99e2002-04-29 04:04:29 +0000734 }
Chris Lattner67d25652002-01-30 23:20:39 +0000735};
736
737
738
739//===----------------------------------------------------------------------===//
740// PassManagerTraits Method Implementations
741//
742
743// PassManagerTraits<BasicBlock> Implementations
744//
Chris Lattner113f4f42002-06-25 16:13:24 +0000745inline bool PassManagerTraits<BasicBlock>::doInitialization(Module &M) {
Chris Lattner2eaac392002-01-31 00:40:44 +0000746 bool Changed = false;
747 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
748 ((PMType*)this)->Passes[i]->doInitialization(M);
749 return Changed;
750}
751
Chris Lattnerbae3c672002-09-12 17:06:40 +0000752inline bool PassManagerTraits<BasicBlock>::doInitialization(Function &F) {
753 bool Changed = false;
754 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
755 ((PMType*)this)->Passes[i]->doInitialization(F);
756 return Changed;
757}
758
Chris Lattner113f4f42002-06-25 16:13:24 +0000759inline bool PassManagerTraits<BasicBlock>::runOnBasicBlock(BasicBlock &BB) {
760 return ((PMType*)this)->runOnUnit(&BB);
Chris Lattner2eaac392002-01-31 00:40:44 +0000761}
762
Chris Lattnerbae3c672002-09-12 17:06:40 +0000763inline bool PassManagerTraits<BasicBlock>::doFinalization(Function &F) {
764 bool Changed = false;
765 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
766 ((PMType*)this)->Passes[i]->doFinalization(F);
767 return Changed;
768}
769
Chris Lattner113f4f42002-06-25 16:13:24 +0000770inline bool PassManagerTraits<BasicBlock>::doFinalization(Module &M) {
Chris Lattner2eaac392002-01-31 00:40:44 +0000771 bool Changed = false;
772 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
773 ((PMType*)this)->Passes[i]->doFinalization(M);
774 return Changed;
Chris Lattner67d25652002-01-30 23:20:39 +0000775}
776
777
Chris Lattner4e8c4872002-03-23 22:51:58 +0000778// PassManagerTraits<Function> Implementations
Chris Lattner67d25652002-01-30 23:20:39 +0000779//
Chris Lattner113f4f42002-06-25 16:13:24 +0000780inline bool PassManagerTraits<Function>::doInitialization(Module &M) {
Chris Lattner67d25652002-01-30 23:20:39 +0000781 bool Changed = false;
782 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
783 ((PMType*)this)->Passes[i]->doInitialization(M);
784 return Changed;
785}
786
Chris Lattner113f4f42002-06-25 16:13:24 +0000787inline bool PassManagerTraits<Function>::runOnFunction(Function &F) {
788 return ((PMType*)this)->runOnUnit(&F);
Chris Lattner67d25652002-01-30 23:20:39 +0000789}
790
Chris Lattner113f4f42002-06-25 16:13:24 +0000791inline bool PassManagerTraits<Function>::doFinalization(Module &M) {
Chris Lattner67d25652002-01-30 23:20:39 +0000792 bool Changed = false;
793 for (unsigned i = 0, e = ((PMType*)this)->Passes.size(); i != e; ++i)
794 ((PMType*)this)->Passes[i]->doFinalization(M);
795 return Changed;
796}
797
Brian Gaeke960707c2003-11-11 22:41:34 +0000798} // End llvm namespace
799
Chris Lattner67d25652002-01-30 23:20:39 +0000800#endif