diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /clang/lib/Frontend/LogDiagnosticPrinter.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'clang/lib/Frontend/LogDiagnosticPrinter.cpp')
-rw-r--r-- | clang/lib/Frontend/LogDiagnosticPrinter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Frontend/LogDiagnosticPrinter.cpp b/clang/lib/Frontend/LogDiagnosticPrinter.cpp index 4bac17553999d..df8b23691a7d3 100644 --- a/clang/lib/Frontend/LogDiagnosticPrinter.cpp +++ b/clang/lib/Frontend/LogDiagnosticPrinter.cpp @@ -120,7 +120,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, if (FID.isValid()) { const FileEntry *FE = SM.getFileEntryForID(FID); if (FE && FE->isValid()) - MainFilename = FE->getName(); + MainFilename = std::string(FE->getName()); } } @@ -129,12 +129,13 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, DE.DiagnosticID = Info.getID(); DE.DiagnosticLevel = Level; - DE.WarningOption = DiagnosticIDs::getWarningOptionForDiag(DE.DiagnosticID); + DE.WarningOption = + std::string(DiagnosticIDs::getWarningOptionForDiag(DE.DiagnosticID)); // Format the message. SmallString<100> MessageStr; Info.FormatDiagnostic(MessageStr); - DE.Message = MessageStr.str(); + DE.Message = std::string(MessageStr.str()); // Set the location information. DE.Filename = ""; @@ -149,7 +150,7 @@ void LogDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, if (FID.isValid()) { const FileEntry *FE = SM.getFileEntryForID(FID); if (FE && FE->isValid()) - DE.Filename = FE->getName(); + DE.Filename = std::string(FE->getName()); } } else { DE.Filename = PLoc.getFilename(); |