<commit_before>// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*****************************************************************************/
#ifndef _PHASE_H_
#define _PHASE_H_

class Phase
{
public:
    Phase(Compiler *_comp, 
          const char *_name, 
          Phases _phase=PHASE_NUMBER_OF) 
        : comp(_comp), name(_name), phase(_phase) {}
    virtual void Run();

protected:
    virtual void PrePhase();
    virtual void DoPhase() = 0;
    virtual void PostPhase();

    Compiler *comp;
    const char *name;
    Phases phase;
};

inline void Phase::Run()
{
    PrePhase();
    DoPhase();
    PostPhase();
}

inline void Phase::PrePhase()
{
#ifdef DEBUG
    if (VERBOSE)
    {
        printf("*************** In %s\n", name);
        printf("Trees before %s\n", name);
        comp->fgDispBasicBlocks(true);
    }

    if (comp->expensiveDebugCheckLevel >= 2)
    {<commit_msg>Make Phase::Phase protected.<commit_after>// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

/*****************************************************************************/
#ifndef _PHASE_H_
#define _PHASE_H_

class Phase
{
public:
    virtual void Run();

protected:
    Phase(Compiler *_comp, 
          const char *_name, 
          Phases _phase=PHASE_NUMBER_OF) 
        : comp(_comp), name(_name), phase(_phase) {}

    virtual void PrePhase();
    virtual void DoPhase() = 0;
    virtual void PostPhase();

    Compiler *comp;
    const char *name;
    Phases phase;
};

inline void Phase::Run()
{
    PrePhase();
    DoPhase();
    PostPhase();
}

inline void Phase::PrePhase()
{
#ifdef DEBUG
    if (VERBOSE)
    {
        printf("*************** In %s\n", name);
        printf("Trees before %s\n", name);
        comp->fgDispBasicBlocks(true);
    }

    if (comp->expensiveDebugCheckLevel >= 2)
    {
{'fraction_non_alphanumeric': 0.1944181646168401, 'fraction_numerical': 0.001892147587511826, 'mean_word_length': 3.1228070175438596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6047404', 'n_tokens_mistral': 626, 'n_tokens_neox': 596, 'n_words': 196}