mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Make all the virtual function (except destructor) inline so there are
default implementations without taking up a ton of space in a .cpp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14603 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -66,29 +66,29 @@ public:
|
|||||||
/// with the error message before the parser throws an exception to
|
/// with the error message before the parser throws an exception to
|
||||||
/// terminate the parsing.
|
/// terminate the parsing.
|
||||||
/// @brief Handle parsing errors.
|
/// @brief Handle parsing errors.
|
||||||
virtual void handleError(const std::string& str );
|
virtual void handleError(const std::string& str ) {}
|
||||||
|
|
||||||
/// This method is called at the beginning of a parse before anything is
|
/// This method is called at the beginning of a parse before anything is
|
||||||
/// read in order to give the handler a chance to initialize.
|
/// read in order to give the handler a chance to initialize.
|
||||||
/// @brief Handle the start of a bytecode parse
|
/// @brief Handle the start of a bytecode parse
|
||||||
virtual void handleStart( Module* Mod, unsigned byteSize );
|
virtual void handleStart( Module* Mod, unsigned byteSize ) {}
|
||||||
|
|
||||||
/// This method is called at the end of a parse after everything has been
|
/// 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.
|
/// read in order to give the handler a chance to terminate.
|
||||||
/// @brief Handle the end of a bytecode parse
|
/// @brief Handle the end of a bytecode parse
|
||||||
virtual void handleFinish();
|
virtual void handleFinish() {}
|
||||||
|
|
||||||
/// This method is called at the start of a module to indicate that a
|
/// This method is called at the start of a module to indicate that a
|
||||||
/// module is being parsed.
|
/// module is being parsed.
|
||||||
/// @brief Handle the start of a module.
|
/// @brief Handle the start of a module.
|
||||||
virtual void handleModuleBegin(const std::string& moduleId);
|
virtual void handleModuleBegin(const std::string& moduleId) {}
|
||||||
|
|
||||||
/// This method is called at the end of a module to indicate that the module
|
/// This method is called at the end of a module to indicate that the module
|
||||||
/// previously being parsed has concluded.
|
/// previously being parsed has concluded.
|
||||||
/// @brief Handle the end of a module.
|
/// @brief Handle the end of a module.
|
||||||
virtual void handleModuleEnd(
|
virtual void handleModuleEnd(
|
||||||
const std::string& moduleId ///< An identifier for the module
|
const std::string& moduleId ///< An identifier for the module
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called once the version information has been parsed. It
|
/// This method is called once the version information has been parsed. It
|
||||||
/// provides the information about the version of the bytecode file being
|
/// provides the information about the version of the bytecode file being
|
||||||
@@ -98,11 +98,11 @@ public:
|
|||||||
unsigned char RevisionNum, ///< Byte code revision number
|
unsigned char RevisionNum, ///< Byte code revision number
|
||||||
Module::Endianness Endianness, ///< Endianness indicator
|
Module::Endianness Endianness, ///< Endianness indicator
|
||||||
Module::PointerSize PointerSize ///< PointerSize indicator
|
Module::PointerSize PointerSize ///< PointerSize indicator
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called at the start of a module globals block which
|
/// This method is called at the start of a module globals block which
|
||||||
/// contains the global variables and the function placeholders
|
/// contains the global variables and the function placeholders
|
||||||
virtual void handleModuleGlobalsBegin();
|
virtual void handleModuleGlobalsBegin() {}
|
||||||
|
|
||||||
/// This method is called when a non-initialized global variable is
|
/// This method is called when a non-initialized global variable is
|
||||||
/// recognized. Its type, constness, and linkage type are provided.
|
/// recognized. Its type, constness, and linkage type are provided.
|
||||||
@@ -113,46 +113,46 @@ public:
|
|||||||
GlobalValue::LinkageTypes,///< The linkage type of the GV
|
GlobalValue::LinkageTypes,///< The linkage type of the GV
|
||||||
unsigned SlotNum, ///< Slot number of GV
|
unsigned SlotNum, ///< Slot number of GV
|
||||||
unsigned initSlot ///< Slot number of GV's initializer (0 if none)
|
unsigned initSlot ///< Slot number of GV's initializer (0 if none)
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called when a new type is recognized. The type is
|
/// This method is called when a new type is recognized. The type is
|
||||||
/// converted from the bytecode and passed to this method.
|
/// converted from the bytecode and passed to this method.
|
||||||
/// @brief Handle a type
|
/// @brief Handle a type
|
||||||
virtual void handleType(
|
virtual void handleType(
|
||||||
const Type* Ty ///< The type that was just recognized
|
const Type* Ty ///< The type that was just recognized
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called when the function prototype for a function is
|
/// This method is called when the function prototype for a function is
|
||||||
/// encountered in the module globals block.
|
/// encountered in the module globals block.
|
||||||
virtual void handleFunctionDeclaration(
|
virtual void handleFunctionDeclaration(
|
||||||
Function* Func ///< The function being declared
|
Function* Func ///< The function being declared
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called when a global variable is initialized with
|
/// This method is called when a global variable is initialized with
|
||||||
/// its constant value. Because of forward referencing, etc. this is
|
/// its constant value. Because of forward referencing, etc. this is
|
||||||
/// done towards the end of the module globals block
|
/// done towards the end of the module globals block
|
||||||
virtual void handleGlobalInitializer(GlobalVariable*, Constant* );
|
virtual void handleGlobalInitializer(GlobalVariable*, Constant* ) {}
|
||||||
|
|
||||||
/// This method is called at the end of the module globals block.
|
/// This method is called at the end of the module globals block.
|
||||||
/// @brief Handle end of module globals block.
|
/// @brief Handle end of module globals block.
|
||||||
virtual void handleModuleGlobalsEnd();
|
virtual void handleModuleGlobalsEnd() {}
|
||||||
|
|
||||||
/// This method is called at the beginning of a compaction table.
|
/// This method is called at the beginning of a compaction table.
|
||||||
/// @brief Handle start of compaction table.
|
/// @brief Handle start of compaction table.
|
||||||
virtual void handleCompactionTableBegin();
|
virtual void handleCompactionTableBegin() {}
|
||||||
|
|
||||||
/// @brief Handle start of a compaction table plane
|
/// @brief Handle start of a compaction table plane
|
||||||
virtual void handleCompactionTablePlane(
|
virtual void handleCompactionTablePlane(
|
||||||
unsigned Ty, ///< The type of the plane (slot number)
|
unsigned Ty, ///< The type of the plane (slot number)
|
||||||
unsigned NumEntries ///< The number of entries in the plane
|
unsigned NumEntries ///< The number of entries in the plane
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a type entry in the compaction table
|
/// @brief Handle a type entry in the compaction table
|
||||||
virtual void handleCompactionTableType(
|
virtual void handleCompactionTableType(
|
||||||
unsigned i, ///< Index in the plane of this type
|
unsigned i, ///< Index in the plane of this type
|
||||||
unsigned TypSlot, ///< Slot number for this type
|
unsigned TypSlot, ///< Slot number for this type
|
||||||
const Type* ///< The type referenced by this slot
|
const Type* ///< The type referenced by this slot
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a value entry in the compaction table
|
/// @brief Handle a value entry in the compaction table
|
||||||
virtual void handleCompactionTableValue(
|
virtual void handleCompactionTableValue(
|
||||||
@@ -160,56 +160,56 @@ public:
|
|||||||
unsigned TypSlot, ///< The slot (plane) of the type of this value
|
unsigned TypSlot, ///< The slot (plane) of the type of this value
|
||||||
unsigned ValSlot, ///< The global value slot of the value
|
unsigned ValSlot, ///< The global value slot of the value
|
||||||
const Type* ///< The resolved type of the value.
|
const Type* ///< The resolved type of the value.
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle end of a compaction table
|
/// @brief Handle end of a compaction table
|
||||||
virtual void handleCompactionTableEnd();
|
virtual void handleCompactionTableEnd() {}
|
||||||
|
|
||||||
/// @brief Handle start of a symbol table
|
/// @brief Handle start of a symbol table
|
||||||
virtual void handleSymbolTableBegin(
|
virtual void handleSymbolTableBegin(
|
||||||
Function* Func, ///< The function to which the ST belongs
|
Function* Func, ///< The function to which the ST belongs
|
||||||
SymbolTable* ST ///< The symbol table being filled
|
SymbolTable* ST ///< The symbol table being filled
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle start of a symbol table plane
|
/// @brief Handle start of a symbol table plane
|
||||||
virtual void handleSymbolTablePlane(
|
virtual void handleSymbolTablePlane(
|
||||||
unsigned Ty, ///< The slotnum of the type plane
|
unsigned TySlot, ///< The slotnum of the type plane
|
||||||
unsigned NumEntries, ///< Number of entries in the plane
|
unsigned NumEntries, ///< Number of entries in the plane
|
||||||
const Type* Ty ///< The type of this type plane
|
const Type* Typ ///< The type of this type plane
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a named type in the symbol table
|
/// @brief Handle a named type in the symbol table
|
||||||
virtual void handleSymbolTableType(
|
virtual void handleSymbolTableType(
|
||||||
unsigned i, ///< The index of the type in this plane
|
unsigned i, ///< The index of the type in this plane
|
||||||
unsigned slot, ///< Slot number of the named type
|
unsigned slot, ///< Slot number of the named type
|
||||||
const std::string& name ///< Name of the type
|
const std::string& name ///< Name of the type
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a named value in the symbol table
|
/// @brief Handle a named value in the symbol table
|
||||||
virtual void handleSymbolTableValue(
|
virtual void handleSymbolTableValue(
|
||||||
unsigned i, ///< The index of the value in this plane
|
unsigned i, ///< The index of the value in this plane
|
||||||
unsigned slot, ///< Slot number of the named value
|
unsigned slot, ///< Slot number of the named value
|
||||||
const std::string& name ///< Name of the value.
|
const std::string& name ///< Name of the value.
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle the end of a symbol table
|
/// @brief Handle the end of a symbol table
|
||||||
virtual void handleSymbolTableEnd();
|
virtual void handleSymbolTableEnd() {}
|
||||||
|
|
||||||
/// @brief Handle the beginning of a function body
|
/// @brief Handle the beginning of a function body
|
||||||
virtual void handleFunctionBegin(
|
virtual void handleFunctionBegin(
|
||||||
Function* Func, ///< The function being defined
|
Function* Func, ///< The function being defined
|
||||||
unsigned Size ///< The size (in bytes) of the function's bytecode
|
unsigned Size ///< The size (in bytes) of the function's bytecode
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle the end of a function body
|
/// @brief Handle the end of a function body
|
||||||
virtual void handleFunctionEnd(
|
virtual void handleFunctionEnd(
|
||||||
Function* Func ///< The function whose definition has just finished.
|
Function* Func ///< The function whose definition has just finished.
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle the beginning of a basic block
|
/// @brief Handle the beginning of a basic block
|
||||||
virtual void handleBasicBlockBegin(
|
virtual void handleBasicBlockBegin(
|
||||||
unsigned blocknum ///< The block number of the block
|
unsigned blocknum ///< The block number of the block
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// This method is called for each instruction that is parsed.
|
/// This method is called for each instruction that is parsed.
|
||||||
/// @returns true if the instruction is a block terminating instruction
|
/// @returns true if the instruction is a block terminating instruction
|
||||||
@@ -219,22 +219,22 @@ public:
|
|||||||
const Type* iType, ///< Instruction type
|
const Type* iType, ///< Instruction type
|
||||||
std::vector<unsigned>& Operands, ///< Vector of slot # operands
|
std::vector<unsigned>& Operands, ///< Vector of slot # operands
|
||||||
unsigned Length ///< Length of instruction in bc bytes
|
unsigned Length ///< Length of instruction in bc bytes
|
||||||
);
|
) { return false; }
|
||||||
|
|
||||||
/// @brief Handle the end of a basic block
|
/// @brief Handle the end of a basic block
|
||||||
virtual void handleBasicBlockEnd(
|
virtual void handleBasicBlockEnd(
|
||||||
unsigned blocknum ///< The block number of the block just finished
|
unsigned blocknum ///< The block number of the block just finished
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle start of global constants block.
|
/// @brief Handle start of global constants block.
|
||||||
virtual void handleGlobalConstantsBegin();
|
virtual void handleGlobalConstantsBegin() {}
|
||||||
|
|
||||||
/// @brief Handle a constant expression
|
/// @brief Handle a constant expression
|
||||||
virtual void handleConstantExpression(
|
virtual void handleConstantExpression(
|
||||||
unsigned Opcode, ///< Opcode of primary expression operator
|
unsigned Opcode, ///< Opcode of primary expression operator
|
||||||
std::vector<Constant*> ArgVec, ///< expression args
|
std::vector<Constant*> ArgVec, ///< expression args
|
||||||
Constant* C ///< The constant value
|
Constant* C ///< The constant value
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a constant array
|
/// @brief Handle a constant array
|
||||||
virtual void handleConstantArray(
|
virtual void handleConstantArray(
|
||||||
@@ -242,14 +242,14 @@ public:
|
|||||||
std::vector<Constant*>& ElementSlots,///< Slot nums for array values
|
std::vector<Constant*>& ElementSlots,///< Slot nums for array values
|
||||||
unsigned TypeSlot, ///< Slot # of type
|
unsigned TypeSlot, ///< Slot # of type
|
||||||
Constant* Val ///< The constant value
|
Constant* Val ///< The constant value
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a constant structure
|
/// @brief Handle a constant structure
|
||||||
virtual void handleConstantStruct(
|
virtual void handleConstantStruct(
|
||||||
const StructType* ST, ///< Type of the struct
|
const StructType* ST, ///< Type of the struct
|
||||||
std::vector<Constant*>& ElementSlots,///< Slot nums for struct values
|
std::vector<Constant*>& ElementSlots,///< Slot nums for struct values
|
||||||
Constant* Val ///< The constant value
|
Constant* Val ///< The constant value
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a constant pointer
|
/// @brief Handle a constant pointer
|
||||||
virtual void handleConstantPointer(
|
virtual void handleConstantPointer(
|
||||||
@@ -257,42 +257,42 @@ public:
|
|||||||
unsigned Slot, ///< Slot num of initializer value
|
unsigned Slot, ///< Slot num of initializer value
|
||||||
GlobalValue* GV, ///< Referenced global value
|
GlobalValue* GV, ///< Referenced global value
|
||||||
Constant* Val ///< Value of constant
|
Constant* Val ///< Value of constant
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a constant strings (array special case)
|
/// @brief Handle a constant strings (array special case)
|
||||||
virtual void handleConstantString(
|
virtual void handleConstantString(
|
||||||
const ConstantArray* CA ///< Type of the string array
|
const ConstantArray* CA ///< Type of the string array
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a primitive constant value
|
/// @brief Handle a primitive constant value
|
||||||
virtual void handleConstantValue(
|
virtual void handleConstantValue(
|
||||||
Constant * c ///< The constant just defined
|
Constant * c ///< The constant just defined
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle the end of the global constants
|
/// @brief Handle the end of the global constants
|
||||||
virtual void handleGlobalConstantsEnd();
|
virtual void handleGlobalConstantsEnd() {}
|
||||||
|
|
||||||
/// @brief Handle an alignment event
|
/// @brief Handle an alignment event
|
||||||
virtual void handleAlignment(
|
virtual void handleAlignment(
|
||||||
unsigned numBytes ///< The number of bytes added for alignment
|
unsigned numBytes ///< The number of bytes added for alignment
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a bytecode block
|
/// @brief Handle a bytecode block
|
||||||
virtual void handleBlock(
|
virtual void handleBlock(
|
||||||
unsigned BType, ///< The type of block
|
unsigned BType, ///< The type of block
|
||||||
const unsigned char* StartPtr, ///< The start of the block
|
const unsigned char* StartPtr, ///< The start of the block
|
||||||
unsigned Size ///< The size of the block
|
unsigned Size ///< The size of the block
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a variable bit rate 32 bit unsigned
|
/// @brief Handle a variable bit rate 32 bit unsigned
|
||||||
virtual void handleVBR32(
|
virtual void handleVBR32(
|
||||||
unsigned Size ///< Number of bytes the vbr_uint took up
|
unsigned Size ///< Number of bytes the vbr_uint took up
|
||||||
);
|
) {}
|
||||||
|
|
||||||
/// @brief Handle a variable bit rate 64 bit unsigned
|
/// @brief Handle a variable bit rate 64 bit unsigned
|
||||||
virtual void handleVBR64(
|
virtual void handleVBR64(
|
||||||
unsigned Size ///< Number of byte sthe vbr_uint64 took up
|
unsigned Size ///< Number of byte sthe vbr_uint64 took up
|
||||||
);
|
) {}
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user