summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-01 05:52:21 +0000
committerChris Lattner <sabre@nondot.org>2007-05-01 05:52:21 +0000
commit85b7b40621d58f689e2b5515fbbbc8c744207ee0 (patch)
treee6717286bf15d259e85ae4f5d614f0d896fa4111 /llvm/lib/Bitcode/Reader/BitcodeReader.h
parent81c7fc2783b67d580d8dc2d254e7041f702cd66b (diff)
downloadbcm5719-llvm-85b7b40621d58f689e2b5515fbbbc8c744207ee0.tar.gz
bcm5719-llvm-85b7b40621d58f689e2b5515fbbbc8c744207ee0.zip
implement materializeModule, force deallocation of vector memory when we
are done with them, start implementing ParseFunctionBody llvm-svn: 36617
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h
index 0e407697aa3..65c495b6699 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.h
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.h
@@ -44,7 +44,7 @@ public:
void pop_back() { Uses.pop_back(); --NumOperands; }
bool empty() const { return NumOperands == 0; }
void shrinkTo(unsigned N) {
- assert(N < NumOperands && "Invalid shrinkTo request!");
+ assert(N <= NumOperands && "Invalid shrinkTo request!");
Uses.resize(N);
NumOperands = N;
}
@@ -69,6 +69,10 @@ class BitcodeReader : public ModuleProvider {
std::vector<std::pair<GlobalVariable*, unsigned> > GlobalInits;
std::vector<std::pair<GlobalAlias*, unsigned> > AliasInits;
+ /// FunctionBBs - While parsing a function body, this is a list of the basic
+ /// blocks for the function.
+ std::vector<BasicBlock*> FunctionBBs;
+
// When reading the module header, this list is populated with functions that
// have bodies later in the file.
std::vector<Function*> FunctionsWithBodies;
@@ -96,13 +100,7 @@ public:
}
virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0);
-
- virtual Module *materializeModule(std::string *ErrInfo = 0) {
- // FIXME: TODO
- //if (ParseAllFunctionBodies(ErrMsg))
- // return 0;
- return TheModule;
- }
+ virtual Module *materializeModule(std::string *ErrInfo = 0);
bool Error(const char *Str) {
ErrorString = Str;
@@ -121,7 +119,8 @@ private:
bool ParseTypeSymbolTable();
bool ParseValueSymbolTable();
bool ParseConstants();
- bool ParseFunction();
+ bool RememberAndSkipFunctionBody();
+ bool ParseFunctionBody(Function *F);
bool ResolveGlobalAndAliasInits();
};
OpenPOWER on IntegriCloud