LLVM API Documentation

llvm::MSILWriter Class Reference

#include <MSILWriter.h>

Inheritance diagram for llvm::MSILWriter:
[legend]
Collaboration diagram for llvm::MSILWriter:
[legend]

List of all members.

Public Types

enum  ValueType {
  UndefVT, GlobalVT, InternalVT, ArgumentVT,
  LocalVT, ConstVT, ConstExprVT
}

Public Member Functions

 MSILWriter (formatted_raw_ostream &o)
bool isVariable (ValueType V)
bool isConstValue (ValueType V)
virtual const char * getPassName () const
void getAnalysisUsage (AnalysisUsage &AU) const
bool runOnFunction (Function &F)
virtual bool doInitialization (Module &M)
virtual bool doFinalization (Module &M)
void printModuleStartup ()
bool isZeroValue (const Value *V)
std::string getValueName (const Value *V)
std::string getLabelName (const Value *V)
std::string getLabelName (const std::string &Name)
std::string getConvModopt (unsigned CallingConvID)
std::string getArrayTypeName (Type::TypeID TyID, const Type *Ty)
std::string getPrimitiveTypeName (const Type *Ty, bool isSigned)
std::string getFunctionTypeName (const Type *Ty)
std::string getPointerTypeName (const Type *Ty)
std::string getTypeName (const Type *Ty, bool isSigned=false, bool isNested=false)
ValueType getValueLocation (const Value *V)
std::string getTypePostfix (const Type *Ty, bool Expand, bool isSigned=false)
void printConvToPtr ()
void printPtrLoad (uint64_t N)
void printValuePtrLoad (const Value *V)
void printConstLoad (const Constant *C)
void printValueLoad (const Value *V)
void printValueSave (const Value *V)
void printBinaryInstruction (const char *Name, const Value *Left, const Value *Right)
void printSimpleInstruction (const char *Inst, const char *Operand=NULL)
void printPHICopy (const BasicBlock *Src, const BasicBlock *Dst)
void printBranchToBlock (const BasicBlock *CurrBB, const BasicBlock *TrueBB, const BasicBlock *FalseBB)
void printBranchInstruction (const BranchInst *Inst)
void printSelectInstruction (const Value *Cond, const Value *VTrue, const Value *VFalse)
void printIndirectLoad (const Value *V)
void printIndirectSave (const Value *Ptr, const Value *Val)
void printIndirectSave (const Type *Ty)
void printCastInstruction (unsigned int Op, const Value *V, const Type *Ty, const Type *SrcTy=0)
void printGepInstruction (const Value *V, gep_type_iterator I, gep_type_iterator E)
std::string getCallSignature (const FunctionType *Ty, const Instruction *Inst, std::string Name)
void printFunctionCall (const Value *FnVal, const Instruction *Inst)
void printIntrinsicCall (const IntrinsicInst *Inst)
void printCallInstruction (const Instruction *Inst)
void printICmpInstruction (unsigned Predicate, const Value *Left, const Value *Right)
void printFCmpInstruction (unsigned Predicate, const Value *Left, const Value *Right)
void printInvokeInstruction (const InvokeInst *Inst)
void printSwitchInstruction (const SwitchInst *Inst)
void printVAArgInstruction (const VAArgInst *Inst)
void printAllocaInstruction (const AllocaInst *Inst)
void printInstruction (const Instruction *Inst)
void printLoop (const Loop *L)
void printBasicBlock (const BasicBlock *BB)
void printLocalVariables (const Function &F)
void printFunctionBody (const Function &F)
void printConstantExpr (const ConstantExpr *CE)
void printStaticInitializerList ()
void printFunction (const Function &F)
void printDeclarations (const TypeSymbolTable &ST)
unsigned int getBitWidth (const Type *Ty)
void printStaticConstant (const Constant *C, uint64_t &Offset)
void printStaticInitializer (const Constant *C, const std::string &Name)
void printVariableDefinition (const GlobalVariable *G)
void printGlobalVariables ()
const char * getLibraryName (const Function *F)
const char * getLibraryName (const GlobalVariable *GV)
const char * getLibraryForSymbol (const StringRef &Name, bool isFunction, unsigned CallingConv)
void printExternals ()

Public Attributes

formatted_raw_ostream & Out
Module * ModulePtr
const TargetData * TD
Mangler * Mang
LoopInfo * LInfo
std::vector< StaticInitializer > * InitListPtr
std::map< const GlobalVariable
*, std::vector
< StaticInitializer > > 
StaticInitList
const std::set< const Type * > * UsedTypes
DenseMap< const Value *, unsigned > AnonValueNumbers
unsigned NextAnonValueNumber

Static Public Attributes

static char ID = 0

Classes

struct  StaticInitializer


Detailed Description

Definition at line 58 of file MSILWriter.h.


Member Enumeration Documentation

Enumerator:
UndefVT 
GlobalVT 
InternalVT 
ArgumentVT 
LocalVT 
ConstVT 
ConstExprVT 

Definition at line 95 of file MSILWriter.h.


Constructor & Destructor Documentation

llvm::MSILWriter::MSILWriter ( formatted_raw_ostream &  o  )  [inline]

Definition at line 90 of file MSILWriter.h.


Member Function Documentation

bool llvm::MSILWriter::isVariable ( ValueType  V  )  [inline]

Definition at line 105 of file MSILWriter.h.

References ArgumentVT, GlobalVT, InternalVT, and LocalVT.

bool llvm::MSILWriter::isConstValue ( ValueType  V  )  [inline]

Definition at line 109 of file MSILWriter.h.

References ConstExprVT, and ConstVT.

virtual const char* llvm::MSILWriter::getPassName (  )  const [inline, virtual]

getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.

getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.

Reimplemented from llvm::Pass.

Definition at line 113 of file MSILWriter.h.

void llvm::MSILWriter::getAnalysisUsage ( AnalysisUsage &   )  const [inline, virtual]

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented from llvm::Pass.

Definition at line 115 of file MSILWriter.h.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().

bool MSILWriter::runOnFunction ( Function &  F  )  [virtual]

runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.

Implements llvm::FunctionPass.

Definition at line 89 of file MSILWriter.cpp.

References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::Function::isDeclaration(), LInfo, and printFunction().

bool MSILWriter::doInitialization ( Module &  M  )  [virtual]

doInitialization - Virtual method overridden by subclasses to do any necessary per-module initialization.

Reimplemented from llvm::FunctionPass.

Definition at line 103 of file MSILWriter.cpp.

References llvm::Module::getTypeSymbolTable(), Mang, ModulePtr, Out, printDeclarations(), printExternals(), printGlobalVariables(), and printModuleStartup().

bool MSILWriter::doFinalization ( Module &   )  [virtual]

doFinalization - Virtual method overriden by subclasses to do any post processing needed after all passes have run.

Reimplemented from llvm::FunctionPass.

Definition at line 120 of file MSILWriter.cpp.

References Mang.

void MSILWriter::printModuleStartup (  ) 

bool MSILWriter::isZeroValue ( const Value *  V  ) 

Definition at line 225 of file MSILWriter.cpp.

References llvm::CallingConv::C.

Referenced by printGepInstruction().

std::string MSILWriter::getValueName ( const Value *  V  ) 

std::string MSILWriter::getLabelName ( const Value *  V  ) 

std::string MSILWriter::getLabelName ( const std::string &  Name  ) 

Definition at line 247 of file MSILWriter.cpp.

References E.

std::string MSILWriter::getConvModopt ( unsigned  CallingConvID  ) 

std::string MSILWriter::getArrayTypeName ( Type::TypeID  TyID,
const Type *  Ty 
)

Definition at line 291 of file MSILWriter.cpp.

References llvm::Type::getTypeID(), getTypeName(), and llvm::utostr().

Referenced by getTypeName().

std::string MSILWriter::getPrimitiveTypeName ( const Type *  Ty,
bool  isSigned 
)

std::string llvm::MSILWriter::getFunctionTypeName ( const Type *  Ty  ) 

std::string llvm::MSILWriter::getPointerTypeName ( const Type *  Ty  ) 

std::string MSILWriter::getTypeName ( const Type *  Ty,
bool  isSigned = false,
bool  isNested = false 
)

MSILWriter::ValueType MSILWriter::getValueLocation ( const Value *  V  ) 

Definition at line 365 of file MSILWriter.cpp.

References ArgumentVT, ConstExprVT, ConstVT, F, G, GlobalVT, InternalVT, and LocalVT.

Referenced by printValueLoad(), and printValueSave().

std::string MSILWriter::getTypePostfix ( const Type *  Ty,
bool  Expand,
bool  isSigned = false 
)

void MSILWriter::printConvToPtr (  ) 

void MSILWriter::printPtrLoad ( uint64_t  N  ) 

void MSILWriter::printValuePtrLoad ( const Value *  V  ) 

Definition at line 442 of file MSILWriter.cpp.

References printConvToPtr(), and printValueLoad().

Referenced by printGepInstruction().

void MSILWriter::printConstLoad ( const Constant *  C  ) 

void MSILWriter::printValueLoad ( const Value *  V  ) 

void MSILWriter::printValueSave ( const Value *  V  ) 

void MSILWriter::printBinaryInstruction ( const char *  Name,
const Value *  Left,
const Value *  Right 
)

void MSILWriter::printSimpleInstruction ( const char *  Inst,
const char *  Operand = NULL 
)

void MSILWriter::printPHICopy ( const BasicBlock *  Src,
const BasicBlock *  Dst 
)

void MSILWriter::printBranchToBlock ( const BasicBlock *  CurrBB,
const BasicBlock *  TrueBB,
const BasicBlock *  FalseBB 
)

void MSILWriter::printBranchInstruction ( const BranchInst *  Inst  ) 

void MSILWriter::printSelectInstruction ( const Value *  Cond,
const Value *  VTrue,
const Value *  VFalse 
)

Definition at line 624 of file MSILWriter.cpp.

References Out, printSimpleInstruction(), printValueLoad(), and llvm::utostr().

Referenced by printConstantExpr(), and printInstruction().

void MSILWriter::printIndirectLoad ( const Value *  V  ) 

void MSILWriter::printIndirectSave ( const Value *  Ptr,
const Value *  Val 
)

Definition at line 646 of file MSILWriter.cpp.

References llvm::Value::getType(), and printValueLoad().

Referenced by printExternals(), printInstruction(), and printIntrinsicCall().

void MSILWriter::printIndirectSave ( const Type *  Ty  ) 

Definition at line 653 of file MSILWriter.cpp.

References getTypePostfix(), and printSimpleInstruction().

void MSILWriter::printCastInstruction ( unsigned int  Op,
const Value *  V,
const Type *  Ty,
const Type *  SrcTy = 0 
)

void MSILWriter::printGepInstruction ( const Value *  V,
gep_type_iterator  I,
gep_type_iterator  E 
)

std::string MSILWriter::getCallSignature ( const FunctionType *  Ty,
const Instruction *  Inst,
std::string  Name 
)

void MSILWriter::printFunctionCall ( const Value *  FnVal,
const Instruction *  Inst 
)

void MSILWriter::printIntrinsicCall ( const IntrinsicInst *  Inst  ) 

void MSILWriter::printCallInstruction ( const Instruction *  Inst  ) 

void MSILWriter::printICmpInstruction ( unsigned  Predicate,
const Value *  Left,
const Value *  Right 
)

void MSILWriter::printFCmpInstruction ( unsigned  Predicate,
const Value *  Left,
const Value *  Right 
)

void MSILWriter::printInvokeInstruction ( const InvokeInst *  Inst  ) 

void MSILWriter::printSwitchInstruction ( const SwitchInst *  Inst  ) 

void MSILWriter::printVAArgInstruction ( const VAArgInst *  Inst  ) 

void MSILWriter::printAllocaInstruction ( const AllocaInst *  Inst  ) 

void MSILWriter::printInstruction ( const Instruction *  Inst  ) 

void MSILWriter::printLoop ( const Loop *  L  ) 

void MSILWriter::printBasicBlock ( const BasicBlock *  BB  ) 

void MSILWriter::printLocalVariables ( const Function &  F  ) 

void MSILWriter::printFunctionBody ( const Function &  F  ) 

void MSILWriter::printConstantExpr ( const ConstantExpr *  CE  ) 

void MSILWriter::printStaticInitializerList (  ) 

void MSILWriter::printFunction ( const Function &  F  ) 

void MSILWriter::printDeclarations ( const TypeSymbolTable &  ST  ) 

Definition at line 1465 of file MSILWriter.cpp.

References llvm::TargetData::getTypeAllocSize(), getTypeName(), Name, Out, TD, Ty, and UsedTypes.

Referenced by doInitialization().

unsigned int MSILWriter::getBitWidth ( const Type *  Ty  ) 

void MSILWriter::printStaticConstant ( const Constant *  C,
uint64_t &  Offset 
)

void MSILWriter::printStaticInitializer ( const Constant *  C,
const std::string &  Name 
)

void MSILWriter::printVariableDefinition ( const GlobalVariable *  G  ) 

void MSILWriter::printGlobalVariables (  ) 

const char * MSILWriter::getLibraryName ( const Function *  F  ) 

const char * MSILWriter::getLibraryName ( const GlobalVariable *  GV  ) 

Definition at line 1625 of file MSILWriter.cpp.

References getLibraryForSymbol(), llvm::Mangler::getMangledName(), and Mang.

const char * MSILWriter::getLibraryForSymbol ( const StringRef &  Name,
bool  isFunction,
unsigned  CallingConv 
)

Definition at line 1630 of file MSILWriter.cpp.

Referenced by getLibraryName().

void MSILWriter::printExternals (  ) 


Member Data Documentation

Definition at line 81 of file MSILWriter.h.

Referenced by printFunctionBody(), printLoop(), and runOnFunction().

std::vector<StaticInitializer>* llvm::MSILWriter::InitListPtr

Definition at line 82 of file MSILWriter.h.

Referenced by printStaticConstant(), and printVariableDefinition().

std::map<const GlobalVariable*,std::vector<StaticInitializer> > llvm::MSILWriter::StaticInitList

Definition at line 84 of file MSILWriter.h.

Referenced by printStaticInitializerList(), and printVariableDefinition().

const std::set<const Type *>* llvm::MSILWriter::UsedTypes

Definition at line 85 of file MSILWriter.h.

Referenced by llvm::MSILTarget::addPassesToEmitWholeFile(), and printDeclarations().

char MSILWriter::ID = 0 [static]

Definition at line 86 of file MSILWriter.h.

Definition at line 87 of file MSILWriter.h.

Referenced by getLabelName(), and getValueName().

Definition at line 88 of file MSILWriter.h.

Referenced by getLabelName(), and getValueName().


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