LLVM 22.0.0git
PrintRegion.h
Go to the documentation of this file.
1#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTREGION_H
2#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTREGION_H
3
6
7namespace llvm::sandboxir {
8
9/// A Region pass that does nothing, for use as a placeholder in tests.
10class PrintRegion final : public RegionPass {
11public:
12 PrintRegion() : RegionPass("print-region") {}
13 bool runOnRegion(Region &R, const Analyses &A) final {
14 raw_ostream &OS = outs();
15#ifndef NDEBUG
16 OS << "-- Region --\n";
17 OS << R << "\n";
18#else
19 // TODO: Make this available in all builds, depends on enabling SandboxIR
20 // dumps in non-debug builds.
21 OS << "Region dump only available in DEBUG build!";
22#endif
23 return false;
24 }
25};
26
27} // namespace llvm::sandboxir
28
29#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTREGION_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
raw_pwrite_stream & OS
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
A Region pass that does nothing, for use as a placeholder in tests.
Definition: PrintRegion.h:10
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
Definition: PrintRegion.h:13
A pass that runs on a sandbox::Region.
Definition: Pass.h:84
The main job of the Region is to point to new instructions generated by vectorization passes.
Definition: Region.h:96
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.