summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/core/slang-cpp-compiler.cpp50
-rw-r--r--source/core/slang-cpp-compiler.h33
-rw-r--r--source/core/slang-gcc-compiler-util.cpp80
-rw-r--r--source/core/slang-visual-studio-compiler-util.cpp44
-rw-r--r--source/slang/slang-compiler.cpp22
-rw-r--r--tools/slang-test/slang-test-main.cpp6
6 files changed, 119 insertions, 116 deletions
diff --git a/source/core/slang-cpp-compiler.cpp b/source/core/slang-cpp-compiler.cpp
index 153018527..7ae474fe7 100644
--- a/source/core/slang-cpp-compiler.cpp
+++ b/source/core/slang-cpp-compiler.cpp
@@ -32,9 +32,9 @@ void CPPCompiler::Desc::appendAsText(StringBuilder& out) const
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CPPCompiler::OutputMessage !!!!!!!!!!!!!!!!!!!!!!*/
-/* static */UnownedStringSlice CPPCompiler::OutputMessage::getTypeText(OutputMessage::Type type)
+/* static */UnownedStringSlice CPPCompiler::Diagnostic::getTypeText(Diagnostic::Type type)
{
- typedef OutputMessage::Type Type;
+ typedef Diagnostic::Type Type;
switch (type)
{
default: return UnownedStringSlice::fromLiteral("Unknown");
@@ -62,66 +62,66 @@ void CPPCompiler::Desc::appendAsText(StringBuilder& out) const
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CPPCompiler::Output !!!!!!!!!!!!!!!!!!!!!!*/
-Index CPPCompiler::Output::getCountByType(OutputMessage::Type type) const
+Index CPPCompiler::Output::getCountByType(Diagnostic::Type type) const
{
Index count = 0;
- for (const auto& msg : messages)
+ for (const auto& msg : diagnostics)
{
count += Index(msg.type == type);
}
return count;
}
-Int CPPCompiler::Output::countByStage(OutputMessage::Stage stage, Index counts[Int(OutputMessage::Type::CountOf)]) const
+Int CPPCompiler::Output::countByStage(Diagnostic::Stage stage, Index counts[Int(Diagnostic::Type::CountOf)]) const
{
Int count = 0;
- ::memset(counts, 0, sizeof(Index) * Int(OutputMessage::Type::CountOf));
- for (const auto& msg : messages)
+ ::memset(counts, 0, sizeof(Index) * Int(Diagnostic::Type::CountOf));
+ for (const auto& diagnostic : diagnostics)
{
- if (msg.stage == stage)
+ if (diagnostic.stage == stage)
{
count++;
- counts[Index(msg.type)]++;
+ counts[Index(diagnostic.type)]++;
}
}
return count++;
}
-static void _appendCounts(const Index counts[Int(CPPCompiler::OutputMessage::Type::CountOf)], StringBuilder& out)
+static void _appendCounts(const Index counts[Int(CPPCompiler::Diagnostic::Type::CountOf)], StringBuilder& out)
{
- typedef CPPCompiler::OutputMessage::Type Type;
+ typedef CPPCompiler::Diagnostic::Type Type;
for (Index i = 0; i < Int(Type::CountOf); i++)
{
if (counts[i] > 0)
{
- out << CPPCompiler::OutputMessage::getTypeText(Type(i)) << "(" << counts[i] << ") ";
+ out << CPPCompiler::Diagnostic::getTypeText(Type(i)) << "(" << counts[i] << ") ";
}
}
}
-static void _appendSimplified(const Index counts[Int(CPPCompiler::OutputMessage::Type::CountOf)], StringBuilder& out)
+static void _appendSimplified(const Index counts[Int(CPPCompiler::Diagnostic::Type::CountOf)], StringBuilder& out)
{
- typedef CPPCompiler::OutputMessage::Type Type;
+ typedef CPPCompiler::Diagnostic::Type Type;
for (Index i = 0; i < Int(Type::CountOf); i++)
{
if (counts[i] > 0)
{
- out << CPPCompiler::OutputMessage::getTypeText(Type(i)) << " ";
+ out << CPPCompiler::Diagnostic::getTypeText(Type(i)) << " ";
}
}
}
void CPPCompiler::Output::appendSummary(StringBuilder& out) const
{
- Index counts[Int(OutputMessage::Type::CountOf)];
- if (countByStage(OutputMessage::Stage::Compile, counts) > 0)
+ Index counts[Int(Diagnostic::Type::CountOf)];
+ if (countByStage(Diagnostic::Stage::Compile, counts) > 0)
{
out << "Compile: ";
_appendCounts(counts, out);
out << "\n";
}
- if (countByStage(OutputMessage::Stage::Link, counts) > 0)
+ if (countByStage(Diagnostic::Stage::Link, counts) > 0)
{
out << "Link: ";
_appendCounts(counts, out);
@@ -131,14 +131,14 @@ void CPPCompiler::Output::appendSummary(StringBuilder& out) const
void CPPCompiler::Output::appendSimplifiedSummary(StringBuilder& out) const
{
- Index counts[Int(OutputMessage::Type::CountOf)];
- if (countByStage(OutputMessage::Stage::Compile, counts) > 0)
+ Index counts[Int(Diagnostic::Type::CountOf)];
+ if (countByStage(Diagnostic::Stage::Compile, counts) > 0)
{
out << "Compile: ";
_appendSimplified(counts, out);
out << "\n";
}
- if (countByStage(OutputMessage::Stage::Link, counts) > 0)
+ if (countByStage(Diagnostic::Stage::Link, counts) > 0)
{
out << "Link: ";
_appendSimplified(counts, out);
@@ -146,14 +146,14 @@ void CPPCompiler::Output::appendSimplifiedSummary(StringBuilder& out) const
}
}
-void CPPCompiler::Output::removeByType(OutputMessage::Type type)
+void CPPCompiler::Output::removeByType(Diagnostic::Type type)
{
- Index count = messages.getCount();
+ Index count = diagnostics.getCount();
for (Index i = 0; i < count; ++i)
{
- if (messages[i].type == type)
+ if (diagnostics[i].type == type)
{
- messages.removeAt(i);
+ diagnostics.removeAt(i);
i--;
count--;
}
diff --git a/source/core/slang-cpp-compiler.h b/source/core/slang-cpp-compiler.h
index d87ed63dc..22c17606a 100644
--- a/source/core/slang-cpp-compiler.h
+++ b/source/core/slang-cpp-compiler.h
@@ -119,7 +119,7 @@ public:
List<String> libraryPaths;
};
- struct OutputMessage
+ struct Diagnostic
{
enum class Type
{
@@ -141,7 +141,7 @@ public:
stage = Stage::Compile;
fileLine = 0;
}
- static UnownedStringSlice getTypeText(OutputMessage::Type type);
+ static UnownedStringSlice getTypeText(Diagnostic::Type type);
Type type; ///< The type of error
@@ -160,7 +160,10 @@ public:
Debug = 0x1, ///< Used by debugger during execution
Execution = 0x2, ///< Required for execution
Compile = 0x4, ///< A product *required* for compilation
- Miscellaneous = 0x8, ///< Anything else
+ Miscellaneous = 0x8, ///< Anything else
+ };
+ enum Mask : ProductFlags
+ {
All = 0xf, ///< All the flags
};
};
@@ -176,28 +179,28 @@ public:
struct Output
{
/// Reset to an initial empty state
- void reset() { messages.clear(); rawMessages = String(); result = SLANG_OK; }
+ void reset() { diagnostics.clear(); rawDiagnostics = String(); result = SLANG_OK; }
- /// Get the number of messages by type
- Index getCountByType(OutputMessage::Type type) const;
- /// True if there are any messages of the type
- bool has(OutputMessage::Type type) const { return getCountByType(type) > 0; }
+ /// Get the number of diagnostics by type
+ Index getCountByType(Diagnostic::Type type) const;
+ /// True if there are any diagnostics of the type
+ bool has(Diagnostic::Type type) const { return getCountByType(type) > 0; }
- /// Stores in outCounts, the amount of messages for the stage of each type
- Int countByStage(OutputMessage::Stage stage, Index outCounts[Int(OutputMessage::Type::CountOf)]) const;
+ /// Stores in outCounts, the amount of diagnostics for the stage of each type
+ Int countByStage(Diagnostic::Stage stage, Index outCounts[Int(Diagnostic::Type::CountOf)]) const;
/// Append a summary to out
void appendSummary(StringBuilder& out) const;
/// Appends a summary that just identifies if there is an error of a type (not a count)
void appendSimplifiedSummary(StringBuilder& out) const;
- /// Remove all messages of the type
- void removeByType(OutputMessage::Type type);
+ /// Remove all diagnostics of the type
+ void removeByType(Diagnostic::Type type);
- String rawMessages;
+ String rawDiagnostics;
SlangResult result;
- List<OutputMessage> messages;
+ List<Diagnostic> diagnostics;
};
/// Get the desc of this compiler
@@ -296,7 +299,7 @@ struct CPPCompilerBaseUtil
typedef CPPCompiler::SourceType SourceType;
typedef CPPCompiler::CompilerType CompilerType;
- typedef CPPCompiler::OutputMessage OutputMessage;
+ typedef CPPCompiler::Diagnostic Diagnostic;
typedef CPPCompiler::FloatingPointMode FloatingPointMode;
typedef CPPCompiler::ProductFlag ProductFlag;
typedef CPPCompiler::ProductFlags ProductFlags;
diff --git a/source/core/slang-gcc-compiler-util.cpp b/source/core/slang-gcc-compiler-util.cpp
index b7cc85cb3..21b55e686 100644
--- a/source/core/slang-gcc-compiler-util.cpp
+++ b/source/core/slang-gcc-compiler-util.cpp
@@ -92,9 +92,9 @@ SlangResult GCCCompilerUtil::calcVersion(const String& exeName, CPPCompiler::Des
return SLANG_FAIL;
}
-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")
{
@@ -127,10 +127,10 @@ enum class LineParseResult
} // anonymous
-static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParseResult& outLineParseResult, CPPCompiler::OutputMessage& outMsg)
+static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParseResult& outLineParseResult, CPPCompiler::Diagnostic& outDiagnostic)
{
- typedef CPPCompiler::OutputMessage OutputMessage;
- typedef OutputMessage::Type Type;
+ typedef CPPCompiler::Diagnostic Diagnostic;
+ typedef Diagnostic::Type Type;
// Set to default case
outLineParseResult = LineParseResult::Ignore;
@@ -167,7 +167,7 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
/home/travis/build/shader-slang/slang/tests/cpp-compiler/c-compile-link-error.c:10: undefined reference to `thing'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)*/
- outMsg.stage = OutputMessage::Stage::Compile;
+ outDiagnostic.stage = Diagnostic::Stage::Compile;
List<UnownedStringSlice> split;
StringUtil::split(line, ':', split);
@@ -178,18 +178,18 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
if (split0 == UnownedStringSlice::fromLiteral("ld"))
{
// We'll ignore for now
- outMsg.stage = OutputMessage::Stage::Link;
- outMsg.type = Type::Info;
- outMsg.text = split[1].trim();
+ outDiagnostic.stage = Diagnostic::Stage::Link;
+ outDiagnostic.type = Type::Info;
+ outDiagnostic.text = split[1].trim();
outLineParseResult = LineParseResult::Start;
return SLANG_OK;
}
- if (SLANG_SUCCEEDED(_parseErrorType(split0, outMsg.type)))
+ if (SLANG_SUCCEEDED(_parseErrorType(split0, outDiagnostic.type)))
{
// Command line errors can be just contain 'error:' etc. Can be seen on apple/clang
- outMsg.stage = OutputMessage::Stage::Compile;
- outMsg.text = split[1].trim();
+ outDiagnostic.stage = Diagnostic::Stage::Compile;
+ outDiagnostic.text = split[1].trim();
outLineParseResult = LineParseResult::Single;
return SLANG_OK;
}
@@ -208,32 +208,32 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
split0.startsWith(UnownedStringSlice::fromLiteral("Clang")) )
{
// Extract the type
- SLANG_RETURN_ON_FAIL(_parseErrorType(split[1].trim(), outMsg.type));
+ SLANG_RETURN_ON_FAIL(_parseErrorType(split[1].trim(), outDiagnostic.type));
if (text.startsWith("linker command failed"))
{
- outMsg.stage = OutputMessage::Stage::Link;
+ outDiagnostic.stage = Diagnostic::Stage::Link;
}
- outMsg.text = text;
+ outDiagnostic.text = text;
outLineParseResult = LineParseResult::Start;
return SLANG_OK;
}
else if (split1.startsWith("(.text"))
{
// This is a little weak... but looks like it's a link error
- outMsg.filePath = split[0];
- outMsg.type = Type::Error;
- outMsg.stage = OutputMessage::Stage::Link;
- outMsg.text = text;
+ outDiagnostic.filePath = split[0];
+ outDiagnostic.type = Type::Error;
+ outDiagnostic.stage = Diagnostic::Stage::Link;
+ outDiagnostic.text = text;
outLineParseResult = LineParseResult::Single;
return SLANG_OK;
}
else if (text.startsWith("ld returned"))
{
- outMsg.stage = CPPCompiler::OutputMessage::Stage::Link;
- SLANG_RETURN_ON_FAIL(_parseErrorType(split[1].trim(), outMsg.type));
- outMsg.text = line;
+ outDiagnostic.stage = CPPCompiler::Diagnostic::Stage::Link;
+ SLANG_RETURN_ON_FAIL(_parseErrorType(split[1].trim(), outDiagnostic.type));
+ outDiagnostic.text = line;
outLineParseResult = LineParseResult::Single;
return SLANG_OK;
}
@@ -257,11 +257,11 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
}
else
{
- outMsg.filePath = split[1];
- outMsg.fileLine = 0;
- outMsg.type = OutputMessage::Type::Error;
- outMsg.stage = OutputMessage::Stage::Link;
- outMsg.text = split[3];
+ outDiagnostic.filePath = split[1];
+ outDiagnostic.fileLine = 0;
+ outDiagnostic.type = Diagnostic::Type::Error;
+ outDiagnostic.stage = Diagnostic::Stage::Link;
+ outDiagnostic.text = split[3];
outLineParseResult = LineParseResult::Start;
return SLANG_OK;
@@ -270,11 +270,11 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
else if (split.getCount() == 5)
{
// Probably a regular error line
- SLANG_RETURN_ON_FAIL(_parseErrorType(split[3].trim(), outMsg.type));
+ SLANG_RETURN_ON_FAIL(_parseErrorType(split[3].trim(), outDiagnostic.type));
- outMsg.filePath = split[0];
- SLANG_RETURN_ON_FAIL(StringUtil::parseInt(split[1], outMsg.fileLine));
- outMsg.text = split[4];
+ outDiagnostic.filePath = split[0];
+ SLANG_RETURN_ON_FAIL(StringUtil::parseInt(split[1], outDiagnostic.fileLine));
+ outDiagnostic.text = split[4];
outLineParseResult = LineParseResult::Start;
return SLANG_OK;
@@ -290,30 +290,30 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
LineParseResult prevLineResult = LineParseResult::Ignore;
outOutput.reset();
- outOutput.rawMessages = exeRes.standardError;
+ outOutput.rawDiagnostics = exeRes.standardError;
for (auto line : LineParser(exeRes.standardError.getUnownedSlice()))
{
- CPPCompiler::OutputMessage msg;
- msg.reset();
+ CPPCompiler::Diagnostic diagnostic;
+ diagnostic.reset();
LineParseResult lineRes;
- SLANG_RETURN_ON_FAIL(_parseGCCFamilyLine(line, lineRes, msg));
+ SLANG_RETURN_ON_FAIL(_parseGCCFamilyLine(line, lineRes, diagnostic));
switch (lineRes)
{
case LineParseResult::Start:
{
// It's start of a new message
- outOutput.messages.add(msg);
+ outOutput.diagnostics.add(diagnostic);
prevLineResult = LineParseResult::Start;
break;
}
case LineParseResult::Single:
{
// It's a single message, without anything following
- outOutput.messages.add(msg);
+ outOutput.diagnostics.add(diagnostic);
prevLineResult = LineParseResult::Ignore;
break;
}
@@ -321,10 +321,10 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
{
if (prevLineResult == LineParseResult::Start || prevLineResult == LineParseResult::Continuation)
{
- if (outOutput.messages.getCount() > 0)
+ if (outOutput.diagnostics.getCount() > 0)
{
// We are now in a continuation, add to the last
- auto& text = outOutput.messages.getLast().text;
+ auto& text = outOutput.diagnostics.getLast().text;
text.append("\n");
text.append(line);
}
@@ -341,7 +341,7 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse
}
}
- if (outOutput.has(CPPCompiler::OutputMessage::Type::Error) || exeRes.resultCode != 0)
+ if (outOutput.has(CPPCompiler::Diagnostic::Type::Error) || exeRes.resultCode != 0)
{
outOutput.result = SLANG_FAIL;
}
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;
}
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 5b8643b02..cf708df52 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -1481,15 +1481,15 @@ SlangResult dissassembleDXILUsingDXC(
StringBuilder builder;
- typedef CPPCompiler::OutputMessage OutputMessage;
+ typedef CPPCompiler::Diagnostic Diagnostic;
- for (const auto& msg : output.messages)
+ for (const auto& diagnostic : output.diagnostics)
{
builder.Clear();
- builder << msg.filePath << "(" << msg.fileLine <<"): ";
+ builder << diagnostic.filePath << "(" << diagnostic.fileLine <<"): ";
- if (msg.stage == OutputMessage::Stage::Link)
+ if (diagnostic.stage == Diagnostic::Stage::Link)
{
builder << "link ";
}
@@ -1497,22 +1497,22 @@ SlangResult dissassembleDXILUsingDXC(
//
Severity severity = Severity::Error;
- switch (msg.type)
+ switch (diagnostic.type)
{
- case OutputMessage::Type::Unknown:
- case OutputMessage::Type::Error:
+ case Diagnostic::Type::Unknown:
+ case Diagnostic::Type::Error:
{
severity = Severity::Error;
builder << "error";
break;
}
- case OutputMessage::Type::Warning:
+ case Diagnostic::Type::Warning:
{
severity = Severity::Warning;
builder << "warning";
break;
}
- case OutputMessage::Type::Info:
+ case Diagnostic::Type::Info:
{
severity = Severity::Note;
builder << "info";
@@ -1521,14 +1521,14 @@ SlangResult dissassembleDXILUsingDXC(
default: break;
}
- builder << " " << msg.code << ": " << msg.text;
+ builder << " " << diagnostic.code << ": " << diagnostic.text;
reportExternalCompileError(compilerText.getBuffer(), severity, SLANG_OK, builder.getUnownedSlice(), sink);
}
}
// If any errors are emitted, then we are done
- if (output.has(CPPCompiler::OutputMessage::Type::Error))
+ if (output.has(CPPCompiler::Diagnostic::Type::Error))
{
return SLANG_FAIL;
}
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp
index 99a139e3c..4a830fd92 100644
--- a/tools/slang-test/slang-test-main.cpp
+++ b/tools/slang-test/slang-test-main.cpp
@@ -1317,8 +1317,8 @@ static String _calcSummary(const CPPCompiler::Output& inOutput)
CPPCompiler::Output output(inOutput);
// We only want to analyse errors for now
- output.removeByType(CPPCompiler::OutputMessage::Type::Info);
- output.removeByType(CPPCompiler::OutputMessage::Type::Warning);
+ output.removeByType(CPPCompiler::Diagnostic::Type::Info);
+ output.removeByType(CPPCompiler::Diagnostic::Type::Warning);
StringBuilder builder;
@@ -1411,7 +1411,7 @@ static TestResult runCPPCompilerCompile(TestContext* context, TestInput& input)
return TestResult::Fail;
}
- if (output.getCountByType(CPPCompiler::OutputMessage::Type::Error) > 0)
+ if (output.getCountByType(CPPCompiler::Diagnostic::Type::Error) > 0)
{
return TestResult::Fail;
}