diff options
Diffstat (limited to 'source/compiler-core/slang-gcc-compiler-util.cpp')
| -rw-r--r-- | source/compiler-core/slang-gcc-compiler-util.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/compiler-core/slang-gcc-compiler-util.cpp b/source/compiler-core/slang-gcc-compiler-util.cpp index c1e6e8fbc..61cf5640a 100644 --- a/source/compiler-core/slang-gcc-compiler-util.cpp +++ b/source/compiler-core/slang-gcc-compiler-util.cpp @@ -42,7 +42,7 @@ static Index _findVersionEnd(const UnownedStringSlice& in) return len; } -/* static */SlangResult GCCDownstreamCompilerUtil::parseVersion(const UnownedStringSlice& text, const UnownedStringSlice& prefix, DownstreamCompiler::Desc& outDesc) +/* static */SlangResult GCCDownstreamCompilerUtil::parseVersion(const UnownedStringSlice& text, const UnownedStringSlice& prefix, DownstreamCompilerDesc& outDesc) { List<UnownedStringSlice> lines; StringUtil::calcLines(text, lines); @@ -90,7 +90,7 @@ static Index _findVersionEnd(const UnownedStringSlice& in) return SLANG_FAIL; } -SlangResult GCCDownstreamCompilerUtil::calcVersion(const ExecutableLocation& exe, DownstreamCompiler::Desc& outDesc) +SlangResult GCCDownstreamCompilerUtil::calcVersion(const ExecutableLocation& exe, DownstreamCompilerDesc& outDesc) { CommandLine cmdLine; cmdLine.setExecutableLocation(exe); @@ -675,15 +675,16 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse return SLANG_OK; } -/* static */SlangResult GCCDownstreamCompilerUtil::createCompiler(const ExecutableLocation& exe, RefPtr<DownstreamCompiler>& outCompiler) +/* static */SlangResult GCCDownstreamCompilerUtil::createCompiler(const ExecutableLocation& exe, ComPtr<IDownstreamCompiler>& outCompiler) { - DownstreamCompiler::Desc desc; + DownstreamCompilerDesc desc; SLANG_RETURN_ON_FAIL(GCCDownstreamCompilerUtil::calcVersion(exe, desc)); - RefPtr<CommandLineDownstreamCompiler> compiler(new GCCDownstreamCompiler(desc)); + auto compiler = new GCCDownstreamCompiler(desc); + ComPtr<IDownstreamCompiler> compilerIntf(compiler); compiler->m_cmdLine.setExecutableLocation(exe); - outCompiler = compiler; + outCompiler.swap(compilerIntf); return SLANG_OK; } @@ -691,7 +692,7 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse { SLANG_UNUSED(loader); - RefPtr<DownstreamCompiler> compiler; + ComPtr<IDownstreamCompiler> compiler; if (SLANG_SUCCEEDED(createCompiler(ExecutableLocation(path, "g++"), compiler))) { // A downstream compiler for Slang must currently support C++14 - such that @@ -719,7 +720,7 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse { SLANG_UNUSED(loader); - RefPtr<DownstreamCompiler> compiler; + ComPtr<IDownstreamCompiler> compiler; if (SLANG_SUCCEEDED(createCompiler(ExecutableLocation(path, "clang"), compiler))) { set->addCompiler(compiler); |
