llvm/llvm/include/llvm/SandboxIR/Constant.h

//===- Constant.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_SANDBOXIR_CONSTANT_H
#define LLVM_SANDBOXIR_CONSTANT_H

#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalIFunc.h"
#include "llvm/IR/GlobalObject.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/SandboxIR/Argument.h"
#include "llvm/SandboxIR/BasicBlock.h"
#include "llvm/SandboxIR/Context.h"
#include "llvm/SandboxIR/Type.h"
#include "llvm/SandboxIR/User.h"

namespace llvm::sandboxir {

class BasicBlock;
class Function;

class Constant : public sandboxir::User {};

// TODO: This should inherit from ConstantData.
class ConstantInt : public Constant {};

// TODO: This should inherit from ConstantData.
class ConstantFP final : public Constant {};

/// Base class for aggregate constants (with operands).
class ConstantAggregate : public Constant {};

class ConstantArray final : public ConstantAggregate {};

class ConstantStruct final : public ConstantAggregate {};

class ConstantVector final : public ConstantAggregate {};

// TODO: Inherit from ConstantData.
class ConstantAggregateZero final : public Constant {};

// TODO: Inherit from ConstantData.
class ConstantPointerNull final : public Constant {};

// TODO: Inherit from ConstantData.
class UndefValue : public Constant {};

class PoisonValue final : public UndefValue {};

class GlobalValue : public Constant {};

class GlobalObject : public GlobalValue {};

/// Provides API functions, like getIterator() and getReverseIterator() to
/// GlobalIFunc, Function, GlobalVariable and GlobalAlias. In LLVM IR these are
/// provided by ilist_node.
template <typename GlobalT, typename LLVMGlobalT, typename ParentT,
          typename LLVMParentT>
class GlobalWithNodeAPI : public ParentT {};

class GlobalIFunc final
    : public GlobalWithNodeAPI<GlobalIFunc, llvm::GlobalIFunc, GlobalObject,
                               llvm::GlobalObject> {};

class GlobalVariable final
    : public GlobalWithNodeAPI<GlobalVariable, llvm::GlobalVariable,
                               GlobalObject, llvm::GlobalObject> {};

class GlobalAlias final
    : public GlobalWithNodeAPI<GlobalAlias, llvm::GlobalAlias, GlobalValue,
                               llvm::GlobalValue> {};

class NoCFIValue final : public Constant {};

class ConstantPtrAuth final : public Constant {};

class ConstantExpr : public Constant {};

class BlockAddress final : public Constant {};

class DSOLocalEquivalent final : public Constant {};

// TODO: This should inherit from ConstantData.
class ConstantTokenNone final : public Constant {};

} // namespace llvm::sandboxir

#endif // LLVM_SANDBOXIR_CONSTANT_H