diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-26 10:52:31 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-26 12:17:49 -0700 |
| commit | f6cb66feab3439f41ca87cb307f69b49654883ab (patch) | |
| tree | d73c230a8b2ddc06e0fa978945aa8a838b189236 /source/slang/preprocessor.h | |
| parent | 6e99b81c98f8c76444563d959536073befc7d8ca (diff) | |
Check for re-import at translation-unit level
Previously the code checked for a duplicate `#import` using a data structure attached to the compile request, but this would fail for nested imports.
It also wouldn't work for a combination of `#import` and `__import`.
This change makes it so that we instead track a set of already-imported modules in the semantic checking visitor, which is instantiated once per translation unit.
We also key this set on the actual module (AST) imported, rather than on path/name/whatever, so hopefully it will be robust to the same thing getting imported multiple ways.
Diffstat (limited to 'source/slang/preprocessor.h')
| -rw-r--r-- | source/slang/preprocessor.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/slang/preprocessor.h b/source/slang/preprocessor.h index ebeb810a0..d23b19773 100644 --- a/source/slang/preprocessor.h +++ b/source/slang/preprocessor.h @@ -7,9 +7,9 @@ namespace Slang { -class CompileRequest; class DiagnosticSink; class ProgramSyntaxNode; +class TranslationUnitRequest; enum class IncludeResult { @@ -35,9 +35,8 @@ TokenList preprocessSource( String const& fileName, DiagnosticSink* sink, IncludeHandler* includeHandler, - Dictionary<String, String> defines, - ProgramSyntaxNode* syntax, - CompileRequest* compileRequest); + Dictionary<String, String> defines, + TranslationUnitRequest* translationUnit); } // namespace Slang |
