summaryrefslogtreecommitdiffstats
path: root/source/core/slang-visual-studio-compiler-util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/slang-visual-studio-compiler-util.cpp')
-rw-r--r--source/core/slang-visual-studio-compiler-util.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/source/core/slang-visual-studio-compiler-util.cpp b/source/core/slang-visual-studio-compiler-util.cpp
index 4b1e08026..48ef108e4 100644
--- a/source/core/slang-visual-studio-compiler-util.cpp
+++ b/source/core/slang-visual-studio-compiler-util.cpp
@@ -232,9 +232,9 @@ namespace Slang
return SLANG_OK;
}
-static SlangResult _parseErrorType(const UnownedStringSlice& in, CPPCompiler::OutputMessage::Type& outType)
+static SlangResult _parseErrorType(const UnownedStringSlice& in, CPPCompiler::Diagnostic::Type& outType)
{
- typedef CPPCompiler::OutputMessage::Type Type;
+ typedef CPPCompiler::Diagnostic::Type Type;
if (in == "error" || in == "fatal error")
{
@@ -255,22 +255,22 @@ static SlangResult _parseErrorType(const UnownedStringSlice& in, CPPCompiler::Ou
return SLANG_OK;
}
-static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCompiler::OutputMessage& outMsg)
+static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCompiler::Diagnostic& outDiagnostic)
{
- typedef CPPCompiler::OutputMessage OutputMessage;
+ typedef CPPCompiler::Diagnostic Diagnostic;
UnownedStringSlice linkPrefix = UnownedStringSlice::fromLiteral("LINK :");
if (line.startsWith(linkPrefix))
{
- outMsg.stage = OutputMessage::Stage::Link;
- outMsg.type = OutputMessage::Type::Info;
+ outDiagnostic.stage = Diagnostic::Stage::Link;
+ outDiagnostic.type = Diagnostic::Type::Info;
- outMsg.text = UnownedStringSlice(line.begin() + linkPrefix.size(), line.end());
+ outDiagnostic.text = UnownedStringSlice(line.begin() + linkPrefix.size(), line.end());
return SLANG_OK;
}
- outMsg.stage = OutputMessage::Stage::Compile;
+ outDiagnostic.stage = Diagnostic::Stage::Compile;
const char*const start = line.begin();
const char*const end = line.end();
@@ -329,13 +329,13 @@ static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCom
return SLANG_FAIL;
}
- outMsg.filePath = UnownedStringSlice(start, lineNoStart);
- outMsg.fileLine = lineNo;
+ outDiagnostic.filePath = UnownedStringSlice(start, lineNoStart);
+ outDiagnostic.fileLine = lineNo;
}
else
{
- outMsg.filePath = UnownedStringSlice(start, cur + colonIndex);
- outMsg.fileLine = 0;
+ outDiagnostic.filePath = UnownedStringSlice(start, cur + colonIndex);
+ outDiagnostic.fileLine = 0;
}
// Save the remaining text in 'postPath'
@@ -361,20 +361,20 @@ static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCom
}
// Extract the code
- outMsg.code = UnownedStringSlice(errorSection.begin() + errorCodeIndex + 1, errorSection.end());
- if (outMsg.code.startsWith(UnownedStringSlice::fromLiteral("LNK")))
+ outDiagnostic.code = UnownedStringSlice(errorSection.begin() + errorCodeIndex + 1, errorSection.end());
+ if (outDiagnostic.code.startsWith(UnownedStringSlice::fromLiteral("LNK")))
{
- outMsg.stage = OutputMessage::Stage::Link;
+ outDiagnostic.stage = Diagnostic::Stage::Link;
}
// Extract the bit before the code
- SLANG_RETURN_ON_FAIL(_parseErrorType(UnownedStringSlice(errorSection.begin(), errorSection.begin() + errorCodeIndex).trim(), outMsg.type));
+ SLANG_RETURN_ON_FAIL(_parseErrorType(UnownedStringSlice(errorSection.begin(), errorSection.begin() + errorCodeIndex).trim(), outDiagnostic.type));
// Link codes start with LNK prefix
postError = UnownedStringSlice(postPath.begin() + errorColonIndex + 1, end);
}
- outMsg.text = postError;
+ outDiagnostic.text = postError;
return SLANG_OK;
}
@@ -383,7 +383,7 @@ static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCom
{
outOutput.reset();
- outOutput.rawMessages = exeRes.standardOutput;
+ outOutput.rawDiagnostics = exeRes.standardOutput;
for (auto line : LineParser(exeRes.standardOutput.getUnownedSlice()))
{
@@ -392,15 +392,15 @@ static SlangResult _parseVisualStudioLine(const UnownedStringSlice& line, CPPCom
fprintf(stdout, "\n");
#endif
- OutputMessage msg;
- if (SLANG_SUCCEEDED(_parseVisualStudioLine(line, msg)))
+ CPPCompiler::Diagnostic diagnostic;
+ if (SLANG_SUCCEEDED(_parseVisualStudioLine(line, diagnostic)))
{
- outOutput.messages.add(msg);
+ outOutput.diagnostics.add(diagnostic);
}
}
// if it has a compilation error.. set on output
- if (outOutput.has(OutputMessage::Type::Error))
+ if (outOutput.has(CPPCompiler::Diagnostic::Type::Error))
{
outOutput.result = SLANG_FAIL;
}