LLVM API Documentation

Instructions.cpp File Reference

#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Operator.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ConstantRange.h"
#include "llvm/Support/MathExtras.h"

Include dependency graph for Instructions.cpp:

Go to the source code of this file.

Defines

#define CALLSITE_DELEGATE_GETTER(METHOD)
#define CALLSITE_DELEGATE_SETTER(METHOD)

Functions

static Value * getAISize (LLVMContext &Context, Value *Amt)
static unsigned retrieveAddrSpace (const Value *Val)
template<typename IndexTy>
static const Type * getIndexedTypeInternal (const Type *Ptr, IndexTy const *Idxs, unsigned NumIdx)
static BinaryOperator::BinaryOps AdjustIType (BinaryOperator::BinaryOps iType, const Type *Ty)
static bool isConstantAllOnes (const Value *V)


Define Documentation

#define CALLSITE_DELEGATE_GETTER ( METHOD   ) 

#define CALLSITE_DELEGATE_SETTER ( METHOD   ) 

Value:

Instruction *II(getInstruction());     \
  if (isCall())                          \
    cast<CallInst>(II)->METHOD;          \
  else                                   \
    cast<InvokeInst>(II)->METHOD

Definition at line 36 of file Instructions.cpp.

Referenced by llvm::CallSite::setAttributes(), llvm::CallSite::setCallingConv(), llvm::CallSite::setDoesNotAccessMemory(), llvm::CallSite::setDoesNotReturn(), llvm::CallSite::setDoesNotThrow(), and llvm::CallSite::setOnlyReadsMemory().


Function Documentation

static BinaryOperator::BinaryOps AdjustIType ( BinaryOperator::BinaryOps  iType,
const Type *  Ty 
) [static]

AdjustIType - Map Add, Sub, and Mul to FAdd, FSub, and FMul when the type is floating-point, to help provide compatibility with an older API.

Definition at line 1434 of file Instructions.cpp.

References llvm::Type::isFPOrFPVector().

Referenced by llvm::BinaryOperator::BinaryOperator().

static Value* getAISize ( LLVMContext &  Context,
Value *  Amt 
) [static]

template<typename IndexTy>
static const Type* getIndexedTypeInternal ( const Type *  Ptr,
IndexTy const *  Idxs,
unsigned  NumIdx 
) [inline, static]

getIndexedType - Returns the type of the element that would be accessed with a gep instruction with the specified parameters.

The Idxs pointer should point to a continuous piece of memory containing the indices, either as Value* or uint64_t.

A null type is returned if the indices are invalid for the specified pointer type.

Definition at line 1078 of file Instructions.cpp.

References llvm::dyn_cast(), llvm::SequentialType::getElementType(), llvm::Type::getForwardedType(), llvm::CompositeType::getTypeAtIndex(), Index, llvm::CompositeType::indexValid(), llvm::Type::isAbstract(), llvm::Type::isSized(), and Ty.

Referenced by llvm::GetElementPtrInst::getIndexedType().

static bool isConstantAllOnes ( const Value *  V  )  [inline, static]

static unsigned retrieveAddrSpace ( const Value *  Val  )  [static]

Definition at line 1010 of file Instructions.cpp.

References llvm::Value::getType().