diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-12-10 10:02:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-10 10:02:19 -0500 |
| commit | 79ec0cfdb5f3461c763e0bf712cf42eb87fccb90 (patch) | |
| tree | cf0c3c0b6e7f10d3a29930cd3aeef586298d4234 /source/core/slang-gcc-compiler-util.h | |
| parent | 2e52217cb870b4101c1639fed78224f89bf119b3 (diff) | |
DownstreamCompiler abstraction (#1149)
* CPPCompiler -> DownstreamCompiler
* Added DownstreamCompileResult to start abstraction such that we don't need files.
* * Split out slang-blob.cpp
* Made CompileResult hold a DownstreamCompileResult - for access to binary or ISlangSharedLibrary
* Keep temporary files in scope.
* Add a hash to the hex dump stream.
* Move all file tracking into DownstreamCompiler.
Diffstat (limited to 'source/core/slang-gcc-compiler-util.h')
| -rw-r--r-- | source/core/slang-gcc-compiler-util.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/core/slang-gcc-compiler-util.h b/source/core/slang-gcc-compiler-util.h index df3cb8a4b..ead527e0d 100644 --- a/source/core/slang-gcc-compiler-util.h +++ b/source/core/slang-gcc-compiler-util.h @@ -1,25 +1,25 @@ #ifndef SLANG_GCC_COMPILER_UTIL_H #define SLANG_GCC_COMPILER_UTIL_H -#include "slang-cpp-compiler.h" +#include "slang-downstream-compiler.h" namespace Slang { /* Utility for processing input and output of gcc-like compilers, including clang */ -struct GCCCompilerUtil : public CPPCompilerBaseUtil +struct GCCDownstreamCompilerUtil : public DownstreamCompilerBaseUtil { /// Extracts version number into desc from text (assumes gcc/clang -v layout with a line with version) - static SlangResult parseVersion(const UnownedStringSlice& text, const UnownedStringSlice& prefix, CPPCompiler::Desc& outDesc); + static SlangResult parseVersion(const UnownedStringSlice& text, const UnownedStringSlice& prefix, DownstreamCompiler::Desc& outDesc); /// Runs the exeName, and extracts the version info into outDesc - static SlangResult calcVersion(const String& exeName, CPPCompiler::Desc& outDesc); + static SlangResult calcVersion(const String& exeName, DownstreamCompiler::Desc& outDesc); /// Calculate gcc family compilers (including clang) cmdLine arguments from options static SlangResult calcArgs(const CompileOptions& options, CommandLine& cmdLine); /// Parse ExecuteResult into Output - static SlangResult parseOutput(const ExecuteResult& exeRes, CPPCompiler::Output& outOutput); + static SlangResult parseOutput(const ExecuteResult& exeRes, DownstreamDiagnostics& outOutput); /// Calculate the output module filename static SlangResult calcModuleFilePath(const CompileOptions& options, StringBuilder& outPath); @@ -28,19 +28,19 @@ struct GCCCompilerUtil : public CPPCompilerBaseUtil static SlangResult calcCompileProducts(const CompileOptions& options, ProductFlags flags, List<String>& outPaths); }; -class GCCCPPCompiler : public CommandLineCPPCompiler +class GCCDownstreamCompiler : public CommandLineDownstreamCompiler { public: - typedef CommandLineCPPCompiler Super; - typedef GCCCompilerUtil Util; + typedef CommandLineDownstreamCompiler Super; + typedef GCCDownstreamCompilerUtil Util; // CommandLineCPPCompiler impl - just forwards to the Util virtual SlangResult calcArgs(const CompileOptions& options, CommandLine& cmdLine) SLANG_OVERRIDE { return Util::calcArgs(options, cmdLine); } - virtual SlangResult parseOutput(const ExecuteResult& exeResult, Output& output) SLANG_OVERRIDE { return Util::parseOutput(exeResult, output); } + virtual SlangResult parseOutput(const ExecuteResult& exeResult, DownstreamDiagnostics& output) SLANG_OVERRIDE { return Util::parseOutput(exeResult, output); } virtual SlangResult calcModuleFilePath(const CompileOptions& options, StringBuilder& outPath) SLANG_OVERRIDE { return Util::calcModuleFilePath(options, outPath); } virtual SlangResult calcCompileProducts(const CompileOptions& options, ProductFlags flags, List<String>& outPaths) SLANG_OVERRIDE { return Util::calcCompileProducts(options, flags, outPaths); } - GCCCPPCompiler(const Desc& desc):Super(desc) {} + GCCDownstreamCompiler(const Desc& desc):Super(desc) {} }; } |
