summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitfb49fd664292fa7991e874d82dc1bf6d1afc0936 (patch)
tree34267672b106f0f423c9e1e508c72385a5208c2d /llvm/lib/Bytecode/Reader/ReaderInternals.h
parent862e338b46d8f728acef1298de40b1eeb3be0406 (diff)
downloadbcm5719-llvm-fb49fd664292fa7991e874d82dc1bf6d1afc0936.tar.gz
bcm5719-llvm-fb49fd664292fa7991e874d82dc1bf6d1afc0936.zip
* 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 llvm-svn: 760
Diffstat (limited to 'llvm/lib/Bytecode/Reader/ReaderInternals.h')
-rw-r--r--llvm/lib/Bytecode/Reader/ReaderInternals.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Reader/ReaderInternals.h b/llvm/lib/Bytecode/Reader/ReaderInternals.h
index ec486d851e4..a5b01c2438f 100644
--- a/llvm/lib/Bytecode/Reader/ReaderInternals.h
+++ b/llvm/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...
OpenPOWER on IntegriCloud