LLVM  6.0.0svn
Macros | Functions
Instructions.cpp File Reference
#include "llvm/IR/Instructions.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <vector>
#include "llvm/IR/Instruction.def"
Include dependency graph for Instructions.cpp:

Go to the source code of this file.

Macros

#define HANDLE_TERM_INST(N, OPC, CLASS)
 
#define HANDLE_TERM_INST(N, OPC, CLASS)
 
#define HANDLE_TERM_INST(N, OPC, CLASS)
 

Functions

static bool IsConstantOne (Value *val)
 IsConstantOne - Return true only if val is constant int 1. More...
 
static InstructioncreateMalloc (Instruction *InsertBefore, BasicBlock *InsertAtEnd, Type *IntPtrTy, Type *AllocTy, Value *AllocSize, Value *ArraySize, ArrayRef< OperandBundleDef > OpB, Function *MallocF, const Twine &Name)
 
static InstructioncreateFree (Value *Source, ArrayRef< OperandBundleDef > Bundles, Instruction *InsertBefore, BasicBlock *InsertAtEnd)
 
static ValuegetAISize (LLVMContext &Context, Value *Amt)
 
template<typename IndexTy >
static TypegetIndexedTypeInternal (Type *Agg, ArrayRef< IndexTy > IdxList)
 getIndexedType - Returns the type of the element that would be accessed with a gep instruction with the specified parameters. More...
 
static bool isConstantAllOnes (const Value *V)
 

Macro Definition Documentation

◆ HANDLE_TERM_INST [1/3]

#define HANDLE_TERM_INST (   N,
  OPC,
  CLASS 
)
Value:
case Instruction::OPC: \
return static_cast<const CLASS *>(this)->getNumSuccessors();

◆ HANDLE_TERM_INST [2/3]

#define HANDLE_TERM_INST (   N,
  OPC,
  CLASS 
)
Value:
case Instruction::OPC: \
return static_cast<const CLASS *>(this)->getSuccessor(idx);

◆ HANDLE_TERM_INST [3/3]

#define HANDLE_TERM_INST (   N,
  OPC,
  CLASS 
)
Value:
case Instruction::OPC: \
return static_cast<CLASS *>(this)->setSuccessor(idx, B);
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")

Function Documentation

◆ createFree()

static Instruction* createFree ( Value Source,
ArrayRef< OperandBundleDef Bundles,
Instruction InsertBefore,
BasicBlock InsertAtEnd 
)
static

◆ createMalloc()

static Instruction* createMalloc ( Instruction InsertBefore,
BasicBlock InsertAtEnd,
Type IntPtrTy,
Type AllocTy,
Value AllocSize,
Value ArraySize,
ArrayRef< OperandBundleDef OpB,
Function MallocF,
const Twine Name 
)
static

◆ getAISize()

static Value* getAISize ( LLVMContext Context,
Value Amt 
)
static

◆ getIndexedTypeInternal()

template<typename IndexTy >
static Type* getIndexedTypeInternal ( Type Agg,
ArrayRef< IndexTy >  IdxList 
)
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 1631 of file Instructions.cpp.

References llvm::dyn_cast(), llvm::ArrayRef< T >::empty(), llvm::CompositeType::getTypeAtIndex(), llvm::CompositeType::indexValid(), llvm::Type::isPointerTy(), llvm::Type::isSized(), and llvm::ArrayRef< T >::size().

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

◆ isConstantAllOnes()

static bool isConstantAllOnes ( const Value V)
inlinestatic

◆ IsConstantOne()

static bool IsConstantOne ( Value val)
static

IsConstantOne - Return true only if val is constant int 1.

Definition at line 491 of file Instructions.cpp.

References assert(), llvm::dyn_cast(), and llvm::ConstantInt::isOne().

Referenced by createMalloc().