[llvm] [Support] Fix CRTP for GraphWriter (NFC) (PR #152811)
Naveen Seth Hanig via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 10 11:51:00 PDT 2025
https://github.com/naveen-seth updated https://github.com/llvm/llvm-project/pull/152811
>From f3a028142da954cffb73777324cfd6a2c4639aee Mon Sep 17 00:00:00 2001
From: Naveen Seth Hanig <naveen.hanig at outlook.com>
Date: Sat, 9 Aug 2025 01:06:04 +0200
Subject: [PATCH] [Support] Fix CRTP for GraphWriter (NFC)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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.
---
llvm/include/llvm/Support/GraphWriter.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h
index af2e5016298e6..a8784edfcf896 100644
--- a/llvm/include/llvm/Support/GraphWriter.h
+++ b/llvm/include/llvm/Support/GraphWriter.h
@@ -62,6 +62,7 @@ LLVM_ABI bool DisplayGraph(StringRef Filename, bool wait = true,
GraphProgram::Name program = GraphProgram::DOT);
template <typename GraphType, typename Derived> class GraphWriterBase {
+protected:
raw_ostream &O;
const GraphType &G;
bool RenderUsingHTML = false;
More information about the llvm-commits
mailing list