LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::ConstantArray Class Reference

#include <Constants.h>

Inheritance diagram for llvm::ConstantArray:
Inheritance graph
Collaboration diagram for llvm::ConstantArray:
Collaboration graph

List of all members.

Public Member Functions

 Transparently provide more efficient getOperand methods.
ArrayTypegetType () const
void destroyConstant () override
void replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) override

Static Public Member Functions

static Constantget (ArrayType *T, ArrayRef< Constant * > V)
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

 ConstantArray (ArrayType *T, ArrayRef< Constant * > Val)


struct ConstantArrayCreator< ConstantArray, ArrayType >

Detailed Description

ConstantArray - Constant Array Declarations

Definition at line 340 of file Constants.h.

Constructor & Destructor Documentation

ConstantArray::ConstantArray ( ArrayType T,
ArrayRef< Constant * >  Val 
) [protected]

Member Function Documentation

static bool llvm::ConstantArray::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::Constant.

Definition at line 363 of file Constants.h.

References llvm::Value::ConstantArrayVal, and llvm::Value::getValueID().

Transparently provide more efficient getOperand methods.

void ConstantArray::destroyConstant ( ) [override, virtual]
Constant * ConstantArray::get ( ArrayType T,
ArrayRef< Constant * >  V 
) [static]

getType - Specialize the getType() method to always return an ArrayType, which reduces the amount of casting needed in parts of the compiler.

Reimplemented from llvm::Value.

Definition at line 355 of file Constants.h.

Referenced by ConstantArray(), destroyConstant(), emitGlobalConstantArray(), get(), and replaceUsesOfWithOnConstant().

void ConstantArray::replaceUsesOfWithOnConstant ( Value From,
Value To,
Use U 
) [override, virtual]

replaceUsesOfWithOnConstant - Update this constant array to change uses of 'From' to be uses of 'To'. This must update the uniquing data structures etc.

Note that we intentionally replace all uses of From with To here. Consider a large array that uses 'From' 1000 times. By handling this case all here, ConstantArray::replaceUsesOfWithOnConstant is only invoked once, and that single invocation handles all 1000 uses. Handling them one at a time would work, but would be really slow because it would have to unique each updated array instance.

Reimplemented from llvm::Constant.

Definition at line 2585 of file Constants.cpp.

References destroyConstant(), get(), llvm::Type::getContext(), llvm::User::getNumOperands(), llvm::User::getOperand(), getType(), I, llvm::Constant::isNullValue(), Lookup(), llvm::makeArrayRef(), llvm::User::OperandList, llvm::LLVMContext::pImpl, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorImpl< T >::reserve(), and llvm::User::setOperand().

Friends And Related Function Documentation

friend struct ConstantArrayCreator< ConstantArray, ArrayType > [friend]

Definition at line 341 of file Constants.h.

The documentation for this class was generated from the following files: