From 79ec0cfdb5f3461c763e0bf712cf42eb87fccb90 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 10 Dec 2019 10:02:19 -0500 Subject: 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. --- source/core/slang-gcc-compiler-util.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/core/slang-gcc-compiler-util.h') 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& 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& outPaths) SLANG_OVERRIDE { return Util::calcCompileProducts(options, flags, outPaths); } - GCCCPPCompiler(const Desc& desc):Super(desc) {} + GCCDownstreamCompiler(const Desc& desc):Super(desc) {} }; } -- cgit v1.2.3