summaryrefslogtreecommitdiff
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-08-19 15:51:43 -0400
committerGitHub <noreply@github.com>2020-08-19 12:51:43 -0700
commitb5a4161a801a573179b1f552e5c53748d2667b03 (patch)
tree4b63bc7274ac060054ab239da4f75aa7233bbddf /source/slang/slang.cpp
parent2fffbc5ff0727482c6ab7d66f6d852701adb277b (diff)
Remove IncludeHandler. (#1505)
nvAPI -> NVAPI nvAPIPath -> nvapiPath DxcIncludeHandler don't reference count. nv-api-path -> nvapi-path Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp11
1 files changed, 5 insertions, 6 deletions
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<Scope> 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<Module> 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<Module> Linkage::findOrImportModule(
// Try to load it
ComPtr<ISlangBlob> 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;