Browse Source

Fixed driver code to use source file options for parsing.

pull/291/head
triton 12 years ago
parent
commit
ce2f7f70b4
  1. 7
      src/Core/Parser/Parser.cs
  2. 2
      src/Generator/Driver.cs

7
src/Core/Parser/Parser.cs

@ -48,8 +48,9 @@ namespace CppSharp
/// <summary> /// <summary>
/// Parses a C++ source file to a translation unit. /// Parses a C++ source file to a translation unit.
/// </summary> /// </summary>
public ParserResult ParseSourceFile(SourceFile file, ParserOptions options) public ParserResult ParseSourceFile(SourceFile file)
{ {
var options = file.Options;
options.ASTContext = ASTContext; options.ASTContext = ASTContext;
options.FileName = file.Path; options.FileName = file.Path;
@ -62,13 +63,13 @@ namespace CppSharp
/// <summary> /// <summary>
/// Parses the project source files. /// Parses the project source files.
/// </summary> /// </summary>
public void ParseProject(Project project, ParserOptions options) public void ParseProject(Project project)
{ {
// TODO: Search for cached AST trees on disk // TODO: Search for cached AST trees on disk
// TODO: Do multi-threaded parsing of source files // TODO: Do multi-threaded parsing of source files
foreach (var source in project.Sources) foreach (var source in project.Sources)
ParseSourceFile(source, options); ParseSourceFile(source);
} }
/// <summary> /// <summary>

2
src/Generator/Driver.cs

@ -170,7 +170,7 @@ namespace CppSharp
var parser = new ClangParser(new Parser.AST.ASTContext()); var parser = new ClangParser(new Parser.AST.ASTContext());
parser.SourceParsed += OnSourceFileParsed; parser.SourceParsed += OnSourceFileParsed;
parser.ParseProject(Project, Options); parser.ParseProject(Project);
TargetInfo = parser.GetTargetInfo(Options); TargetInfo = parser.GetTargetInfo(Options);

Loading…
Cancel
Save