LLVM  mainline
Defines | Functions
Constants.cpp File Reference
#include "llvm/IR/Constants.h"
#include "ConstantFold.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cstdarg>
#include "llvm/IR/Value.def"
Include dependency graph for Constants.cpp:

Go to the source code of this file.




static bool canTrapImpl (const Constant *C, SmallPtrSetImpl< const ConstantExpr * > &NonTrappingOps)
static bool ConstHasGlobalValuePredicate (const Constant *C, bool(*Predicate)(const GlobalValue *))
 Check if C contains a GlobalValue for which Predicate is true.
static bool removeDeadUsersOfConstant (const Constant *C)
 removeDeadUsersOfConstant - If the specified constantexpr is dead, remove it.
static const fltSemanticsTypeToFloatSemantics (Type *Ty)
template<typename ItTy , typename EltTy >
static bool rangeOnlyContains (ItTy Start, ItTy End, EltTy Elt)
static ConstantgetFoldedCast (Instruction::CastOps opc, Constant *C, Type *Ty, bool OnlyIfReduced=false)
 This is a utility function to handle folding of casts and lookup of the cast in the ExprConstants map.
static bool isAllZeros (StringRef Arr)
 isAllZeros - return true if the array is empty or all zeros.

Define Documentation

#define HANDLE_CONSTANT (   Name)
case Value::Name##Val:                                                       \
    cast<Name>(this)->destroyConstantImpl();                                   \

Function Documentation

static bool canTrapImpl ( const Constant C,
SmallPtrSetImpl< const ConstantExpr * > &  NonTrappingOps 
) [static]
static bool ConstHasGlobalValuePredicate ( const Constant C,
bool(*)(const GlobalValue *)  Predicate 
) [static]
static Constant* getFoldedCast ( Instruction::CastOps  opc,
Constant C,
Type Ty,
bool  OnlyIfReduced = false 
) [static]
static bool isAllZeros ( StringRef  Arr) [static]

isAllZeros - return true if the array is empty or all zeros.

Definition at line 2467 of file Constants.cpp.

References llvm::StringRef::begin(), llvm::StringRef::end(), and I.

Referenced by llvm::ConstantDataSequential::getImpl(), and llvm::ConstantStruct::replaceUsesOfWithOnConstant().

template<typename ItTy , typename EltTy >
static bool rangeOnlyContains ( ItTy  Start,
ItTy  End,
EltTy  Elt 
) [static]

Definition at line 854 of file Constants.cpp.

static bool removeDeadUsersOfConstant ( const Constant C) [static]

removeDeadUsersOfConstant - If the specified constantexpr is dead, remove it.

This involves recursively eliminating any dead users of the constantexpr.

Definition at line 468 of file Constants.cpp.

References llvm::C, llvm::dyn_cast(), llvm::Value::use_empty(), and llvm::Value::user_back().

Referenced by llvm::Constant::removeDeadConstantUsers().

static const fltSemantics* TypeToFloatSemantics ( Type Ty) [static]