From ce2f7f70b42aafb4bac59a9d79ed0a5b1c4da3d0 Mon Sep 17 00:00:00 2001 From: triton Date: Tue, 15 Jul 2014 15:23:55 +0100 Subject: [PATCH] Fixed driver code to use source file options for parsing. --- src/Core/Parser/Parser.cs | 7 ++++--- src/Generator/Driver.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Core/Parser/Parser.cs b/src/Core/Parser/Parser.cs index 15e0e551..2fdcd34c 100644 --- a/src/Core/Parser/Parser.cs +++ b/src/Core/Parser/Parser.cs @@ -48,8 +48,9 @@ namespace CppSharp /// /// Parses a C++ source file to a translation unit. /// - public ParserResult ParseSourceFile(SourceFile file, ParserOptions options) + public ParserResult ParseSourceFile(SourceFile file) { + var options = file.Options; options.ASTContext = ASTContext; options.FileName = file.Path; @@ -62,13 +63,13 @@ namespace CppSharp /// /// Parses the project source files. /// - public void ParseProject(Project project, ParserOptions options) + public void ParseProject(Project project) { // TODO: Search for cached AST trees on disk // TODO: Do multi-threaded parsing of source files foreach (var source in project.Sources) - ParseSourceFile(source, options); + ParseSourceFile(source); } /// diff --git a/src/Generator/Driver.cs b/src/Generator/Driver.cs index 78b21522..bc9a1aac 100644 --- a/src/Generator/Driver.cs +++ b/src/Generator/Driver.cs @@ -170,7 +170,7 @@ namespace CppSharp var parser = new ClangParser(new Parser.AST.ASTContext()); parser.SourceParsed += OnSourceFileParsed; - parser.ParseProject(Project, Options); + parser.ParseProject(Project); TargetInfo = parser.GetTargetInfo(Options);