From bd815f02d846a50e16dab67e6512db2a6215c41f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 21 Jan 2019 16:41:54 -0500 Subject: Feature/file unique identity (#789) * * Fix memory bug around expanding va_args - needed buffer to have space for terminating 0 * Fix problem with FileWriter defaults being globals, as memory they allocate, will only be freed after return from main - work around by making StdWriters RefObject derived, and kept in scope such the writers are destroyed before checks for leaks is found * Added SimplifyPathAndHash mode for CacheFileSystem - will simplify the path and see if simplified path is in cache before reading file (limiting amout of underlying file requests) * * Added calcReplaceChar * Renamed DefaultFileSystem to OSFileSystem * Made OSFileSystem convert windows \ to / on linux * Simplified logic for caching in CacheFileSystem. * Added pragma-once-c to add extra test, but also so there is an 'include' directory in preprocessor tests. * Small fixes in pragma once test. * Simplified cache handling path, so that paths/simplified paths area always added. * Improve naming of methods for different caches. * Removed references to 'canonicalPath' and made 'uniqueIdentity' * * Re-add support for canonicalPath to ISlangFileSystem -> not for uniqueIdentifier but as a way to display 'canonicalPath' * Added peliminary support for being able to display verbose paths in a diagnostic * Added 'clearCache' support * Added verbose path support to SourceManager (now needs a ISlangFileSystemExt to do this) * Added support for '-verbose-path' option to slangc and slang-test. --- source/slang/compiler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/compiler.h') diff --git a/source/slang/compiler.h b/source/slang/compiler.h index 41ba027c6..ca82950be 100644 --- a/source/slang/compiler.h +++ b/source/slang/compiler.h @@ -399,7 +399,7 @@ namespace Slang // This is a list of unique modules loaded, in the order they were encountered. List > loadedModulesList; - // Map from the path of a module file to its definition + // Map from the path (or uniqueIdentity if available) of a module file to its definition Dictionary> mapPathToLoadedModule; // Map from the logical name of a module to its definition @@ -509,6 +509,8 @@ namespace Slang mSink.sourceManager = sm; } + void setFileSystem(ISlangFileSystem* fileSystem); + /// During propagation of an exception for an internal /// error, note that this source location was involved void noteInternalErrorLoc(SourceLoc const& loc); -- cgit v1.2.3