1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 /*****************************************************************************/
15 Phase(Compiler *_comp,
17 Phases _phase=PHASE_NUMBER_OF)
18 : comp(_comp), name(_name), phase(_phase) {}
20 virtual void PrePhase();
21 virtual void DoPhase() = 0;
22 virtual void PostPhase();
29 inline void Phase::Run()
36 inline void Phase::PrePhase()
41 printf("*************** In %s\n", name);
42 printf("Trees before %s\n", name);
43 comp->fgDispBasicBlocks(true);
46 if (comp->expensiveDebugCheckLevel >= 2)
48 // If everyone used the Phase class, this would duplicate the PostPhase() from the previous phase.
49 // But, not everyone does, so go ahead and do the check here, too.
50 comp->fgDebugCheckBBlist();
51 comp->fgDebugCheckLinks();
56 inline void Phase::PostPhase()
61 printf("*************** Exiting %s\n", name);
62 printf("Trees after %s\n", name);
63 comp->fgDispBasicBlocks(true);
67 if (phase != PHASE_NUMBER_OF)
69 comp->EndPhase(phase);
73 comp->fgDebugCheckBBlist();
74 comp->fgDebugCheckLinks();
79 #endif /* End of _PHASE_H_ */