[PATCH] D51512: [analyzer] [NFC] Use StringRef when returning a large string literal in HTMLDiagnostics
George Karpenkov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 7 15:18:16 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rC341723: [analyzer] [NFC] Use StringRef when returning a large string literal in… (authored by george.karpenkov, committed by ).
Herald added a subscriber: cfe-commits.
Changed prior to commit:
https://reviews.llvm.org/D51512?vs=163419&id=164527#toc
Repository:
rC Clang
https://reviews.llvm.org/D51512
Files:
lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
Index: lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
===================================================================
--- lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
+++ lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp
@@ -115,12 +115,13 @@
void RewriteFile(Rewriter &R, const SourceManager& SMgr,
const PathPieces& path, FileID FID);
- /// \return Javascript for navigating the HTML report using j/k keys.
- std::string generateKeyboardNavigationJavascript();
private:
/// \return Javascript for displaying shortcuts help;
- std::string showHelpJavascript();
+ StringRef showHelpJavascript();
+
+ /// \return Javascript for navigating the HTML report using j/k keys.
+ StringRef generateKeyboardNavigationJavascript();
};
} // namespace
@@ -571,7 +572,7 @@
html::AddHeaderFooterInternalBuiltinCSS(R, FID, Entry->getName());
}
-std::string HTMLDiagnostics::showHelpJavascript() {
+StringRef HTMLDiagnostics::showHelpJavascript() {
return R"<<<(
<script type='text/javascript'>
@@ -929,7 +930,7 @@
html::HighlightRange(R, InstantiationStart, E, HighlightStart, HighlightEnd);
}
-std::string HTMLDiagnostics::generateKeyboardNavigationJavascript() {
+StringRef HTMLDiagnostics::generateKeyboardNavigationJavascript() {
return R"<<<(
<script type='text/javascript'>
var digitMatcher = new RegExp("[0-9]+");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51512.164527.patch
Type: text/x-patch
Size: 1364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180907/002d0d55/attachment.bin>
More information about the cfe-commits
mailing list