[llvm] [SandboxIR][NFC] Create a DEF_CONST() macro in SandboxIRValues.def (PR #106269)
Sriraman Tallam via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 13:37:12 PDT 2024
================
@@ -529,9 +534,15 @@ class Constant : public sandboxir::User {
public:
/// For isa/dyn_cast.
static bool classof(const sandboxir::Value *From) {
- return From->getSubclassID() == ClassID::Constant ||
- From->getSubclassID() == ClassID::ConstantInt ||
- From->getSubclassID() == ClassID::Function;
+ switch (From->getSubclassID()) {
+#define DEF_CONST(ID, CLASS) case ClassID::ID:
+#include "llvm/SandboxIR/SandboxIRValues.def"
+ return true;
+ case ClassID::Function:
----------------
tmsri wrote:
DEF_CONST(Function, Function) instead?
https://github.com/llvm/llvm-project/pull/106269
More information about the llvm-commits
mailing list