[llvm] [SandboxVec] Implement Pass class (PR #107617)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 11:01:11 PDT 2024
================
@@ -0,0 +1,83 @@
+//===- Pass.h ---------------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASS_H
+#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASS_H
+
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/raw_ostream.h"
+#include <string>
+
+namespace llvm::sandboxir {
+
+class Function;
+
+/// The base class of a Sandbox IR Pass.
+class Pass {
+public:
+ enum class ClassID : unsigned {
+ FunctionPass,
+ };
+ static const char *getSubclassIDStr(ClassID ID) {
+ switch (ID) {
+ case ClassID::FunctionPass:
+ return "FunctionPass";
+ }
+ llvm_unreachable("Unimplemented ID");
+ }
+
+protected:
+ /// The pass name.
+ const std::string Name;
+ /// The command-line flag used to specify that this pass should run.
+ const std::string Flag;
+ /// Used for isa/cast/dyn_cast.
+ ClassID SubclassID;
+
+public:
+ Pass(const std::string &Name, const std::string &Flag, ClassID SubclassID)
----------------
vporpo wrote:
Done.
https://github.com/llvm/llvm-project/pull/107617
More information about the llvm-commits
mailing list