LLVM 23.0.0git
NullPass.h
Go to the documentation of this file.
1//===- NullPass.h -----------------------------------------------*- C++ -*-===//
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// A null region pass that does nothing. Used for testing.
10//
11
12#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_NULLPASS_H
13#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_NULLPASS_H
14
15#include "llvm/SandboxIR/Pass.h"
16
17namespace llvm::sandboxir {
18
19class Region;
20
21/// A Region pass that does nothing, for use as a placeholder in tests.
22/// It can also echo the AuxArg passed to it by the pass builder, which is used
23/// for AuxArg testing.
24class NullPass final : public RegionPass {
25 StringRef AuxArg;
26
27public:
28 NullPass(StringRef AuxArg) : RegionPass("null"), AuxArg(AuxArg) {}
29 bool runOnRegion(Region &R, const Analyses &A) final { return false; }
30 StringRef getAuxArg() const { return AuxArg; }
31};
32
33} // namespace llvm::sandboxir
34
35#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_NULLPASS_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
Definition NullPass.h:29
StringRef getAuxArg() const
Definition NullPass.h:30
NullPass(StringRef AuxArg)
Definition NullPass.h:28
RegionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:87