diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-04 20:44:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-04 20:44:11 +0000 |
commit | ad6f3355a7463c25aead44b71c48b85409a53402 (patch) | |
tree | 4753a011138e159588c928fbd6886471f5fd58f9 /llvm/lib/AsmParser/LLParser.cpp | |
parent | 959af7ba30263943e937232f63dd1e093ab9c84b (diff) | |
download | bcm5719-llvm-ad6f3355a7463c25aead44b71c48b85409a53402.tar.gz bcm5719-llvm-ad6f3355a7463c25aead44b71c48b85409a53402.zip |
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.
llvm-svn: 61635
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 5582bfa7f13..e44e65057ca 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -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 |