clang 23.0.0git
FormatProviders.h
Go to the documentation of this file.
1//===- FormatProviders.h - llvm::formatv support for SSAF model types -----===//
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_ANALYSIS_SCALABLE_SUPPORT_FORMATPROVIDERS_H
15#define LLVM_CLANG_ANALYSIS_SCALABLE_SUPPORT_FORMATPROVIDERS_H
16
22#include "llvm/Support/FormatProviders.h"
23#include "llvm/Support/raw_ostream.h"
24
25namespace llvm {
26
27template <> struct format_provider<clang::ssaf::EntityId> {
28 static void format(const clang::ssaf::EntityId &Val, raw_ostream &OS,
29 StringRef Style) {
30 OS << Val;
31 }
32};
33
34template <> struct format_provider<clang::ssaf::EntityLinkage> {
35 static void format(clang::ssaf::EntityLinkage Val, raw_ostream &OS,
36 StringRef Style) {
37 OS << Val;
38 }
39};
40
41template <> struct format_provider<clang::ssaf::BuildNamespace> {
42 static void format(const clang::ssaf::BuildNamespace &Val, raw_ostream &OS,
43 StringRef Style) {
44 OS << Val;
45 }
46};
47
48template <> struct format_provider<clang::ssaf::NestedBuildNamespace> {
50 raw_ostream &OS, StringRef Style) {
51 OS << Val;
52 }
53};
54
55template <> struct format_provider<clang::ssaf::EntityName> {
56 static void format(const clang::ssaf::EntityName &Val, raw_ostream &OS,
57 StringRef Style) {
58 OS << Val;
59 }
60};
61
62template <> struct format_provider<clang::ssaf::SummaryName> {
63 static void format(const clang::ssaf::SummaryName &Val, raw_ostream &OS,
64 StringRef Style) {
65 OS << Val;
66 }
67};
68
69} // namespace llvm
70
71#endif // LLVM_CLANG_ANALYSIS_SCALABLE_SUPPORT_FORMATPROVIDERS_H
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::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::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)