LLVM: include/llvm/Support/VirtualOutputConfig.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_SUPPORT_VIRTUALOUTPUTCONFIG_H
15#define LLVM_SUPPORT_VIRTUALOUTPUTCONFIG_H
16
18
19namespace llvm {
20
22
25}
26
27namespace vfs {
28
30
31
33}
34
35
36
38public:
40 void dump() const;
41
42#define HANDLE_OUTPUT_CONFIG_FLAG(NAME, DEFAULT) \
43 constexpr bool get##NAME() const { return NAME; } \
44 constexpr bool getNo##NAME() const { return !NAME; } \
45 constexpr OutputConfig &set##NAME(bool Value) { \
46 NAME = Value; \
47 return *this; \
48 } \
49 constexpr OutputConfig &set##NAME() { return set##NAME(true); } \
50 constexpr OutputConfig &setNo##NAME() { return set##NAME(false); }
51#include "llvm/Support/VirtualOutputConfig.def"
52
58 constexpr bool getTextWithCRLF() const { return getText() && getCRLF(); }
59 constexpr bool getBinary() const { return !getText(); }
60
61
62
63
65
67 : EmptyBaseClass()
69#include "llvm/Support/VirtualOutputConfig.def"
70 {
71 }
72
74#define HANDLE_OUTPUT_CONFIG_FLAG(NAME, DEFAULT) \
75 if (NAME != RHS.NAME) \
76 return false;
77#include "llvm/Support/VirtualOutputConfig.def"
78 return true;
79 }
81
82private:
83#define HANDLE_OUTPUT_CONFIG_FLAG(NAME, DEFAULT) bool NAME : 1;
84#include "llvm/Support/VirtualOutputConfig.def"
85};
86
87}
88
90 vfs::OutputConfig Config);
91
92}
93
94#endif
@ DEFAULT
Default weight is used in cases when there is no dedicated execution weight set.
#define LLVM_ABI_FOR_TEST
#define HANDLE_OUTPUT_CONFIG_FLAG(NAME, DEFAULT)
Definition VirtualOutputConfig.h:42
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Full configuration for an output for use by the OutputBackend.
Definition VirtualOutputConfig.h:37
bool operator==(OutputConfig RHS) const
Definition VirtualOutputConfig.h:73
constexpr bool getTextWithCRLF() const
Definition VirtualOutputConfig.h:58
constexpr OutputConfig & setBinary()
Definition VirtualOutputConfig.h:53
constexpr OutputConfig()
Definition VirtualOutputConfig.h:66
LLVM_ABI_FOR_TEST void print(raw_ostream &OS) const
constexpr OutputConfig & setTextWithCRLF(bool Value)
Definition VirtualOutputConfig.h:55
LLVM_ABI_FOR_TEST OutputConfig & setOpenFlags(const sys::fs::OpenFlags &Flags)
Updates Text and CRLF flags based on sys::fs::OF_Text and sys::fs::OF_CRLF in Flags.
constexpr bool getBinary() const
Definition VirtualOutputConfig.h:59
constexpr OutputConfig & setTextWithCRLF()
Definition VirtualOutputConfig.h:54
bool operator!=(OutputConfig RHS) const
Definition VirtualOutputConfig.h:80
Unused and empty base class to allow OutputConfig constructor to be constexpr, with commas before eve...
Definition VirtualOutputConfig.h:32