mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
The stream to read from is now an ivar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48f848716e
commit
866971474c
@ -152,7 +152,7 @@ const Type *BitcodeReader::getTypeByID(unsigned ID, bool isTypeTable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BitcodeReader::ParseTypeTable(BitstreamReader &Stream) {
|
bool BitcodeReader::ParseTypeTable() {
|
||||||
if (Stream.EnterSubBlock())
|
if (Stream.EnterSubBlock())
|
||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
|
|
||||||
@ -298,7 +298,7 @@ bool BitcodeReader::ParseTypeTable(BitstreamReader &Stream) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BitcodeReader::ParseTypeSymbolTable(BitstreamReader &Stream) {
|
bool BitcodeReader::ParseTypeSymbolTable() {
|
||||||
if (Stream.EnterSubBlock())
|
if (Stream.EnterSubBlock())
|
||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ bool BitcodeReader::ParseTypeSymbolTable(BitstreamReader &Stream) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitcodeReader::ParseValueSymbolTable(BitstreamReader &Stream) {
|
bool BitcodeReader::ParseValueSymbolTable() {
|
||||||
if (Stream.EnterSubBlock())
|
if (Stream.EnterSubBlock())
|
||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
|
|
||||||
@ -444,7 +444,7 @@ bool BitcodeReader::ResolveGlobalAndAliasInits() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BitcodeReader::ParseConstants(BitstreamReader &Stream) {
|
bool BitcodeReader::ParseConstants() {
|
||||||
if (Stream.EnterSubBlock())
|
if (Stream.EnterSubBlock())
|
||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ bool BitcodeReader::ParseConstants(BitstreamReader &Stream) {
|
|||||||
|
|
||||||
/// ParseFunction - When we see the block for a function body, remember where it
|
/// ParseFunction - When we see the block for a function body, remember where it
|
||||||
/// is and then skip it. This lets us lazily deserialize the functions.
|
/// is and then skip it. This lets us lazily deserialize the functions.
|
||||||
bool BitcodeReader::ParseFunction(BitstreamReader &Stream) {
|
bool BitcodeReader::ParseFunction() {
|
||||||
// Get the function we are talking about.
|
// Get the function we are talking about.
|
||||||
if (FunctionsWithBodies.empty())
|
if (FunctionsWithBodies.empty())
|
||||||
return Error("Insufficient function protos");
|
return Error("Insufficient function protos");
|
||||||
@ -683,8 +683,7 @@ bool BitcodeReader::ParseFunction(BitstreamReader &Stream) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitcodeReader::ParseModule(BitstreamReader &Stream,
|
bool BitcodeReader::ParseModule(const std::string &ModuleID) {
|
||||||
const std::string &ModuleID) {
|
|
||||||
// Reject multiple MODULE_BLOCK's in a single bitstream.
|
// Reject multiple MODULE_BLOCK's in a single bitstream.
|
||||||
if (TheModule)
|
if (TheModule)
|
||||||
return Error("Multiple MODULE_BLOCKs in same stream");
|
return Error("Multiple MODULE_BLOCKs in same stream");
|
||||||
@ -719,19 +718,19 @@ bool BitcodeReader::ParseModule(BitstreamReader &Stream,
|
|||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
break;
|
break;
|
||||||
case bitc::TYPE_BLOCK_ID:
|
case bitc::TYPE_BLOCK_ID:
|
||||||
if (ParseTypeTable(Stream))
|
if (ParseTypeTable())
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case bitc::TYPE_SYMTAB_BLOCK_ID:
|
case bitc::TYPE_SYMTAB_BLOCK_ID:
|
||||||
if (ParseTypeSymbolTable(Stream))
|
if (ParseTypeSymbolTable())
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case bitc::VALUE_SYMTAB_BLOCK_ID:
|
case bitc::VALUE_SYMTAB_BLOCK_ID:
|
||||||
if (ParseValueSymbolTable(Stream))
|
if (ParseValueSymbolTable())
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case bitc::CONSTANTS_BLOCK_ID:
|
case bitc::CONSTANTS_BLOCK_ID:
|
||||||
if (ParseConstants(Stream) || ResolveGlobalAndAliasInits())
|
if (ParseConstants() || ResolveGlobalAndAliasInits())
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case bitc::FUNCTION_BLOCK_ID:
|
case bitc::FUNCTION_BLOCK_ID:
|
||||||
@ -742,7 +741,7 @@ bool BitcodeReader::ParseModule(BitstreamReader &Stream,
|
|||||||
HasReversedFunctionsWithBodies = true;
|
HasReversedFunctionsWithBodies = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParseFunction(Stream))
|
if (ParseFunction())
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -932,7 +931,7 @@ bool BitcodeReader::ParseBitcode() {
|
|||||||
|
|
||||||
// We only know the MODULE subblock ID.
|
// We only know the MODULE subblock ID.
|
||||||
if (BlockID == bitc::MODULE_BLOCK_ID) {
|
if (BlockID == bitc::MODULE_BLOCK_ID) {
|
||||||
if (ParseModule(Stream, Buffer->getBufferIdentifier()))
|
if (ParseModule(Buffer->getBufferIdentifier()))
|
||||||
return true;
|
return true;
|
||||||
} else if (Stream.SkipBlock()) {
|
} else if (Stream.SkipBlock()) {
|
||||||
return Error("Malformed block record");
|
return Error("Malformed block record");
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
class BitstreamReader;
|
|
||||||
class MemoryBuffer;
|
class MemoryBuffer;
|
||||||
|
|
||||||
class BitcodeReaderValueList : public User {
|
class BitcodeReaderValueList : public User {
|
||||||
@ -117,12 +116,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
|
const Type *getTypeByID(unsigned ID, bool isTypeTable = false);
|
||||||
|
|
||||||
bool ParseModule(BitstreamReader &Stream, const std::string &ModuleID);
|
bool ParseModule(const std::string &ModuleID);
|
||||||
bool ParseTypeTable(BitstreamReader &Stream);
|
bool ParseTypeTable();
|
||||||
bool ParseTypeSymbolTable(BitstreamReader &Stream);
|
bool ParseTypeSymbolTable();
|
||||||
bool ParseValueSymbolTable(BitstreamReader &Stream);
|
bool ParseValueSymbolTable();
|
||||||
bool ParseConstants(BitstreamReader &Stream);
|
bool ParseConstants();
|
||||||
bool ParseFunction(BitstreamReader &Stream);
|
bool ParseFunction();
|
||||||
bool ResolveGlobalAndAliasInits();
|
bool ResolveGlobalAndAliasInits();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user