Refactor some parser interfaces to fix PR3278 and a FIXME:

ParseAssemblyString with a specified module would not parse
into the module, it would create and return a new one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61635 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-01-04 20:44:11 +00:00
parent 0f8df9a9ce
commit ad7d1e2085
3 changed files with 25 additions and 23 deletions

View File

@ -51,19 +51,12 @@ namespace llvm {
}
/// Run: module ::= toplevelentity*
Module *LLParser::Run() {
M = new Module(Lex.getFilename());
bool LLParser::Run() {
// Prime the lexer.
Lex.Lex();
if (ParseTopLevelEntities() ||
ValidateEndOfModule()) {
delete M;
return 0;
}
return M;
return ParseTopLevelEntities() ||
ValidateEndOfModule();
}
/// ValidateEndOfModule - Do final validity and sanity checks at the end of the