From b5a4161a801a573179b1f552e5c53748d2667b03 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 Aug 2020 15:51:43 -0400 Subject: Remove IncludeHandler. (#1505) nvAPI -> NVAPI nvAPIPath -> nvapiPath DxcIncludeHandler don't reference count. nv-api-path -> nvapi-path Co-authored-by: Tim Foley --- source/slang/slang.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index aed38547d..6bffa0f65 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -897,8 +897,7 @@ void FrontEndCompileRequest::parseTranslationUnit( // Here we should probably be using the searchDirectories on the FrontEndCompileRequest. // If searchDirectories.parent pointed to the one in the Linkage would mean linkage paths // would be checked too (after those on the FrontEndCompileRequest). - - IncludeHandlerImpl includeHandler(&linkage->searchDirectories, linkage->getFileSystemExt()); + IncludeSystem includeSystem(&linkage->searchDirectories, linkage->getFileSystemExt(), linkage->getSourceManager()); RefPtr languageScope; switch (translationUnit->sourceLanguage) @@ -956,7 +955,7 @@ void FrontEndCompileRequest::parseTranslationUnit( auto tokens = preprocessSource( sourceFile, getSink(), - &includeHandler, + &includeSystem, combinedPreprocessorDefinitions, getLinkage(), module); @@ -1651,14 +1650,14 @@ RefPtr Linkage::findOrImportModule( // Next, try to find the file of the given name, // using our ordinary include-handling logic. - IncludeHandlerImpl includeHandler(&searchDirectories, getFileSystemExt()); + IncludeSystem includeSystem(&searchDirectories, getFileSystemExt(), getSourceManager()); // Get the original path info PathInfo pathIncludedFromInfo = getSourceManager()->getPathInfo(loc, SourceLocType::Actual); PathInfo filePathInfo; // We have to load via the found path - as that is how file was originally loaded - if (SLANG_FAILED(includeHandler.findFile(fileName, pathIncludedFromInfo.foundPath, filePathInfo))) + if (SLANG_FAILED(includeSystem.findFile(fileName, pathIncludedFromInfo.foundPath, filePathInfo))) { sink->diagnose(loc, Diagnostics::cannotFindFile, fileName); mapNameToLoadedModules[name] = nullptr; @@ -1671,7 +1670,7 @@ RefPtr Linkage::findOrImportModule( // Try to load it ComPtr fileContents; - if(SLANG_FAILED(getFileSystemExt()->loadFile(filePathInfo.foundPath.getBuffer(), fileContents.writeRef()))) + if(SLANG_FAILED(includeSystem.loadFile(filePathInfo, fileContents))) { sink->diagnose(loc, Diagnostics::cannotOpenFile, fileName); mapNameToLoadedModules[name] = nullptr; -- cgit v1.2.3