Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:16

0001 //===----------------------- View.h -----------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 /// \file
0009 ///
0010 /// This file defines the main interface for Views. Each view contributes a
0011 /// portion of the final report generated by the tool.
0012 ///
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_MCA_VIEW_H
0016 #define LLVM_MCA_VIEW_H
0017 
0018 #include "llvm/MC/MCInstPrinter.h"
0019 #include "llvm/MCA/HWEventListener.h"
0020 #include "llvm/Support/JSON.h"
0021 #include "llvm/Support/raw_ostream.h"
0022 
0023 namespace llvm {
0024 namespace mca {
0025 
0026 class View : public HWEventListener {
0027 public:
0028   virtual ~View() = default;
0029 
0030   virtual void printView(llvm::raw_ostream &OS) const = 0;
0031   virtual StringRef getNameAsString() const = 0;
0032 
0033   virtual json::Value toJSON() const { return "not implemented"; }
0034   virtual bool isSerializable() const { return true; }
0035 
0036   void anchor() override;
0037 };
0038 } // namespace mca
0039 } // namespace llvm
0040 
0041 #endif