Spatial
Simple Static Analysis in LLVM
Public Member Functions | Friends | List of all members
spatial::Token Class Reference

#include <Token.h>

Public Member Functions

void setIndex (llvm::GetElementPtrInst *GEPInst)
 setIndex - For a GEP Instruction find the offset and store it More...
 
void setIndex (llvm::GEPOperator *GEPOp)
 setIndex - For a GEP Operator find the offset and store it More...
 
void setIndex (Token *, std::string)
 
void setIndex (Token *)
 setIndex - For a Token More...
 
void resetIndex ()
 resetIndex - Resets the index back to an empty string More...
 
void resetIndexToZero ()
 resetIndexToZero - Resets the index to string zero for bitcast instr More...
 
void resetIndexToZero (std::string)
 resetIndexToZero - Resets the index to string zero for nested bitcast instr More...
 
std::string getIndex (llvm::GEPOperator *GEPOp)
 getIndex - For a GEP Operator find the offset More...
 
 Token (llvm::Value *Val, std::string Index="")
 
 Token (llvm::GEPOperator *GOP, llvm::Function *Func, std::string Index="")
 
 Token (llvm::Argument *Arg, std::string Index="")
 
 Token (llvm::Type *Ty, std::string Index="")
 
 Token (std::string S, llvm::Function *Func, std::string Index="")
 
 Token (Token *A)
 
 Token ()
 
llvm::Value * getValue () const
 getValue - Returns the underlying Value* for the alias More...
 
llvm::StringRef getName () const
 
std::string getMemTypeName () const
 getMemTypeName - Returns the memory type name More...
 
std::string getFunctionName () const
 getFunctionName - Returns the name of the parent function More...
 
std::string getFieldIndex () const
 getFieldIndex - Returns index of the field More...
 
bool isMem () const
 isMem - Returns true if the alias denotes a location in heap More...
 
bool isArg () const
 isArg - Returns true if alias is a function argument More...
 
bool isField () const
 isField - Returns true if alias is a field More...
 
bool isGlobalVar () const
 isGlobalVar - Returns true if the alias is global More...
 
bool isAllocaOrArgOrGlobal () const
 
bool sameFunc (llvm::Function *Func) const
 sameFunc = Returns true if the parent function of alias is same as /p Func More...
 
bool isBasePointerType () const
 isBasePointerType - Returns true if the Token type's base type is a pointer More...
 
bool isValPointerType () const
 
std::string getHash () const
 
bool isPointerType () const
 
bool operator< (const Token &TheToken) const
 
bool operator== (const Token &TheToken) const
 
void operator= (const Token &TheToken)
 
void setIsGlobal ()
 
void setIsArray ()
 
bool getIsArray ()
 
void setIsAlloca ()
 
bool getIsAlloca ()
 
void setIsOpBitcast ()
 
bool getIsOpBitcast ()
 
void setIsPhiGEPOpd ()
 
bool getIsPhiGEPOpd ()
 
void setIsIcmpGEPOpd ()
 
bool getIsIcmpGEPOpd ()
 
void setIsOneGEPIndx ()
 
bool getIsOneGEPIndx ()
 
void setIsFunPtr ()
 
bool getIsFunPtr ()
 
void setIsFunArg ()
 
bool getIsFunArg ()
 
void setIsRetGEP ()
 
bool getIsRetGEP ()
 
template<typename GOP >
bool isGEPOperandArrayTy (GOP *, int)
 
template<typename GEP >
std::vector< int > getGEPArrayIndex (GEP *)
 
bool isNullToken ()
 
void setNullToken ()
 
llvm::Type * getTy ()
 
void setTy (llvm::Type *)
 
void setFunction (llvm::Function *)
 
llvm::Function * getFunction ()
 
template<typename GOP >
std::vector< int > getGEPArrayIndex (GOP *G)
 

Friends

std::ostream & operator<< (std::ostream &OS, const Token &A)
 

Constructor & Destructor Documentation

◆ Token() [1/7]

spatial::Token::Token ( llvm::Value *  Val,
std::string  Index = "" 
)

◆ Token() [2/7]

spatial::Token::Token ( llvm::GEPOperator *  GOP,
llvm::Function *  Func,
std::string  Index = "" 
)

◆ Token() [3/7]

spatial::Token::Token ( llvm::Argument *  Arg,
std::string  Index = "" 
)

◆ Token() [4/7]

spatial::Token::Token ( llvm::Type *  Ty,
std::string  Index = "" 
)

◆ Token() [5/7]

spatial::Token::Token ( std::string  S,
llvm::Function *  Func,
std::string  Index = "" 
)

◆ Token() [6/7]

spatial::Token::Token ( Token A)

◆ Token() [7/7]

spatial::Token::Token ( )

Member Function Documentation

◆ getFieldIndex()

std::string spatial::Token::getFieldIndex ( ) const

getFieldIndex - Returns index of the field

◆ getFunction()

llvm::Function * spatial::Token::getFunction ( )

◆ getFunctionName()

std::string spatial::Token::getFunctionName ( ) const

getFunctionName - Returns the name of the parent function

◆ getGEPArrayIndex() [1/2]

template<typename GEP >
std::vector< int > spatial::Token::getGEPArrayIndex ( GEP *  )

◆ getGEPArrayIndex() [2/2]

template<typename GOP >
std::vector< int > spatial::Token::getGEPArrayIndex ( GOP *  G)

◆ getHash()

std::string spatial::Token::getHash ( ) const

getHash - Calculates the hash for alias to avoid multiple enteries of same alias

◆ getIndex()

std::string spatial::Token::getIndex ( llvm::GEPOperator *  GEPOp)

getIndex - For a GEP Operator find the offset

◆ getIsAlloca()

bool spatial::Token::getIsAlloca ( )

◆ getIsArray()

bool spatial::Token::getIsArray ( )

◆ getIsFunArg()

bool spatial::Token::getIsFunArg ( )

◆ getIsFunPtr()

bool spatial::Token::getIsFunPtr ( )

◆ getIsIcmpGEPOpd()

bool spatial::Token::getIsIcmpGEPOpd ( )

◆ getIsOneGEPIndx()

bool spatial::Token::getIsOneGEPIndx ( )

◆ getIsOpBitcast()

bool spatial::Token::getIsOpBitcast ( )

◆ getIsPhiGEPOpd()

bool spatial::Token::getIsPhiGEPOpd ( )

◆ getIsRetGEP()

bool spatial::Token::getIsRetGEP ( )

◆ getMemTypeName()

std::string spatial::Token::getMemTypeName ( ) const

getMemTypeName - Returns the memory type name

◆ getName()

llvm::StringRef spatial::Token::getName ( ) const

getName - Returns the name of alias with other informations like parent function etc

◆ getTy()

llvm::Type * spatial::Token::getTy ( )

◆ getValue()

llvm::Value * spatial::Token::getValue ( ) const

getValue - Returns the underlying Value* for the alias

◆ isAllocaOrArgOrGlobal()

bool spatial::Token::isAllocaOrArgOrGlobal ( ) const

isAllocaOrArgOrGlobal - Returns true if the alias is global, an argument or alloca

◆ isArg()

bool spatial::Token::isArg ( ) const

isArg - Returns true if alias is a function argument

◆ isBasePointerType()

bool spatial::Token::isBasePointerType ( ) const

isBasePointerType - Returns true if the Token type's base type is a pointer

◆ isField()

bool spatial::Token::isField ( ) const

isField - Returns true if alias is a field

◆ isGEPOperandArrayTy()

template<typename GOP >
bool spatial::Token::isGEPOperandArrayTy ( GOP *  G,
int  Idx 
)

◆ isGlobalVar()

bool spatial::Token::isGlobalVar ( ) const

isGlobalVar - Returns true if the alias is global

◆ isMem()

bool spatial::Token::isMem ( ) const

isMem - Returns true if the alias denotes a location in heap

◆ isNullToken()

bool spatial::Token::isNullToken ( )

◆ isPointerType()

bool spatial::Token::isPointerType ( ) const

◆ isValPointerType()

bool spatial::Token::isValPointerType ( ) const

◆ operator<()

bool spatial::Token::operator< ( const Token TheToken) const

◆ operator=()

void spatial::Token::operator= ( const Token TheToken)

◆ operator==()

bool spatial::Token::operator== ( const Token TheToken) const

◆ resetIndex()

void spatial::Token::resetIndex ( )

resetIndex - Resets the index back to an empty string

◆ resetIndexToZero() [1/2]

void spatial::Token::resetIndexToZero ( )

resetIndexToZero - Resets the index to string zero for bitcast instr

◆ resetIndexToZero() [2/2]

void spatial::Token::resetIndexToZero ( std::string  S)

resetIndexToZero - Resets the index to string zero for nested bitcast instr

◆ sameFunc()

bool spatial::Token::sameFunc ( llvm::Function *  Func) const

sameFunc = Returns true if the parent function of alias is same as /p Func

◆ setFunction()

void spatial::Token::setFunction ( llvm::Function *  F)

◆ setIndex() [1/4]

void spatial::Token::setIndex ( llvm::GEPOperator *  GEPOp)

setIndex - For a GEP Operator find the offset and store it

◆ setIndex() [2/4]

void spatial::Token::setIndex ( llvm::GetElementPtrInst *  GEPInst)

setIndex - For a GEP Instruction find the offset and store it

◆ setIndex() [3/4]

void spatial::Token::setIndex ( Token T)

setIndex - For a Token

◆ setIndex() [4/4]

void spatial::Token::setIndex ( Token T,
std::string  indx 
)

setIndex - For a Token. Required in case of nested structures wherein the token belongs to a chain of GEP instructions

◆ setIsAlloca()

void spatial::Token::setIsAlloca ( )

◆ setIsArray()

void spatial::Token::setIsArray ( )

◆ setIsFunArg()

void spatial::Token::setIsFunArg ( )

◆ setIsFunPtr()

void spatial::Token::setIsFunPtr ( )

◆ setIsGlobal()

void spatial::Token::setIsGlobal ( )

◆ setIsIcmpGEPOpd()

void spatial::Token::setIsIcmpGEPOpd ( )

◆ setIsOneGEPIndx()

void spatial::Token::setIsOneGEPIndx ( )

◆ setIsOpBitcast()

void spatial::Token::setIsOpBitcast ( )

◆ setIsPhiGEPOpd()

void spatial::Token::setIsPhiGEPOpd ( )

◆ setIsRetGEP()

void spatial::Token::setIsRetGEP ( )

◆ setNullToken()

void spatial::Token::setNullToken ( )

◆ setTy()

void spatial::Token::setTy ( llvm::Type *  type)

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  OS,
const Token A 
)
friend

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