blob: ec193debfa4210fb2e072baaacd4df1fd1e94f4f [file] [log] [blame]
Chris Lattner26e4f892002-01-21 07:37:31 +00001//===- Pass.cpp - LLVM Pass Infrastructure Impementation ------------------===//
2//
3// This file implements the LLVM Pass infrastructure. It is primarily
4// responsible with ensuring that passes are executed and batched together
5// optimally.
6//
7//===----------------------------------------------------------------------===//
8
Chris Lattnercdd09c22002-01-31 00:45:31 +00009#include "llvm/PassManager.h"
Chris Lattner37c86672002-04-28 20:46:05 +000010#include "PassManagerT.h" // PassManagerT implementation
Chris Lattnercdd09c22002-01-31 00:45:31 +000011#include "llvm/Module.h"
Chris Lattner26e4f892002-01-21 07:37:31 +000012#include "Support/STLExtras.h"
Chris Lattner37d3c952002-07-23 18:08:00 +000013#include "Support/TypeInfo.h"
John Criswell3ef61af2003-06-30 21:59:07 +000014#include "Config/stdio.h"
15#include "Config/sys/resource.h"
16#include "Config/sys/time.h"
17#include "Config/unistd.h"
Chris Lattner6e041bd2002-08-21 22:17:09 +000018#include <set>
Chris Lattnerd013ba92002-01-23 05:49:41 +000019
Chris Lattner675e7a92002-08-21 23:51:51 +000020// IncludeFile - Stub function used to help linking out.
21IncludeFile::IncludeFile(void*) {}
22
Chris Lattner7e0dbe62002-05-06 19:31:52 +000023//===----------------------------------------------------------------------===//
24// AnalysisID Class Implementation
25//
26
Chris Lattner198cf422002-07-30 16:27:02 +000027static std::vector<const PassInfo*> CFGOnlyAnalyses;
Chris Lattnercdd09c22002-01-31 00:45:31 +000028
Chris Lattner198cf422002-07-30 16:27:02 +000029void RegisterPassBase::setPreservesCFG() {
30 CFGOnlyAnalyses.push_back(PIObj);
Chris Lattner7e0dbe62002-05-06 19:31:52 +000031}
32
33//===----------------------------------------------------------------------===//
34// AnalysisResolver Class Implementation
35//
36
Chris Lattnercdd09c22002-01-31 00:45:31 +000037void AnalysisResolver::setAnalysisResolver(Pass *P, AnalysisResolver *AR) {
38 assert(P->Resolver == 0 && "Pass already in a PassManager!");
39 P->Resolver = AR;
40}
41
Chris Lattner7e0dbe62002-05-06 19:31:52 +000042//===----------------------------------------------------------------------===//
43// AnalysisUsage Class Implementation
44//
Chris Lattneree2ff5d2002-04-28 21:25:41 +000045
Chris Lattner820d9712002-10-21 20:00:28 +000046// setPreservesCFG - This function should be called to by the pass, iff they do
Chris Lattneree2ff5d2002-04-28 21:25:41 +000047// not:
48//
49// 1. Add or remove basic blocks from the function
50// 2. Modify terminator instructions in any way.
51//
52// This function annotates the AnalysisUsage info object to say that analyses
53// that only depend on the CFG are preserved by this pass.
54//
Chris Lattner820d9712002-10-21 20:00:28 +000055void AnalysisUsage::setPreservesCFG() {
Chris Lattner7e0dbe62002-05-06 19:31:52 +000056 // Since this transformation doesn't modify the CFG, it preserves all analyses
57 // that only depend on the CFG (like dominators, loop info, etc...)
58 //
59 Preserved.insert(Preserved.end(),
60 CFGOnlyAnalyses.begin(), CFGOnlyAnalyses.end());
Chris Lattneree2ff5d2002-04-28 21:25:41 +000061}
62
63
Chris Lattner37c86672002-04-28 20:46:05 +000064//===----------------------------------------------------------------------===//
65// PassManager implementation - The PassManager class is a simple Pimpl class
66// that wraps the PassManagerT template.
67//
68PassManager::PassManager() : PM(new PassManagerT<Module>()) {}
69PassManager::~PassManager() { delete PM; }
70void PassManager::add(Pass *P) { PM->add(P); }
Chris Lattner113f4f42002-06-25 16:13:24 +000071bool PassManager::run(Module &M) { return PM->run(M); }
Chris Lattnercdd09c22002-01-31 00:45:31 +000072
Chris Lattner37c86672002-04-28 20:46:05 +000073
74//===----------------------------------------------------------------------===//
Chris Lattnere2eb99e2002-04-29 04:04:29 +000075// TimingInfo Class - This class is used to calculate information about the
76// amount of time each pass takes to execute. This only happens with
77// -time-passes is enabled on the command line.
78//
Chris Lattnerf5cad152002-07-22 02:10:13 +000079static cl::opt<bool>
80EnableTiming("time-passes",
81 cl::desc("Time each pass, printing elapsed time for each on exit"));
Chris Lattnere2eb99e2002-04-29 04:04:29 +000082
Chris Lattnere2eb99e2002-04-29 04:04:29 +000083// Create method. If Timing is enabled, this creates and returns a new timing
84// object, otherwise it returns null.
85//
86TimingInfo *TimingInfo::create() {
87 return EnableTiming ? new TimingInfo() : 0;
88}
89
Chris Lattner1e4867f2002-07-30 19:51:02 +000090void PMDebug::PrintArgumentInformation(const Pass *P) {
91 // Print out passes in pass manager...
92 if (const AnalysisResolver *PM = dynamic_cast<const AnalysisResolver*>(P)) {
93 for (unsigned i = 0, e = PM->getNumContainedPasses(); i != e; ++i)
94 PrintArgumentInformation(PM->getContainedPass(i));
95
96 } else { // Normal pass. Print argument information...
97 // Print out arguments for registered passes that are _optimizations_
98 if (const PassInfo *PI = P->getPassInfo())
99 if (PI->getPassType() & PassInfo::Optimization)
100 std::cerr << " -" << PI->getPassArgument();
101 }
102}
Chris Lattnercdd09c22002-01-31 00:45:31 +0000103
104void PMDebug::PrintPassInformation(unsigned Depth, const char *Action,
Chris Lattnera454b5b2002-04-28 05:14:06 +0000105 Pass *P, Annotable *V) {
Chris Lattnerf5cad152002-07-22 02:10:13 +0000106 if (PassDebugging >= Executions) {
Chris Lattnerac3e0602002-01-31 18:32:27 +0000107 std::cerr << (void*)P << std::string(Depth*2+1, ' ') << Action << " '"
Chris Lattner37104aa2002-04-29 14:57:45 +0000108 << P->getPassName();
Chris Lattnercdd09c22002-01-31 00:45:31 +0000109 if (V) {
110 std::cerr << "' on ";
Chris Lattnera454b5b2002-04-28 05:14:06 +0000111
112 if (dynamic_cast<Module*>(V)) {
Chris Lattnercdd09c22002-01-31 00:45:31 +0000113 std::cerr << "Module\n"; return;
Chris Lattnera454b5b2002-04-28 05:14:06 +0000114 } else if (Function *F = dynamic_cast<Function*>(V))
115 std::cerr << "Function '" << F->getName();
116 else if (BasicBlock *BB = dynamic_cast<BasicBlock*>(V))
117 std::cerr << "BasicBlock '" << BB->getName();
118 else if (Value *Val = dynamic_cast<Value*>(V))
119 std::cerr << typeid(*Val).name() << " '" << Val->getName();
Chris Lattnercdd09c22002-01-31 00:45:31 +0000120 }
121 std::cerr << "'...\n";
122 }
123}
124
125void PMDebug::PrintAnalysisSetInfo(unsigned Depth, const char *Msg,
Chris Lattnerc8e66542002-04-27 06:56:12 +0000126 Pass *P, const std::vector<AnalysisID> &Set){
Chris Lattnerf5cad152002-07-22 02:10:13 +0000127 if (PassDebugging >= Details && !Set.empty()) {
Chris Lattnerac3e0602002-01-31 18:32:27 +0000128 std::cerr << (void*)P << std::string(Depth*2+3, ' ') << Msg << " Analyses:";
Chris Lattnerb3708e22002-08-30 20:23:45 +0000129 for (unsigned i = 0; i != Set.size(); ++i) {
130 if (i) std::cerr << ",";
131 std::cerr << " " << Set[i]->getPassName();
132 }
Chris Lattnercdd09c22002-01-31 00:45:31 +0000133 std::cerr << "\n";
134 }
135}
136
Chris Lattnercdd09c22002-01-31 00:45:31 +0000137//===----------------------------------------------------------------------===//
138// Pass Implementation
Chris Lattner654b5bc2002-01-22 00:17:48 +0000139//
Chris Lattnercdd09c22002-01-31 00:45:31 +0000140
Chris Lattnerc8e66542002-04-27 06:56:12 +0000141void Pass::addToPassManager(PassManagerT<Module> *PM, AnalysisUsage &AU) {
142 PM->addPass(this, AU);
Chris Lattner654b5bc2002-01-22 00:17:48 +0000143}
Chris Lattner26e4f892002-01-21 07:37:31 +0000144
Chris Lattner9ad77572003-03-21 21:41:02 +0000145bool Pass::mustPreserveAnalysisID(const PassInfo *AnalysisID) const {
146 return Resolver->getAnalysisToUpdate(AnalysisID) != 0;
147}
148
Chris Lattner198cf422002-07-30 16:27:02 +0000149// dumpPassStructure - Implement the -debug-passes=Structure option
150void Pass::dumpPassStructure(unsigned Offset) {
151 std::cerr << std::string(Offset*2, ' ') << getPassName() << "\n";
152}
Chris Lattner37104aa2002-04-29 14:57:45 +0000153
154// getPassName - Use C++ RTTI to get a SOMEWHAT intelligable name for the pass.
155//
Chris Lattner071577d2002-07-29 21:02:31 +0000156const char *Pass::getPassName() const {
157 if (const PassInfo *PI = getPassInfo())
158 return PI->getPassName();
159 return typeid(*this).name();
160}
Chris Lattner37104aa2002-04-29 14:57:45 +0000161
Chris Lattner26750072002-07-27 01:12:17 +0000162// print - Print out the internal state of the pass. This is called by Analyse
163// to print out the contents of an analysis. Otherwise it is not neccesary to
164// implement this method.
165//
166void Pass::print(std::ostream &O) const {
167 O << "Pass::print not implemented for pass: '" << getPassName() << "'!\n";
168}
169
170// dump - call print(std::cerr);
171void Pass::dump() const {
172 print(std::cerr, 0);
173}
174
Chris Lattnercdd09c22002-01-31 00:45:31 +0000175//===----------------------------------------------------------------------===//
Chris Lattneree0788d2002-09-25 21:59:11 +0000176// ImmutablePass Implementation
177//
178void ImmutablePass::addToPassManager(PassManagerT<Module> *PM,
179 AnalysisUsage &AU) {
180 PM->addPass(this, AU);
181}
182
183
184//===----------------------------------------------------------------------===//
Chris Lattnerc8e66542002-04-27 06:56:12 +0000185// FunctionPass Implementation
Chris Lattner26e4f892002-01-21 07:37:31 +0000186//
Chris Lattnercdd09c22002-01-31 00:45:31 +0000187
Chris Lattnerc8e66542002-04-27 06:56:12 +0000188// run - On a module, we run this pass by initializing, runOnFunction'ing once
189// for every function in the module, then by finalizing.
Chris Lattnercdd09c22002-01-31 00:45:31 +0000190//
Chris Lattner113f4f42002-06-25 16:13:24 +0000191bool FunctionPass::run(Module &M) {
Chris Lattnercdd09c22002-01-31 00:45:31 +0000192 bool Changed = doInitialization(M);
193
Chris Lattner113f4f42002-06-25 16:13:24 +0000194 for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
195 if (!I->isExternal()) // Passes are not run on external functions!
Chris Lattnerc8e66542002-04-27 06:56:12 +0000196 Changed |= runOnFunction(*I);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000197
198 return Changed | doFinalization(M);
Chris Lattner26e4f892002-01-21 07:37:31 +0000199}
200
Chris Lattnerc8e66542002-04-27 06:56:12 +0000201// run - On a function, we simply initialize, run the function, then finalize.
Chris Lattnercdd09c22002-01-31 00:45:31 +0000202//
Chris Lattner113f4f42002-06-25 16:13:24 +0000203bool FunctionPass::run(Function &F) {
204 if (F.isExternal()) return false;// Passes are not run on external functions!
Chris Lattnercdd09c22002-01-31 00:45:31 +0000205
Chris Lattner113f4f42002-06-25 16:13:24 +0000206 return doInitialization(*F.getParent()) | runOnFunction(F)
207 | doFinalization(*F.getParent());
Chris Lattner26e4f892002-01-21 07:37:31 +0000208}
Chris Lattnerd013ba92002-01-23 05:49:41 +0000209
Chris Lattnerc8e66542002-04-27 06:56:12 +0000210void FunctionPass::addToPassManager(PassManagerT<Module> *PM,
211 AnalysisUsage &AU) {
212 PM->addPass(this, AU);
Chris Lattnerd013ba92002-01-23 05:49:41 +0000213}
Chris Lattnercdd09c22002-01-31 00:45:31 +0000214
Chris Lattnerc8e66542002-04-27 06:56:12 +0000215void FunctionPass::addToPassManager(PassManagerT<Function> *PM,
216 AnalysisUsage &AU) {
217 PM->addPass(this, AU);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000218}
219
220//===----------------------------------------------------------------------===//
221// BasicBlockPass Implementation
222//
223
Chris Lattnerc8e66542002-04-27 06:56:12 +0000224// To run this pass on a function, we simply call runOnBasicBlock once for each
225// function.
Chris Lattnercdd09c22002-01-31 00:45:31 +0000226//
Chris Lattner113f4f42002-06-25 16:13:24 +0000227bool BasicBlockPass::runOnFunction(Function &F) {
Chris Lattnerbae3c672002-09-12 17:06:40 +0000228 bool Changed = doInitialization(F);
Chris Lattner113f4f42002-06-25 16:13:24 +0000229 for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I)
Chris Lattnercdd09c22002-01-31 00:45:31 +0000230 Changed |= runOnBasicBlock(*I);
Chris Lattnerbae3c672002-09-12 17:06:40 +0000231 return Changed | doFinalization(F);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000232}
233
234// To run directly on the basic block, we initialize, runOnBasicBlock, then
235// finalize.
236//
Chris Lattner113f4f42002-06-25 16:13:24 +0000237bool BasicBlockPass::run(BasicBlock &BB) {
Chris Lattnerbae3c672002-09-12 17:06:40 +0000238 Function &F = *BB.getParent();
239 Module &M = *F.getParent();
240 return doInitialization(M) | doInitialization(F) | runOnBasicBlock(BB) |
241 doFinalization(F) | doFinalization(M);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000242}
243
Chris Lattner57698e22002-03-26 18:01:55 +0000244void BasicBlockPass::addToPassManager(PassManagerT<Function> *PM,
Chris Lattnerc8e66542002-04-27 06:56:12 +0000245 AnalysisUsage &AU) {
246 PM->addPass(this, AU);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000247}
248
249void BasicBlockPass::addToPassManager(PassManagerT<BasicBlock> *PM,
Chris Lattnerc8e66542002-04-27 06:56:12 +0000250 AnalysisUsage &AU) {
251 PM->addPass(this, AU);
Chris Lattnercdd09c22002-01-31 00:45:31 +0000252}
253
Chris Lattner37d3c952002-07-23 18:08:00 +0000254
255//===----------------------------------------------------------------------===//
256// Pass Registration mechanism
257//
258static std::map<TypeInfo, PassInfo*> *PassInfoMap = 0;
259static std::vector<PassRegistrationListener*> *Listeners = 0;
260
261// getPassInfo - Return the PassInfo data structure that corresponds to this
262// pass...
263const PassInfo *Pass::getPassInfo() const {
Chris Lattner071577d2002-07-29 21:02:31 +0000264 if (PassInfoCache) return PassInfoCache;
Chris Lattner4b169632002-08-21 17:08:37 +0000265 return lookupPassInfo(typeid(*this));
266}
267
268const PassInfo *Pass::lookupPassInfo(const std::type_info &TI) {
Chris Lattner071577d2002-07-29 21:02:31 +0000269 if (PassInfoMap == 0) return 0;
Chris Lattner4b169632002-08-21 17:08:37 +0000270 std::map<TypeInfo, PassInfo*>::iterator I = PassInfoMap->find(TI);
Chris Lattner071577d2002-07-29 21:02:31 +0000271 return (I != PassInfoMap->end()) ? I->second : 0;
Chris Lattner37d3c952002-07-23 18:08:00 +0000272}
273
274void RegisterPassBase::registerPass(PassInfo *PI) {
275 if (PassInfoMap == 0)
276 PassInfoMap = new std::map<TypeInfo, PassInfo*>();
277
278 assert(PassInfoMap->find(PI->getTypeInfo()) == PassInfoMap->end() &&
279 "Pass already registered!");
280 PIObj = PI;
281 PassInfoMap->insert(std::make_pair(TypeInfo(PI->getTypeInfo()), PI));
282
283 // Notify any listeners...
284 if (Listeners)
285 for (std::vector<PassRegistrationListener*>::iterator
286 I = Listeners->begin(), E = Listeners->end(); I != E; ++I)
287 (*I)->passRegistered(PI);
288}
289
Chris Lattner6e041bd2002-08-21 22:17:09 +0000290void RegisterPassBase::unregisterPass(PassInfo *PI) {
Chris Lattner37d3c952002-07-23 18:08:00 +0000291 assert(PassInfoMap && "Pass registered but not in map!");
292 std::map<TypeInfo, PassInfo*>::iterator I =
Chris Lattner6e041bd2002-08-21 22:17:09 +0000293 PassInfoMap->find(PI->getTypeInfo());
Chris Lattner37d3c952002-07-23 18:08:00 +0000294 assert(I != PassInfoMap->end() && "Pass registered but not in map!");
295
296 // Remove pass from the map...
297 PassInfoMap->erase(I);
298 if (PassInfoMap->empty()) {
299 delete PassInfoMap;
300 PassInfoMap = 0;
301 }
302
303 // Notify any listeners...
304 if (Listeners)
305 for (std::vector<PassRegistrationListener*>::iterator
306 I = Listeners->begin(), E = Listeners->end(); I != E; ++I)
Chris Lattner6e041bd2002-08-21 22:17:09 +0000307 (*I)->passUnregistered(PI);
Chris Lattner37d3c952002-07-23 18:08:00 +0000308
309 // Delete the PassInfo object itself...
Chris Lattner6e041bd2002-08-21 22:17:09 +0000310 delete PI;
Chris Lattner37d3c952002-07-23 18:08:00 +0000311}
312
Chris Lattner6e041bd2002-08-21 22:17:09 +0000313//===----------------------------------------------------------------------===//
314// Analysis Group Implementation Code
315//===----------------------------------------------------------------------===//
316
317struct AnalysisGroupInfo {
318 const PassInfo *DefaultImpl;
319 std::set<const PassInfo *> Implementations;
320 AnalysisGroupInfo() : DefaultImpl(0) {}
321};
322
323static std::map<const PassInfo *, AnalysisGroupInfo> *AnalysisGroupInfoMap = 0;
324
325// RegisterAGBase implementation
326//
327RegisterAGBase::RegisterAGBase(const std::type_info &Interface,
328 const std::type_info *Pass, bool isDefault)
329 : ImplementationInfo(0), isDefaultImplementation(isDefault) {
330
Chris Lattner6e041bd2002-08-21 22:17:09 +0000331 InterfaceInfo = const_cast<PassInfo*>(Pass::lookupPassInfo(Interface));
332 if (InterfaceInfo == 0) { // First reference to Interface, add it now.
333 InterfaceInfo = // Create the new PassInfo for the interface...
334 new PassInfo("", "", Interface, PassInfo::AnalysisGroup, 0, 0);
335 registerPass(InterfaceInfo);
336 PIObj = 0;
337 }
338 assert(InterfaceInfo->getPassType() == PassInfo::AnalysisGroup &&
339 "Trying to join an analysis group that is a normal pass!");
340
341 if (Pass) {
Chris Lattner6e041bd2002-08-21 22:17:09 +0000342 ImplementationInfo = Pass::lookupPassInfo(*Pass);
343 assert(ImplementationInfo &&
344 "Must register pass before adding to AnalysisGroup!");
345
Chris Lattnerb3708e22002-08-30 20:23:45 +0000346 // Make sure we keep track of the fact that the implementation implements
347 // the interface.
348 PassInfo *IIPI = const_cast<PassInfo*>(ImplementationInfo);
349 IIPI->addInterfaceImplemented(InterfaceInfo);
350
Chris Lattner6e041bd2002-08-21 22:17:09 +0000351 // Lazily allocate to avoid nasty initialization order dependencies
352 if (AnalysisGroupInfoMap == 0)
353 AnalysisGroupInfoMap = new std::map<const PassInfo *,AnalysisGroupInfo>();
354
355 AnalysisGroupInfo &AGI = (*AnalysisGroupInfoMap)[InterfaceInfo];
356 assert(AGI.Implementations.count(ImplementationInfo) == 0 &&
357 "Cannot add a pass to the same analysis group more than once!");
358 AGI.Implementations.insert(ImplementationInfo);
359 if (isDefault) {
360 assert(AGI.DefaultImpl == 0 && InterfaceInfo->getNormalCtor() == 0 &&
361 "Default implementation for analysis group already specified!");
362 assert(ImplementationInfo->getNormalCtor() &&
363 "Cannot specify pass as default if it does not have a default ctor");
364 AGI.DefaultImpl = ImplementationInfo;
365 InterfaceInfo->setNormalCtor(ImplementationInfo->getNormalCtor());
366 }
367 }
368}
369
370void RegisterAGBase::setGroupName(const char *Name) {
371 assert(InterfaceInfo->getPassName()[0] == 0 && "Interface Name already set!");
372 InterfaceInfo->setPassName(Name);
373}
374
375RegisterAGBase::~RegisterAGBase() {
376 if (ImplementationInfo) {
377 assert(AnalysisGroupInfoMap && "Inserted into map, but map doesn't exist?");
378 AnalysisGroupInfo &AGI = (*AnalysisGroupInfoMap)[InterfaceInfo];
379
380 assert(AGI.Implementations.count(ImplementationInfo) &&
381 "Pass not a member of analysis group?");
382
383 if (AGI.DefaultImpl == ImplementationInfo)
384 AGI.DefaultImpl = 0;
385
386 AGI.Implementations.erase(ImplementationInfo);
387
388 // Last member of this analysis group? Unregister PassInfo, delete map entry
389 if (AGI.Implementations.empty()) {
390 assert(AGI.DefaultImpl == 0 &&
391 "Default implementation didn't unregister?");
392 AnalysisGroupInfoMap->erase(InterfaceInfo);
393 if (AnalysisGroupInfoMap->empty()) { // Delete map if empty
394 delete AnalysisGroupInfoMap;
395 AnalysisGroupInfoMap = 0;
396 }
397
398 unregisterPass(InterfaceInfo);
399 }
400 }
401}
402
403
Chris Lattner37d3c952002-07-23 18:08:00 +0000404//===----------------------------------------------------------------------===//
405// PassRegistrationListener implementation
406//
407
408// PassRegistrationListener ctor - Add the current object to the list of
409// PassRegistrationListeners...
410PassRegistrationListener::PassRegistrationListener() {
411 if (!Listeners) Listeners = new std::vector<PassRegistrationListener*>();
412 Listeners->push_back(this);
413}
414
415// dtor - Remove object from list of listeners...
416PassRegistrationListener::~PassRegistrationListener() {
417 std::vector<PassRegistrationListener*>::iterator I =
418 std::find(Listeners->begin(), Listeners->end(), this);
419 assert(Listeners && I != Listeners->end() &&
420 "PassRegistrationListener not registered!");
421 Listeners->erase(I);
422
423 if (Listeners->empty()) {
424 delete Listeners;
425 Listeners = 0;
426 }
427}
428
429// enumeratePasses - Iterate over the registered passes, calling the
430// passEnumerate callback on each PassInfo object.
431//
432void PassRegistrationListener::enumeratePasses() {
433 if (PassInfoMap)
434 for (std::map<TypeInfo, PassInfo*>::iterator I = PassInfoMap->begin(),
435 E = PassInfoMap->end(); I != E; ++I)
436 passEnumerate(I->second);
437}