diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-10-12 22:02:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-12 22:02:09 -0400 |
| commit | a7a87cec8c98872299e5dbe4c47a852a954b692b (patch) | |
| tree | 46cb5e49f341175dfa4a812a05a60d5368d05a38 /source/slang/slang.cpp | |
| parent | c9ad36868961009fcd67e579f9b51e1333688208 (diff) | |
Feature/source loc review (#672)
* Fixes/improvements based around review comments.
* SourceUnit -> SourceView
* * Removed the HumaneSourceLoc as it's POD-like ness seemed to make that unnecessary
* Made exposed member variables in SourceManager protected - so make clear where/how can be accesed
* Improved description about SourceLoc and associated structures
* Changed SourceLocType to 'Actual' and 'Nominal'.
* Improved a comment.
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index eab9401b4..7ec448ab1 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -372,7 +372,7 @@ SlangResult CompileRequest::loadFile(String const& path, ISlangBlob** outBlob) RefPtr<Expr> CompileRequest::parseTypeString(TranslationUnitRequest * translationUnit, String typeStr, RefPtr<Scope> scope) { - Slang::RefPtr<Slang::SourceFile> srcFile = sourceManager->newSourceFile(String("type string"), typeStr); + Slang::RefPtr<Slang::SourceFile> srcFile = sourceManager->createSourceFile(String("type string"), typeStr); DiagnosticSink sink; sink.sourceManager = sourceManager; @@ -675,7 +675,7 @@ void CompileRequest::addTranslationUnitSourceBlob( String const& path, ISlangBlob* sourceBlob) { - RefPtr<SourceFile> sourceFile = getSourceManager()->newSourceFile(path, sourceBlob); + RefPtr<SourceFile> sourceFile = getSourceManager()->createSourceFile(path, sourceBlob); addTranslationUnitSourceFile(translationUnitIndex, sourceFile); } @@ -685,7 +685,7 @@ void CompileRequest::addTranslationUnitSourceString( String const& path, String const& source) { - RefPtr<SourceFile> sourceFile = getSourceManager()->newSourceFile(path, source); + RefPtr<SourceFile> sourceFile = getSourceManager()->createSourceFile(path, source); addTranslationUnitSourceFile(translationUnitIndex, sourceFile); } @@ -804,7 +804,7 @@ RefPtr<ModuleDecl> CompileRequest::loadModule( // TODO: decide which options, if any, should be inherited. translationUnit->compileFlags = 0; - RefPtr<SourceFile> sourceFile = getSourceManager()->newSourceFile(path, sourceBlob); + RefPtr<SourceFile> sourceFile = getSourceManager()->createSourceFile(path, sourceBlob); translationUnit->sourceFiles.Add(sourceFile); @@ -884,7 +884,7 @@ RefPtr<ModuleDecl> CompileRequest::findOrImportModule( includeHandler.request = this; // Get the original path - String pathIncludedFrom= getSourceManager()->getPath(loc, SourceLocType::Original); + String pathIncludedFrom= getSourceManager()->getPath(loc, SourceLocType::Actual); String foundPath; ComPtr<ISlangBlob> foundSourceBlob; |
