LLVM API Documentation
#include <BytecodeHandler.h>
Constructors And Operators | |
BytecodeHandler () | |
Default constructor (empty). | |
virtual | ~BytecodeHandler () |
Virtual destructor (empty). | |
Public Member Functions | |
Handler Methods | |
virtual void | handleError (const std::string &str) |
Handle parsing errors. | |
virtual void | handleStart (Module *Mod, unsigned byteSize) |
Handle the start of a bytecode parse. | |
virtual void | handleFinish () |
Handle the end of a bytecode parse. | |
virtual void | handleModuleBegin (const std::string &moduleId) |
Handle the start of a module. | |
virtual void | handleModuleEnd (const std::string &moduleId) |
Handle the end of a module. | |
virtual void | handleVersionInfo (unsigned char RevisionNum, Module::Endianness Endianness, Module::PointerSize PointerSize) |
Handle the bytecode prolog. | |
virtual void | handleModuleGlobalsBegin () |
virtual void | handleGlobalVariable (const Type *ElemType, bool isConstant, GlobalValue::LinkageTypes, unsigned SlotNum, unsigned initSlot) |
Handle a non-initialized global variable. | |
virtual void | handleTypeList (unsigned numEntries) |
Handle a type. | |
virtual void | handleType (const Type *Ty) |
Handle a type. | |
virtual void | handleFunctionDeclaration (Function *Func) |
virtual void | handleGlobalInitializer (GlobalVariable *, Constant *) |
virtual void | handleDependentLibrary (const std::string &libName) |
virtual void | handleTargetTriple (const std::string &triple) |
virtual void | handleModuleGlobalsEnd () |
Handle end of module globals block. | |
virtual void | handleCompactionTableBegin () |
Handle start of compaction table. | |
virtual void | handleCompactionTablePlane (unsigned Ty, unsigned NumEntries) |
Handle start of a compaction table plane. | |
virtual void | handleCompactionTableType (unsigned i, unsigned TypSlot, const Type *) |
Handle a type entry in the compaction table. | |
virtual void | handleCompactionTableValue (unsigned i, unsigned TypSlot, unsigned ValSlot) |
Handle a value entry in the compaction table. | |
virtual void | handleCompactionTableEnd () |
Handle end of a compaction table. | |
virtual void | handleSymbolTableBegin (Function *Func, SymbolTable *ST) |
Handle start of a symbol table. | |
virtual void | handleSymbolTablePlane (unsigned TySlot, unsigned NumEntries, const Type *Typ) |
Handle start of a symbol table plane. | |
virtual void | handleSymbolTableType (unsigned i, unsigned slot, const std::string &name) |
Handle a named type in the symbol table. | |
virtual void | handleSymbolTableValue (unsigned i, unsigned slot, const std::string &name) |
Handle a named value in the symbol table. | |
virtual void | handleSymbolTableEnd () |
Handle the end of a symbol table. | |
virtual void | handleFunctionBegin (Function *Func, unsigned Size) |
Handle the beginning of a function body. | |
virtual void | handleFunctionEnd (Function *Func) |
Handle the end of a function body. | |
virtual void | handleBasicBlockBegin (unsigned blocknum) |
Handle the beginning of a basic block. | |
virtual bool | handleInstruction (unsigned Opcode, const Type *iType, std::vector< unsigned > &Operands, unsigned Length) |
Handle an instruction. | |
virtual void | handleBasicBlockEnd (unsigned blocknum) |
Handle the end of a basic block. | |
virtual void | handleGlobalConstantsBegin () |
Handle start of global constants block. | |
virtual void | handleConstantExpression (unsigned Opcode, std::vector< Constant * > ArgVec, Constant *C) |
Handle a constant expression. | |
virtual void | handleConstantArray (const ArrayType *AT, std::vector< Constant * > &ElementSlots, unsigned TypeSlot, Constant *Val) |
Handle a constant array. | |
virtual void | handleConstantStruct (const StructType *ST, std::vector< Constant * > &ElementSlots, Constant *Val) |
Handle a constant structure. | |
virtual void | handleConstantPacked (const PackedType *PT, std::vector< Constant * > &ElementSlots, unsigned TypeSlot, Constant *Val) |
Handle a constant packed. | |
virtual void | handleConstantPointer (const PointerType *PT, unsigned Slot, GlobalValue *GV) |
Handle a constant pointer. | |
virtual void | handleConstantString (const ConstantArray *CA) |
Handle a constant strings (array special case). | |
virtual void | handleConstantValue (Constant *c) |
Handle a primitive constant value. | |
virtual void | handleGlobalConstantsEnd () |
Handle the end of the global constants. | |
virtual void | handleAlignment (unsigned numBytes) |
Handle an alignment event. | |
virtual void | handleBlock (unsigned BType, const unsigned char *StartPtr, unsigned Size) |
Handle a bytecode block. | |
virtual void | handleVBR32 (unsigned Size) |
Handle a variable bit rate 32 bit unsigned. | |
virtual void | handleVBR64 (unsigned Size) |
Handle a variable bit rate 64 bit unsigned. |
This class provides the interface for handling bytecode events during reading of bytecode. The methods on this interface are invoked by the BytecodeReader as it discovers the content of a bytecode stream. This class provides a a clear separation of concerns between recognizing the semantic units of a bytecode file (the Reader) and deciding what to do with them (the Handler).
The BytecodeReader recognizes the content of the bytecode file and calls the BytecodeHandler methods to let it perform additional tasks. This arrangement allows Bytecode files to be read and handled for a number of purposes simply by creating a subclass of BytecodeHandler. None of the parsing details need to be understood, only the meaning of the calls made on this interface.
Definition at line 46 of file BytecodeHandler.h.
|
Default constructor (empty).
Definition at line 52 of file BytecodeHandler.h. |
|
Virtual destructor (empty).
Definition at line 2284 of file Reader.cpp. |
|
Handle an alignment event.
Definition at line 299 of file BytecodeHandler.h. |
|
Handle the beginning of a basic block.
Definition at line 226 of file BytecodeHandler.h. |
|
Handle the end of a basic block.
Definition at line 241 of file BytecodeHandler.h. |
|
Handle a bytecode block.
Definition at line 304 of file BytecodeHandler.h. |
|
Handle start of compaction table. This method is called at the beginning of a compaction table. Definition at line 159 of file BytecodeHandler.h. |
|
Handle end of a compaction table.
Definition at line 182 of file BytecodeHandler.h. |
|
Handle start of a compaction table plane.
Definition at line 162 of file BytecodeHandler.h. |
|
Handle a type entry in the compaction table.
Definition at line 168 of file BytecodeHandler.h. |
|
Handle a value entry in the compaction table.
Definition at line 175 of file BytecodeHandler.h. |
|
Handle a constant array.
Definition at line 256 of file BytecodeHandler.h. |
|
Handle a constant expression.
Definition at line 249 of file BytecodeHandler.h. |
|
Handle a constant packed.
Definition at line 271 of file BytecodeHandler.h. |
|
Handle a constant pointer.
Definition at line 279 of file BytecodeHandler.h. |
|
Handle a constant strings (array special case).
Definition at line 286 of file BytecodeHandler.h. |
|
Handle a constant structure.
Definition at line 264 of file BytecodeHandler.h. |
|
Handle a primitive constant value.
Definition at line 291 of file BytecodeHandler.h. |
|
This method is called for each dependent library name found in the module globals block. Definition at line 147 of file BytecodeHandler.h. |
|
Handle parsing errors. This method is called whenever the parser detects an error in the bytecode formatting. It gives the handler a chance to do something with the error message before the parser throws an exception to terminate the parsing. Definition at line 70 of file BytecodeHandler.h. |
|
Handle the end of a bytecode parse. This method is called at the end of a parse after everything has been read in order to give the handler a chance to terminate. Definition at line 80 of file BytecodeHandler.h. |
|
Handle the beginning of a function body.
Definition at line 215 of file BytecodeHandler.h. |
|
This method is called when the function prototype for a function is encountered in the module globals block.
Definition at line 136 of file BytecodeHandler.h. |
|
Handle the end of a function body.
Definition at line 221 of file BytecodeHandler.h. |
|
Handle start of global constants block.
Definition at line 246 of file BytecodeHandler.h. |
|
Handle the end of the global constants.
Definition at line 296 of file BytecodeHandler.h. |
|
This method is called when a global variable is initialized with its constant value. Because of forward referencing, etc. this is done towards the end of the module globals block Definition at line 143 of file BytecodeHandler.h. |
|
Handle a non-initialized global variable. This method is called when a non-initialized global variable is recognized. Its type, constness, and linkage type are provided.
Definition at line 111 of file BytecodeHandler.h. |
|
Handle an instruction. This method is called for each instruction that is parsed.
Definition at line 233 of file BytecodeHandler.h. |
|
Handle the start of a module. This method is called at the start of a module to indicate that a module is being parsed. Definition at line 85 of file BytecodeHandler.h. |
|
Handle the end of a module. This method is called at the end of a module to indicate that the module previously being parsed has concluded.
Definition at line 90 of file BytecodeHandler.h. |
|
This method is called at the start of a module globals block which contains the global variables and the function placeholders Definition at line 106 of file BytecodeHandler.h. |
|
Handle end of module globals block. This method is called at the end of the module globals block. Definition at line 155 of file BytecodeHandler.h. |
|
Handle the start of a bytecode parse. This method is called at the beginning of a parse before anything is read in order to give the handler a chance to initialize. Definition at line 75 of file BytecodeHandler.h. |
|
Handle start of a symbol table.
Definition at line 185 of file BytecodeHandler.h. |
|
Handle the end of a symbol table.
Definition at line 212 of file BytecodeHandler.h. |
|
Handle start of a symbol table plane.
Definition at line 191 of file BytecodeHandler.h. |
|
Handle a named type in the symbol table.
Definition at line 198 of file BytecodeHandler.h. |
|
Handle a named value in the symbol table.
Definition at line 205 of file BytecodeHandler.h. |
|
This method is called if the module globals has a non-empty target triple Definition at line 151 of file BytecodeHandler.h. |
|
Handle a type. This method is called when a new type is recognized. The type is converted from the bytecode and passed to this method.
Definition at line 130 of file BytecodeHandler.h. |
|
Handle a type. This method is called when a type list is recognized. It simply provides the number of types that the list contains. The handler should expect that number of calls to handleType.
Definition at line 123 of file BytecodeHandler.h. |
|
Handle a variable bit rate 32 bit unsigned.
Definition at line 311 of file BytecodeHandler.h. |
|
Handle a variable bit rate 64 bit unsigned.
Definition at line 316 of file BytecodeHandler.h. |
|
Handle the bytecode prolog. This method is called once the version information has been parsed. It provides the information about the version of the bytecode file being read.
Definition at line 98 of file BytecodeHandler.h. |