Skip to content

Commit ee6700f

Browse files
committedAug 17, 2019
[clang-doc] Fix casting not working in gcc 5.4.0
An implicit cast of std::string to llvm::SmallString<> was breaking GCC 5.4.0 builder. A pair using llvm::SmallString<> now uses std::string. Differential Revision: https://reviews.llvm.org/D66378 llvm-svn: 369182
1 parent f92109d commit ee6700f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎clang-tools-extra/clang-doc/HTMLGenerator.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct TagNode : public HTMLNode {
8989

9090
HTMLTag Tag; // Name of HTML Tag (p, div, h1)
9191
std::vector<std::unique_ptr<HTMLNode>> Children; // List of child nodes
92-
std::vector<std::pair<llvm::SmallString<16>, llvm::SmallString<16>>>
92+
std::vector<std::pair<std::string, std::string>>
9393
Attributes; // List of key-value attributes for tag
9494

9595
void Render(llvm::raw_ostream &OS, int IndentationLevel) override;
@@ -278,7 +278,7 @@ genStylesheetsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
278278
llvm::sys::path::filename(FilePath));
279279
// Paths in HTML must be in posix-style
280280
llvm::sys::path::native(StylesheetPath, llvm::sys::path::Style::posix);
281-
LinkNode->Attributes.emplace_back("href", StylesheetPath);
281+
LinkNode->Attributes.emplace_back("href", StylesheetPath.str());
282282
Out.emplace_back(std::move(LinkNode));
283283
}
284284
return Out;
@@ -293,7 +293,7 @@ genJsScriptsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
293293
llvm::sys::path::append(ScriptPath, llvm::sys::path::filename(FilePath));
294294
// Paths in HTML must be in posix-style
295295
llvm::sys::path::native(ScriptPath, llvm::sys::path::Style::posix);
296-
ScriptNode->Attributes.emplace_back("src", ScriptPath);
296+
ScriptNode->Attributes.emplace_back("src", ScriptPath.str());
297297
Out.emplace_back(std::move(ScriptNode));
298298
}
299299
return Out;
@@ -454,7 +454,7 @@ writeFileDefinition(const Location &L,
454454
Node->Children.emplace_back(std::make_unique<TextNode>(" of file "));
455455
auto LocFileNode = std::make_unique<TagNode>(
456456
HTMLTag::TAG_A, llvm::sys::path::filename(FileURL));
457-
LocFileNode->Attributes.emplace_back("href", FileURL);
457+
LocFileNode->Attributes.emplace_back("href", FileURL.str());
458458
Node->Children.emplace_back(std::move(LocFileNode));
459459
return Node;
460460
}

0 commit comments

Comments
 (0)
Please sign in to comment.