llvm/llvm/include/llvm/IR/Value.h

//===- llvm/Value.h - Definition of the Value class -------------*- 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
//
//===----------------------------------------------------------------------===//
//
// This file declares the Value class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_IR_VALUE_H
#define LLVM_IR_VALUE_H

#include "llvm-c/Types.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/IR/Use.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/CBindingWrapping.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <iterator>
#include <memory>

namespace llvm {

class APInt;
class Argument;
class BasicBlock;
class Constant;
class ConstantData;
class ConstantAggregate;
class DataLayout;
class Function;
class GlobalAlias;
class GlobalIFunc;
class GlobalObject;
class GlobalValue;
class GlobalVariable;
class InlineAsm;
class Instruction;
class LLVMContext;
class MDNode;
class Module;
class ModuleSlotTracker;
class raw_ostream;
template<typename ValueTy> class StringMapEntry;
class Twine;
class Type;
class User;

ValueName;

//===----------------------------------------------------------------------===//
//                                 Value Class
//===----------------------------------------------------------------------===//

/// LLVM Value Representation
///
/// This is a very important LLVM class. It is the base class of all values
/// computed by a program that may be used as operands to other values. Value is
/// the super class of other important classes such as Instruction and Function.
/// All Values have a Type. Type is not a subclass of Value. Some values can
/// have a name and they belong to some Module.  Setting the name on the Value
/// automatically updates the module's symbol table.
///
/// Every value has a "use list" that keeps track of which other Values are
/// using this Value.  A Value can also have an arbitrary number of ValueHandle
/// objects that watch it and listen to RAUW and Destroy events.  See
/// llvm/IR/ValueHandle.h for details.
class Value {};

struct ValueDeleter {};

/// Use this instead of std::unique_ptr<Value> or std::unique_ptr<Instruction>.
/// Those don't work because Value and Instruction's destructors are protected,
/// aren't virtual, and won't destroy the complete object.
unique_value;

inline raw_ostream &operator<<(raw_ostream &OS, const Value &V) {}

void Use::set(Value *V) {}

Value *Use::operator=(Value *RHS) {}

const Use &Use::operator=(const Use &RHS) {}

template <class Compare> void Value::sortUseList(Compare Cmp) {}

// isa - Provide some specializations of isa so that we don't have to include
// the subtype header files to test to see if the value is a subclass...
//
template <> struct isa_impl<Constant, Value> {};

template <> struct isa_impl<ConstantData, Value> {};

template <> struct isa_impl<ConstantAggregate, Value> {};

template <> struct isa_impl<Argument, Value> {};

template <> struct isa_impl<InlineAsm, Value> {};

template <> struct isa_impl<Instruction, Value> {};

template <> struct isa_impl<BasicBlock, Value> {};

template <> struct isa_impl<Function, Value> {};

template <> struct isa_impl<GlobalVariable, Value> {};

template <> struct isa_impl<GlobalAlias, Value> {};

template <> struct isa_impl<GlobalIFunc, Value> {};

template <> struct isa_impl<GlobalValue, Value> {};

template <> struct isa_impl<GlobalObject, Value> {};

// Create wrappers for C Binding types (see CBindingWrapping.h).
DEFINE_ISA_CONVERSION_FUNCTIONS()

// Specialized opaque value conversions.
inline Value **unwrap(LLVMValueRef *Vals) {}

template<typename T>
inline T **unwrap(LLVMValueRef *Vals, unsigned Length) {}

inline LLVMValueRef *wrap(const Value **Vals) {}

} // end namespace llvm

#endif // LLVM_IR_VALUE_H