LLVM 23.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(StringRef AuxArg) : RegionPass("print-region") {
13 assert(AuxArg.empty() && "This pass ignores aux arg!");
14 }
15 bool runOnRegion(Region &R, const Analyses &A) final {
16 raw_ostream &OS = outs();
17#ifndef NDEBUG
18 OS << "-- Region --\n";
19 OS << R << "\n";
20#else
21 // TODO: Make this available in all builds, depends on enabling SandboxIR
22 // dumps in non-debug builds.
23 OS << "Region dump only available in DEBUG build!";
24#endif
25 return false;
26 }
27};
28
29} // namespace llvm::sandboxir
30
31#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTREGION_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
Definition PrintRegion.h:15
PrintRegion(StringRef AuxArg)
Definition PrintRegion.h:12
RegionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:87
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.