Skip to content

Commit b4bd1a9

Browse files
committed
[Support] Fix CRTP for GraphWriter (NFC)
Commit 474bbc1 forgot to change GraphWriterBase's members from private to protected. Because of this, GraphWriter cant’t be properly partially specialized using CRTP. This commit corrects that, allowing GraphWriterBase to be partially specialized using CRTP as intended.
1 parent f9cb95c commit b4bd1a9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/include/llvm/Support/GraphWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ LLVM_ABI bool DisplayGraph(StringRef Filename, bool wait = true,
6262
GraphProgram::Name program = GraphProgram::DOT);
6363

6464
template <typename GraphType, typename Derived> class GraphWriterBase {
65+
protected:
6566
raw_ostream &O;
6667
const GraphType &G;
6768
bool RenderUsingHTML = false;
@@ -73,6 +74,7 @@ template <typename GraphType, typename Derived> class GraphWriterBase {
7374
using child_iterator = typename GTraits::ChildIteratorType;
7475
DOTTraits DTraits;
7576

77+
private:
7678
static_assert(std::is_pointer_v<NodeRef>,
7779
"FIXME: Currently GraphWriterBase requires the NodeRef type to "
7880
"be a pointer.\nThe pointer usage should be moved to "

0 commit comments

Comments
 (0)