mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
implement materializeModule, force deallocation of vector memory when we
are done with them, start implementing ParseFunctionBody git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user