LLVM API Documentation

Constants.cpp File Reference

#include "llvm/Constants.h"
#include "ConstantFolding.h"
#include "llvm/DerivedTypes.h"
#include "llvm/GlobalValue.h"
#include "llvm/Instructions.h"
#include "llvm/SymbolTable.h"
#include "llvm/Module.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <iostream>

Include dependency graph for Constants.cpp:

Go to the source code of this file.

Namespaces

namespace  llvm

Classes

class  UnaryConstantExpr
class  BinaryConstantExpr
class  SelectConstantExpr
class  ExtractElementConstantExpr
class  InsertElementConstantExpr
class  ShuffleVectorConstantExpr
struct  GetElementPtrConstantExpr
struct  llvm::ConstantCreator< ConstantClass, TypeClass, ValType >
struct  llvm::ConvertConstantType< ConstantClass, TypeClass >
struct  llvm::ConstantCreator< ConstantFP, Type, uint64_t >
struct  llvm::ConstantCreator< ConstantFP, Type, uint32_t >
struct  llvm::ConstantCreator< ConstantAggregateZero, Type, ValType >
struct  llvm::ConvertConstantType< ConstantAggregateZero, Type >
struct  llvm::ConvertConstantType< ConstantArray, ArrayType >
struct  llvm::ConvertConstantType< ConstantStruct, StructType >
struct  llvm::ConvertConstantType< ConstantPacked, PackedType >
struct  llvm::ConstantCreator< ConstantPointerNull, PointerType, ValType >
struct  llvm::ConvertConstantType< ConstantPointerNull, PointerType >
struct  llvm::ConstantCreator< UndefValue, Type, ValType >
struct  llvm::ConvertConstantType< UndefValue, Type >
struct  llvm::ConstantCreator< ConstantExpr, Type, ExprMapKeyType >
struct  llvm::ConvertConstantType< ConstantExpr, Type >

Typedefs

typedef std::pair< const TypeClass *,
ValType > 
MapKey
typedef std::map< MapKey,
ConstantClass * > 
MapTy
typedef MapTy::iterator MapIterator
typedef std::map< const TypeClass *,
MapIterator
AbstractTypeMapTy
typedef ValueMap< std::vector<
Constant * >, ArrayType,
ConstantArray, true > 
ArrayConstantsTy
typedef ValueMap< std::vector<
Constant * >, StructType,
ConstantStruct, true > 
StructConstantsTy
typedef std::pair< unsigned,
std::vector< Constant * > > 
ExprMapKeyType

Functions

static bool isSetCC (unsigned Opcode)
static char getValType (ConstantAggregateZero *CPZ)
static std::vector< Constant * > getValType (ConstantArray *CA)
static std::vector< Constant * > getValType (ConstantStruct *CS)
static std::vector< Constant * > getValType (ConstantPacked *CP)
static char getValType (ConstantPointerNull *)
static char getValType (UndefValue *)
static ExprMapKeyType getValType (ConstantExpr *CE)

Variables

MapTy Map
std::map< ConstantClass *,
MapIterator
InverseMap
AbstractTypeMapTy AbstractTypeMap
static ValueMap< int64_t,
Type, ConstantSInt
SIntConstants
static ValueMap< uint64_t,
Type, ConstantUInt
UIntConstants
static ValueMap< uint64_t,
Type, ConstantFP
DoubleConstants
static ValueMap< uint32_t,
Type, ConstantFP
FloatConstants
static ValueMap< char, Type,
ConstantAggregateZero
AggZeroConstants
static ArrayConstantsTy ArrayConstants
static StructConstantsTy StructConstants
static ValueMap< std::vector<
Constant * >, PackedType,
ConstantPacked
PackedConstants
static ValueMap< char, PointerType,
ConstantPointerNull
NullPtrConstants
static ValueMap< char, Type,
UndefValue
UndefValueConstants
static ValueMap< ExprMapKeyType,
Type, ConstantExpr
ExprConstants


Typedef Documentation

typedef std::map<const TypeClass*, MapIterator> AbstractTypeMapTy

Definition at line 579 of file Constants.cpp.

typedef ValueMap<std::vector<Constant*>, ArrayType, ConstantArray, true > ArrayConstantsTy

Definition at line 903 of file Constants.cpp.

typedef std::pair<unsigned, std::vector<Constant*> > ExprMapKeyType

Definition at line 1174 of file Constants.cpp.

typedef MapTy::iterator MapIterator

Definition at line 566 of file Constants.cpp.

typedef std::pair<const TypeClass*, ValType> MapKey

Definition at line 564 of file Constants.cpp.

typedef std::map<MapKey, ConstantClass *> MapTy

Definition at line 565 of file Constants.cpp.

typedef ValueMap<std::vector<Constant*>, StructType, ConstantStruct, true > StructConstantsTy

Definition at line 993 of file Constants.cpp.


Function Documentation

static ExprMapKeyType getValType ( ConstantExpr CE  )  [static]

Definition at line 1243 of file Constants.cpp.

References llvm::User::getNumOperands(), llvm::ConstantExpr::getOpcode(), and llvm::ConstantExpr::getOperand().

static char getValType ( UndefValue  )  [static]

Definition at line 1153 of file Constants.cpp.

static char getValType ( ConstantPointerNull  )  [static]

Definition at line 1110 of file Constants.cpp.

static std::vector<Constant*> getValType ( ConstantPacked CP  )  [static]

Definition at line 1047 of file Constants.cpp.

References CP, llvm::User::getNumOperands(), and llvm::Constant::getOperand().

static std::vector<Constant*> getValType ( ConstantStruct CS  )  [static]

Definition at line 996 of file Constants.cpp.

References llvm::User::getNumOperands(), and llvm::Constant::getOperand().

static std::vector<Constant*> getValType ( ConstantArray CA  )  [static]

Definition at line 894 of file Constants.cpp.

References llvm::User::getNumOperands(), and llvm::Constant::getOperand().

static char getValType ( ConstantAggregateZero CPZ  )  [static]

Definition at line 863 of file Constants.cpp.

static bool isSetCC ( unsigned  Opcode  )  [static]

Definition at line 318 of file Constants.cpp.


Variable Documentation

AbstractTypeMapTy AbstractTypeMap

Definition at line 580 of file Constants.cpp.

ValueMap<char, Type, ConstantAggregateZero> AggZeroConstants [static]

Definition at line 861 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), llvm::ConstantAggregateZero::destroyConstant(), and llvm::ConstantAggregateZero::get().

ArrayConstantsTy ArrayConstants [static]

Definition at line 904 of file Constants.cpp.

ValueMap<uint64_t, Type, ConstantFP> DoubleConstants [static]

Definition at line 816 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), and llvm::ConstantFP::get().

ValueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants [static]

Definition at line 1251 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), llvm::ConstantExpr::destroyConstant(), llvm::ConstantExpr::getCast(), llvm::ConstantExpr::getExtractElementTy(), llvm::ConstantExpr::getGetElementPtrTy(), llvm::ConstantExpr::getInsertElementTy(), llvm::ConstantExpr::getSelectTy(), llvm::ConstantExpr::getShiftTy(), llvm::ConstantExpr::getShuffleVectorTy(), and llvm::ConstantExpr::getTy().

ValueMap<uint32_t, Type, ConstantFP> FloatConstants [static]

Definition at line 817 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), and llvm::ConstantFP::get().

std::map<ConstantClass*, MapIterator> InverseMap

InverseMap - If "HasLargeKey" is true, this contains an inverse mapping from the constants to their element in Map. This is important for removal of constants from the array, which would otherwise have to scan through the map with very large keys.

Definition at line 577 of file Constants.cpp.

MapTy Map

Map - This is the main map from the element descriptor to the Constants. This is the primary way we avoid creating two of the same shape constant.

Definition at line 571 of file Constants.cpp.

ValueMap<char, PointerType, ConstantPointerNull> NullPtrConstants [static]

Definition at line 1108 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), llvm::ConstantPointerNull::destroyConstant(), and llvm::ConstantPointerNull::get().

ValueMap<std::vector<Constant*>, PackedType, ConstantPacked> PackedConstants [static]

Definition at line 1056 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), llvm::ConstantPacked::destroyConstant(), and llvm::ConstantPacked::get().

ValueMap< int64_t, Type, ConstantSInt> SIntConstants [static]

Definition at line 780 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), and llvm::ConstantSInt::get().

StructConstantsTy StructConstants [static]

Definition at line 994 of file Constants.cpp.

ValueMap<uint64_t, Type, ConstantUInt> UIntConstants [static]

Definition at line 781 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), and llvm::ConstantUInt::get().

ValueMap<char, Type, UndefValue> UndefValueConstants [static]

Definition at line 1151 of file Constants.cpp.

Referenced by llvm::Constant::clearAllValueMaps(), llvm::UndefValue::destroyConstant(), and llvm::UndefValue::get().