From 9c1e05fe75b369b72ddd7d8a6c952fc7788841e8 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Tue, 29 Jun 2004 23:18:52 +0000 Subject: [PATCH] Fix include guard Adjust comments Make handlers for constants provide useful information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14488 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Bytecode/BytecodeHandler.h | 29 +++++++++++++++++-------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/include/llvm/Bytecode/BytecodeHandler.h b/include/llvm/Bytecode/BytecodeHandler.h index 3fb958df875..3550d22636b 100644 --- a/include/llvm/Bytecode/BytecodeHandler.h +++ b/include/llvm/Bytecode/BytecodeHandler.h @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#ifndef BYTECODE_BYTECODEHANDLER_H -#define BYTECODE_BYTECODEHANDLER_H +#ifndef LLVM_BYTECODE_BYTECODEHANDLER_H +#define LLVM_BYTECODE_BYTECODEHANDLER_H #include "llvm/Module.h" @@ -24,6 +24,7 @@ class ArrayType; class StructType; class PointerType; class ConstantArray; +class Module; /// This class provides the interface for handling bytecode events during /// reading of bytecode. The methods on this interface are invoked by the @@ -70,7 +71,7 @@ public: /// This method is called at the beginning of a parse before anything is /// read in order to give the handler a chance to initialize. /// @brief Handle the start of a bytecode parse - virtual void handleStart( unsigned byteSize ); + virtual void handleStart( Module* Mod, unsigned byteSize ); /// 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. @@ -127,6 +128,11 @@ public: Function* Func ///< The function being declared ); + /// 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 + virtual void handleGlobalInitializer(GlobalVariable*, Constant* ); + /// This method is called at the end of the module globals block. /// @brief Handle end of module globals block. virtual void handleModuleGlobalsEnd(); @@ -226,26 +232,31 @@ public: /// @brief Handle a constant expression virtual void handleConstantExpression( unsigned Opcode, ///< Opcode of primary expression operator - const Type* Typ, ///< Type of the expression - std::vector > ArgVec ///< expression args + std::vector ArgVec, ///< expression args + Constant* C ///< The constant value ); /// @brief Handle a constant array virtual void handleConstantArray( const ArrayType* AT, ///< Type of the array - std::vector& ElementSlots ///< Slot nums for array values + std::vector& ElementSlots,///< Slot nums for array values + unsigned TypeSlot, ///< Slot # of type + Constant* Val ///< The constant value ); /// @brief Handle a constant structure - virtual void handleConstantStruct( + virtual void handleConstantStruct( const StructType* ST, ///< Type of the struct - std::vector& ElementSlots ///< Slot nums for struct values + std::vector& ElementSlots,///< Slot nums for struct values + Constant* Val ///< The constant value ); /// @brief Handle a constant pointer virtual void handleConstantPointer( const PointerType* PT, ///< Type of the pointer - unsigned Slot ///< Slot num of initializer value + unsigned Slot, ///< Slot num of initializer value + GlobalValue* GV, ///< Referenced global value + Constant* Val ///< Value of constant ); /// @brief Handle a constant strings (array special case) -- 2.34.1