From a7a87cec8c98872299e5dbe4c47a852a954b692b Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 12 Oct 2018 22:02:09 -0400 Subject: 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. --- source/slang/slang.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/slang/slang.cpp') 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 CompileRequest::parseTypeString(TranslationUnitRequest * translationUnit, String typeStr, RefPtr scope) { - Slang::RefPtr srcFile = sourceManager->newSourceFile(String("type string"), typeStr); + Slang::RefPtr 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 = getSourceManager()->newSourceFile(path, sourceBlob); + RefPtr sourceFile = getSourceManager()->createSourceFile(path, sourceBlob); addTranslationUnitSourceFile(translationUnitIndex, sourceFile); } @@ -685,7 +685,7 @@ void CompileRequest::addTranslationUnitSourceString( String const& path, String const& source) { - RefPtr sourceFile = getSourceManager()->newSourceFile(path, source); + RefPtr sourceFile = getSourceManager()->createSourceFile(path, source); addTranslationUnitSourceFile(translationUnitIndex, sourceFile); } @@ -804,7 +804,7 @@ RefPtr CompileRequest::loadModule( // TODO: decide which options, if any, should be inherited. translationUnit->compileFlags = 0; - RefPtr sourceFile = getSourceManager()->newSourceFile(path, sourceBlob); + RefPtr sourceFile = getSourceManager()->createSourceFile(path, sourceBlob); translationUnit->sourceFiles.Add(sourceFile); @@ -884,7 +884,7 @@ RefPtr 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 foundSourceBlob; -- cgit v1.2.3