LLVM 19.0.0git
View.h
Go to the documentation of this file.
1//===----------------------- View.h -----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9///
10/// This file defines the main interface for Views. Each view contributes a
11/// portion of the final report generated by the tool.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_MCA_VIEW_H
16#define LLVM_MCA_VIEW_H
17
20#include "llvm/Support/JSON.h"
22
23namespace llvm {
24namespace mca {
25
26class View : public HWEventListener {
27public:
28 virtual ~View() = default;
29
30 virtual void printView(llvm::raw_ostream &OS) const = 0;
31 virtual StringRef getNameAsString() const = 0;
32
33 virtual json::Value toJSON() const { return "not implemented"; }
34 virtual bool isSerializable() const { return true; }
35
36 void anchor() override;
37};
38} // namespace mca
39} // namespace llvm
40
41#endif
This file defines the main interface for hardware event listeners.
This file supports working with JSON data.
raw_pwrite_stream & OS
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
A Value is an JSON value of unknown type.
Definition: JSON.h:288
virtual bool isSerializable() const
Definition: View.h:34
virtual StringRef getNameAsString() const =0
void anchor() override
Definition: View.cpp:21
virtual json::Value toJSON() const
Definition: View.h:33
virtual void printView(llvm::raw_ostream &OS) const =0
virtual ~View()=default
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18