HTML(HTMLGenerator::Format,
"Generator for HTML output.");
-// This anchor is used to force the linker to link in the generated object file
-// and thus register the generator.
+// This anchor is used to force the linker to link in the generated object
+// file and thus register the generator.
volatile int HTMLGeneratorAnchorSource = 0;
} // namespace doc
Index: clang-tools-extra/clang-doc/MDGenerator.cpp
===================================================================
--- clang-tools-extra/clang-doc/MDGenerator.cpp
+++ clang-tools-extra/clang-doc/MDGenerator.cpp
@@ -28,23 +28,23 @@
return "[" + Text.str() + "](" + Link.str() + ")";
}
-static void writeLine(const Twine &Text, raw_ostream &OS) {
+void writeLine(const Twine &Text, raw_ostream &OS) {
OS << Text << "\n\n";
}
-static void writeNewLine(raw_ostream &OS) { OS << "\n\n"; }
+void writeNewLine(raw_ostream &OS) { OS << "\n\n"; }
-static void writeHeader(const Twine &Text, unsigned int Num, raw_ostream &OS) {
+void writeHeader(const Twine &Text, unsigned int Num, raw_ostream &OS) {
OS << std::string(Num, '#') + " " + Text << "\n\n";
}
-static void writeFileDefinition(const Location &L, raw_ostream &OS) {
+void writeFileDefinition(const Location &L, raw_ostream &OS) {
OS << genItalic("Defined at line " + std::to_string(L.LineNumber) + " of " +
L.Filename)
<< "\n\n";
}
-static void writeDescription(const CommentInfo &I, raw_ostream &OS) {
+void writeDescription(const CommentInfo &I, raw_ostream &OS) {
if (I.Kind == "FullComment") {
for (const auto &Child : I.Children)
writeDescription(*Child, OS);
Index: clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
+++ clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp
@@ -40,16 +40,31 @@
llvm::raw_string_ostream Actual(Buffer);
auto Err = G->generateDocForInfo(&I, Actual);
assert(!Err);
- std::string Expected = R"raw(namespace Namespace
-Namespaces
-ChildNamespace
-Records
-ChildStruct
-Functions
-OneFunction
- OneFunction()
-Enums
-enum OneEnum
+ std::string Expected = R"raw(
+
+namespace Namespace
+
+
namespace Namespace
+
Namespaces
+
+
Records
+
+
Functions
+
+
OneFunction
+
+ OneFunction()
+
+
+
Enums
+
+
enum OneEnum
+
+
)raw";
EXPECT_EQ(Expected, Actual.str());
@@ -80,18 +95,37 @@
llvm::raw_string_ostream Actual(Buffer);
auto Err = G->generateDocForInfo(&I, Actual);
assert(!Err);
- std::string Expected = R"raw(class r
-Defined at line 10 of test.cpp
-Inherits from F, G
-Members
-private int X
-Records
-ChildStruct
-Functions
-OneFunction
- OneFunction()
-Enums
-enum OneEnum
+ std::string Expected = R"raw(
+
+class r
+
+
class r
+
+ Defined at line 10 of test.cpp
+
+
+ Inherits from F, G
+
+
Members
+
+
Records
+
+
Functions
+
+
OneFunction
+
+ OneFunction()
+
+
+
Enums
+
+
enum OneEnum
+
+
)raw";
EXPECT_EQ(Expected, Actual.str());
@@ -116,9 +150,18 @@
llvm::raw_string_ostream Actual(Buffer);
auto Err = G->generateDocForInfo(&I, Actual);
assert(!Err);
- std::string Expected = R"raw(f
-void f(int P)
-Defined at line 10 of test.cpp
+ std::string Expected = R"raw(
+
+
+
+
f
+
+ void f(int P)
+
+
+ Defined at line 10 of test.cpp
+
+
)raw";
EXPECT_EQ(Expected, Actual.str());
@@ -141,11 +184,18 @@
llvm::raw_string_ostream Actual(Buffer);
auto Err = G->generateDocForInfo(&I, Actual);
assert(!Err);
- std::string Expected = R"raw(enum class e
-
-Defined at line 10 of test.cpp
+ std::string Expected = R"raw(
+
+
+
+
enum class e
+
+
+ Defined at line 10 of test.cpp
+
+
)raw";
EXPECT_EQ(Expected, Actual.str());
@@ -194,12 +244,29 @@
llvm::raw_string_ostream Actual(Buffer);
auto Err = G->generateDocForInfo(&I, Actual);
assert(!Err);
- std::string Expected = R"raw(f
-void f(int I, int J)
-Defined at line 10 of test.cpp
-
- Brief description.
- Extended description that continues onto the next line.
+ std::string Expected = R"raw(
+
+
+
+
f
+
+ void f(int I, int J)
+
+
+ Defined at line 10 of test.cpp
+
+
+
+
+ Brief description.
+
+
+ Extended description that
+ continues onto the next line.
+
+
+
+
)raw";
EXPECT_EQ(Expected, Actual.str());