LLVM 22.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
21#include "llvm/Support/JSON.h"
23
24namespace llvm {
25namespace mca {
26
28public:
29 virtual ~View() = default;
30
31 virtual void printView(llvm::raw_ostream &OS) const = 0;
32 virtual StringRef getNameAsString() const = 0;
33
34 virtual json::Value toJSON() const { return "not implemented"; }
35 virtual bool isSerializable() const { return true; }
36
37 void anchor() override;
38};
39} // namespace mca
40} // namespace llvm
41
42#endif
#define LLVM_ABI
Definition Compiler.h:213
This file defines the main interface for hardware event listeners.
This file supports working with JSON data.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
A Value is an JSON value of unknown type.
Definition JSON.h:290
virtual bool isSerializable() const
Definition View.h:35
virtual StringRef getNameAsString() const =0
virtual json::Value toJSON() const
Definition View.h:34
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:53
This is an optimization pass for GlobalISel generic memory operations.