#ifndef LLVM_ANALYSIS_LOOPCHAINOPTREPORT_H
#define LLVM_ANALYSIS_LOOPCHAINOPTREPORT_H

#include "llvm/Analysis/OptimizationRemarkEmitter.h"

namespace llvm {

enum OptRemarkLevels { analysis, passed, missed };

class LoopChainOptReport {
  public:
    LoopChainOptReport() = delete;

    LoopChainOptReport(const Function *Func) {
      ORE = new OptimizationRemarkEmitter(Func);
    }

    virtual ~LoopChainOptReport() {
      delete ORE;
    }

    /**
     * @brief Emits an optimization remark for the LoopChain family of passes.
     *
     * This method generates and emits an optimization remark attached
     * to the provided instruction with the given remark name, message,
     * and level (analysis, passed, or missed).
     *
     * @param Inst The target instruction
     * @param RemarkName Remark name
     * @param RemarkMessage Remark message (defaults to empty string)
     * @param Level Optimization remark level (defaults to passed)
     */
    void emit(Instruction *Inst, StringRef RemarkName,
              StringRef RemarkMessage = "", OptRemarkLevels Level = passed);

  private:
    OptimizationRemarkEmitter *ORE;
};

} // namespace llvm

#endif // LLVM_ANALYSIS_LOOPCHAINOPTREPORT_H
