aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/ReaderInternals.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-13 06:47:01 +0000
committerChris Lattner <sabre@nondot.org>2001-10-13 06:47:01 +0000
commit05950c34a4297f26ec602ef5fe491b66addd745f (patch)
treeda0ab6ace9d38462d4230440c2e85e3bfa437f9e /lib/Bytecode/Reader/ReaderInternals.h
parente02fa8551d20081534afa46e0976811687e5183a (diff)
* Add real support for global variable addresses initializing constants
* Add minor optimization to BytecodeParser::refineAbstractType * MethodType::get now take an explicit isVarArg parameter * Fix encoding/decoding of VarArgs calls * Support the Invoke instruction git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/ReaderInternals.h')
-rw-r--r--lib/Bytecode/Reader/ReaderInternals.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Bytecode/Reader/ReaderInternals.h b/lib/Bytecode/Reader/ReaderInternals.h
index ec486d851e..a5b01c2438 100644
--- a/lib/Bytecode/Reader/ReaderInternals.h
+++ b/lib/Bytecode/Reader/ReaderInternals.h
@@ -29,6 +29,7 @@ class BasicBlock;
class Method;
class Module;
class Type;
+class PointerType;
typedef unsigned char uchar;
@@ -52,11 +53,22 @@ public:
Module *ParseBytecode(const uchar *Buf, const uchar *EndBuf);
private: // All of this data is transient across calls to ParseBytecode
+ Module *TheModule; // Current Module being read into...
+
typedef vector<Value *> ValueList;
typedef vector<ValueList> ValueTable;
ValueTable Values, LateResolveValues;
ValueTable ModuleValues, LateResolveModuleValues;
+ // GlobalRefs - This maintains a mapping between <Type, Slot #>'s and forward
+ // references to global values. Global values may be referenced before they
+ // are defined, and if so, the temporary object that they represent is held
+ // here.
+ //
+ typedef map<pair<const PointerType *, unsigned>, GlobalVariable*>
+ GlobalRefsType;
+ GlobalRefsType GlobalRefs;
+
// TypesLoaded - This vector mirrors the Values[TypeTyID] plane. It is used
// to deal with forward references to types.
//
@@ -94,11 +106,15 @@ private:
Value *getValue(const Type *Ty, unsigned num, bool Create = true);
const Type *getType(unsigned ID);
- bool insertValue(Value *D, vector<ValueList> &D);
+ int insertValue(Value *D, vector<ValueList> &D); // -1 = Failure
bool postResolveValues(ValueTable &ValTab);
bool getTypeSlot(const Type *Ty, unsigned &Slot);
+ // DeclareNewGlobalValue - Patch up forward references to global values in the
+ // form of ConstPoolPointerReferences.
+ //
+ void DeclareNewGlobalValue(GlobalValue *GV, unsigned Slot);
// refineAbstractType - The callback method is invoked when one of the
// elements of TypeValues becomes more concrete...