From be8497804f803c02cfab1aa2c54d921042e90ec9 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 1 Sep 2022 15:38:17 -0400 Subject: Remove artifact from SourceFile (#2384) * #include an absolute path didn't work - because paths were taken to always be relative. * Make DownstreamCompileOptions use POD types. * CharSliceAllocator -> SliceAllocator Added SliceConverter CharSliceCaster -> SliceCaster * First attempt at zero terminating around blobs. * Fix clang warning. * Add SlangTerminatedChars Make Blob implementations support it. Make most blobs 'terminated'. * Fix bug setting up sourceFiles for CommandLineDownstreamCompiler. * Traffic in TerminatedCharSlice for sourceFiles. Use ArtifactDesc to generate temporary file names for source. * Fix typo in testing for shared library/C++. * Working with source being passed as artifacts to DownstreamCompiler. * Use artifacts in SourceManager/SourceFile. * Support infering extension from the original file extension. * * Infer extension if can't determine from the artifact type * Split IOSFile/IExtFile representations * Move responsibility for creating OS file to the handler. * Disable the check memory path. * Remove artifact from SourceFile. Lazily generate SourceFile from artifacts as needed. * Fix some small bugs. * Remove maybeAddArtifact. * Load artifacts if repro capture is enabled. * Remove adding by string, because doing so means source will be allocated twice or there is a potential race around ref counting to the contained String. * Add built in source as a blob. * Fix warning. * Make StringBlob own the contents if moved. Fix some compilation issues. * Share StringBlob uniqueness code. * Do move unique on Ctor. * Change MoveUnique to not have any values. * MoveUnique can more sensibly be a struct. Co-authored-by: Yong He --- source/compiler-core/slang-source-loc.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source/compiler-core/slang-source-loc.h') diff --git a/source/compiler-core/slang-source-loc.h b/source/compiler-core/slang-source-loc.h index 29ed9dfbb..66e4c0475 100644 --- a/source/compiler-core/slang-source-loc.h +++ b/source/compiler-core/slang-source-loc.h @@ -9,8 +9,6 @@ #include "../../slang-com-ptr.h" #include "../../slang.h" -#include "slang-artifact-representation.h" - namespace Slang { /** Overview: @@ -236,20 +234,11 @@ public: /// Get path info const PathInfo& getPathInfo() const { return m_pathInfo; } - /// Get the (optional) assoicated artifact. Note its desc might be Source/Unknown - IArtifact* getArtifact() const { return m_artifact; } - /// Set the artifact - void setArtifact(IArtifact* artifact) { m_artifact = artifact; } - /// Set the content as a blob void setContents(ISlangBlob* blob); /// Set the content as a string void setContents(const String& content); - /// If the desc isn't set, will use Unknown source type - /// If artifact isn't defined will try and associate one. - void maybeAddArtifact(const ArtifactDesc* desc, ISlangFileSystemExt* ext); - /// Calculate a display path -> can canonicalize if necessary String calcVerbosePath() const; @@ -266,7 +255,6 @@ public: SourceManager* m_sourceManager; ///< The source manager this belongs to PathInfo m_pathInfo; ///< The path The logical file path to report for locations inside this span. - ComPtr m_artifact; ///< Optional artifact ComPtr m_contentBlob; ///< A blob that owns the storage for the file contents. If nullptr, there is no contents UnownedStringSlice m_content; ///< The actual contents of the file. size_t m_contentSize; ///< The size of the actual contents -- cgit v1.2.3