aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-26 18:56:10 +0000
committerChris Lattner <sabre@nondot.org>2001-11-26 18:56:10 +0000
commitd23b1d31c0a4d46f3ee78cd5393bea571c29888c (patch)
tree2ed914aaf3d642bc80863ac8a0b99352db327c7e /lib/Bytecode/Reader/Reader.cpp
parentdda719665ba2ffd2eb1c32a0d2daa3921448db7c (diff)
Implement internal method support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index a076bffb3a..7f02b9339f 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -265,9 +265,12 @@ bool BytecodeParser::ParseMethod(const uchar *&Buf, const uchar *EndBuf,
const MethodType *MTy = dyn_cast<const MethodType>(PMTy->getValueType());
if (MTy == 0) return failure(true); // Not ptr to method!
+ unsigned isInternal;
+ if (read_vbr(Buf, EndBuf, isInternal)) return failure(true);
+
unsigned MethSlot = MethodSignatureList.front().second;
MethodSignatureList.pop_front();
- Method *M = new Method(MTy);
+ Method *M = new Method(MTy, isInternal != 0);
BCR_TRACE(2, "METHOD TYPE: " << MTy << endl);
@@ -380,8 +383,9 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
unsigned VarType;
if (read_vbr(Buf, End, VarType)) return failure(true);
while (VarType != Type::VoidTyID) { // List is terminated by Void
- // VarType Fields: bit0 = isConstant, bit1 = hasInitializer, bit2+ = slot#
- const Type *Ty = getType(VarType >> 2);
+ // VarType Fields: bit0 = isConstant, bit1 = hasInitializer,
+ // bit2 = isInternal, bit3+ = slot#
+ const Type *Ty = getType(VarType >> 3);
if (!Ty || !Ty->isPointerType()) {
Error = "Global not pointer type! Ty = " + Ty->getDescription();
return failure(true);
@@ -404,7 +408,8 @@ bool BytecodeParser::ParseModuleGlobalInfo(const uchar *&Buf, const uchar *End,
}
// Create the global variable...
- GlobalVariable *GV = new GlobalVariable(ElTy, VarType & 1, Initializer);
+ GlobalVariable *GV = new GlobalVariable(ElTy, VarType & 1, VarType & 4,
+ Initializer);
int DestSlot = insertValue(GV, ModuleValues);
if (DestSlot == -1) return failure(true);