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, const char* _name, Phases _phase = PHASE_NUMBER_OF) : comp(_comp), name(_name), phase(_phase)
19 virtual void PrePhase();
20 virtual void DoPhase() = 0;
21 virtual void PostPhase();
28 inline void Phase::Run()
35 inline void Phase::PrePhase()
40 printf("*************** In %s\n", name);
41 printf("Trees before %s\n", name);
42 comp->fgDispBasicBlocks(true);
45 if (comp->expensiveDebugCheckLevel >= 2)
47 // If everyone used the Phase class, this would duplicate the PostPhase() from the previous phase.
48 // But, not everyone does, so go ahead and do the check here, too.
49 comp->fgDebugCheckBBlist();
50 comp->fgDebugCheckLinks();
55 inline void Phase::PostPhase()
60 printf("*************** Exiting %s\n", name);
61 printf("Trees after %s\n", name);
62 comp->fgDispBasicBlocks(true);
66 if (phase != PHASE_NUMBER_OF)
68 comp->EndPhase(phase);
72 comp->fgDebugCheckBBlist();
73 comp->fgDebugCheckLinks();
77 #endif /* End of _PHASE_H_ */