Loading [MathJax]/extensions/tex2jax.js
CIRCT
21.0.0git
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
i
k
l
m
n
o
r
s
t
u
v
w
Typedefs
a
b
c
d
e
f
g
h
i
m
o
p
r
s
t
u
w
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
Enumerations
Enumerator
a
b
c
d
f
i
m
n
o
p
r
s
t
u
v
w
x
z
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Variables
c
e
g
i
l
m
n
p
r
s
t
w
Typedefs
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
u
v
Enumerations
Enumerator
a
c
d
f
h
i
n
o
r
Macros
a
c
d
e
g
h
i
r
s
t
v
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
lib
Support
PrettyPrinterHelpers.cpp
Go to the documentation of this file.
1
//===- PrettyPrinterHelpers.cpp - Pretty printing helpers -----------------===//
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
// Helper classes for using PrettyPrinter.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "
circt/Support/PrettyPrinterHelpers.h
"
14
15
#include "llvm/ADT/SmallString.h"
16
#include "llvm/Support/raw_ostream.h"
17
#include <array>
18
19
namespace
circt
{
20
namespace
pretty {
21
22
//===----------------------------------------------------------------------===//
23
// Convenience builders.
24
//===----------------------------------------------------------------------===//
25
26
void
TokenStringSaver::clear
() {
alloc
.Reset(); }
27
28
/// Add multiple non-breaking spaces as a single token.
29
void
detail::emitNBSP
(
unsigned
n, llvm::function_ref<
void
(
Token
)> add) {
30
static
const
std::array<char, 128> spaces = ([]()
constexpr
{
31
std::array<char, 128> s = {};
32
for
(
auto
&c : s)
33
c =
' '
;
34
return
s;
35
})();
36
37
const
auto
size = spaces.size();
38
if
(n <= size) {
39
if
(n != 0)
40
add(
StringToken
({spaces.data(), n}));
41
return
;
42
}
43
while
(n) {
44
auto
chunk = std::min<uint32_t>(n, size);
45
add(
StringToken
({spaces.data(), chunk}));
46
n -= chunk;
47
}
48
}
29
void
detail::emitNBSP
(
unsigned
n, llvm::function_ref<
void
(
Token
)> add) {
…
}
49
50
}
// end namespace pretty
51
}
// end namespace circt
PrettyPrinterHelpers.h
circt::pretty::TokenStringSaver::clear
void clear() override
PrettyPrinter::Listener::clear – indicates no external refs.
Definition
PrettyPrinterHelpers.cpp:26
circt::pretty::TokenStringSaver::alloc
llvm::BumpPtrAllocator alloc
Definition
PrettyPrinterHelpers.h:157
circt::pretty::Token
Definition
PrettyPrinter.h:51
circt::pretty::detail::emitNBSP
void emitNBSP(unsigned n, llvm::function_ref< void(Token)> add)
Add multiple non-breaking spaces as a single token.
Definition
PrettyPrinterHelpers.cpp:29
circt
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition
DebugAnalysis.h:21
circt::pretty::StringToken
Token types.
Definition
PrettyPrinter.h:138
Generated on Sat May 10 2025 00:08:41 for CIRCT by
1.9.8