aboutsummaryrefslogtreecommitdiff
path: root/lib/AsmParser/LLParser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-04 20:44:11 +0000
committerChris Lattner <sabre@nondot.org>2009-01-04 20:44:11 +0000
commitad7d1e2085a489dbedc65b99bab811771ead1aab (patch)
tree76eef86401383d61d42ebdf6dddbbecdc28099e1 /lib/AsmParser/LLParser.cpp
parent0f8df9a9ceab274a94c794ac82733c79d0f13597 (diff)
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
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r--lib/AsmParser/LLParser.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 5582bfa7f1..e44e65057c 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/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