Skip to content

Commit

Permalink
[clang-tidy][NFC] Fix modernize-raw-string-literal findings
Browse files Browse the repository at this point in the history
Fix issues found by clang-tidy in clang-tidy source directory.
  • Loading branch information
PiotrZSL committed Aug 27, 2023
1 parent 4d81b14 commit 9c857f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/ClangTidyProfiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ void ClangTidyProfiling::printUserFriendlyTable(llvm::raw_ostream &OS) {

void ClangTidyProfiling::printAsJSON(llvm::raw_ostream &OS) {
OS << "{\n";
OS << "\"file\": \"" << Storage->SourceFilename << "\",\n";
OS << "\"timestamp\": \"" << Storage->Timestamp << "\",\n";
OS << R"("file": ")" << Storage->SourceFilename << "\",\n";
OS << R"("timestamp": ")" << Storage->Timestamp << "\",\n";
OS << "\"profile\": {\n";
TG->printJSONValues(OS, "");
OS << "\n}\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ static void insertNullTerminatorExpr(StringRef Name,
(Twine('\n') + SpaceBeforeStmtStr +
exprToStr(Result.Nodes.getNodeAs<Expr>(DestExprName), Result) + "[" +
exprToStr(Result.Nodes.getNodeAs<Expr>(LengthExprName), Result) +
"] = " + ((Name[0] != 'w') ? "\'\\0\';" : "L\'\\0\';"))
"] = " + ((Name[0] != 'w') ? R"('\0';)" : R"(L'\0';)"))
.str();

const auto AddNullTerminatorExprFix = FixItHint::CreateInsertion(
Expand Down

0 comments on commit 9c857f2

Please sign in to comment.