clang 23.0.0git
FormatProviders.h
Go to the documentation of this file.
1//===- FormatProviders.h - llvm::formatv support for SSAF types -*- 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//
9// This file provides llvm::format_provider specialisations for SSAF model
10// types, enabling them to be used directly with llvm::formatv and ErrorBuilder.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_SUPPORT_FORMATPROVIDERS_H
15#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_SUPPORT_FORMATPROVIDERS_H
16
23#include "llvm/Support/FormatProviders.h"
24#include "llvm/Support/raw_ostream.h"
25
26namespace llvm {
27
28template <> struct format_provider<clang::ssaf::EntityId> {
29 static void format(const clang::ssaf::EntityId &Val, raw_ostream &OS,
30 StringRef Style) {
31 OS << Val;
32 }
33};
34
35template <> struct format_provider<clang::ssaf::EntityLinkageType> {
36 static void format(clang::ssaf::EntityLinkageType Val, raw_ostream &OS,
37 StringRef Style) {
38 OS << Val;
39 }
40};
41
42template <> struct format_provider<clang::ssaf::EntityLinkage> {
43 static void format(clang::ssaf::EntityLinkage Val, raw_ostream &OS,
44 StringRef Style) {
45 OS << Val;
46 }
47};
48
49template <> struct format_provider<clang::ssaf::BuildNamespaceKind> {
50 static void format(clang::ssaf::BuildNamespaceKind Val, raw_ostream &OS,
51 StringRef Style) {
52 OS << Val;
53 }
54};
55
56template <> struct format_provider<clang::ssaf::BuildNamespace> {
57 static void format(const clang::ssaf::BuildNamespace &Val, raw_ostream &OS,
58 StringRef Style) {
59 OS << Val;
60 }
61};
62
63template <> struct format_provider<clang::ssaf::NestedBuildNamespace> {
65 raw_ostream &OS, StringRef Style) {
66 OS << Val;
67 }
68};
69
70template <> struct format_provider<clang::ssaf::EntityName> {
71 static void format(const clang::ssaf::EntityName &Val, raw_ostream &OS,
72 StringRef Style) {
73 OS << Val;
74 }
75};
76
77template <> struct format_provider<clang::ssaf::SummaryName> {
78 static void format(const clang::ssaf::SummaryName &Val, raw_ostream &OS,
79 StringRef Style) {
80 OS << Val;
81 }
82};
83
84template <> struct format_provider<clang::ssaf::AnalysisName> {
85 static void format(const clang::ssaf::AnalysisName &Val, raw_ostream &OS,
86 StringRef Style) {
87 OS << Val;
88 }
89};
90
91} // namespace llvm
92
93#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_SUPPORT_FORMATPROVIDERS_H
Uniquely identifies a whole-program analysis and the AnalysisResult it produces.
Represents a single namespace in the build process.
Lightweight opaque handle representing an entity in an EntityIdTable.
Definition EntityId.h:31
Represents the linkage properties of an entity in the program model.
Uniquely identifies an entity in a program.
Definition EntityName.h:28
Represents a hierarchical sequence of build namespaces.
Uniquely identifies an analysis summary.
Definition SummaryName.h:22
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
static void format(const clang::ssaf::AnalysisName &Val, raw_ostream &OS, StringRef Style)
static void format(clang::ssaf::BuildNamespaceKind Val, raw_ostream &OS, StringRef Style)
static void format(const clang::ssaf::BuildNamespace &Val, raw_ostream &OS, StringRef Style)
static void format(const clang::ssaf::EntityId &Val, raw_ostream &OS, StringRef Style)
static void format(clang::ssaf::EntityLinkageType Val, raw_ostream &OS, StringRef Style)
static void format(clang::ssaf::EntityLinkage Val, raw_ostream &OS, StringRef Style)
static void format(const clang::ssaf::EntityName &Val, raw_ostream &OS, StringRef Style)
static void format(const clang::ssaf::NestedBuildNamespace &Val, raw_ostream &OS, StringRef Style)
static void format(const clang::ssaf::SummaryName &Val, raw_ostream &OS, StringRef Style)