[llvm] 7bf33c8 - [llvm-remarkutil] filter: Fix curses.h namespace pollution (#160802)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 6 15:13:55 PDT 2025
Author: Tobias Stadler
Date: 2025-10-06T15:13:52-07:00
New Revision: 7bf33c88567c0ad34432982ce8925da8092b7983
URL: https://github.com/llvm/llvm-project/commit/7bf33c88567c0ad34432982ce8925da8092b7983
DIFF: https://github.com/llvm/llvm-project/commit/7bf33c88567c0ad34432982ce8925da8092b7983.diff
LOG: [llvm-remarkutil] filter: Fix curses.h namespace pollution (#160802)
Remove the filter namespace, because `filter` is used by `curses.h`,
causing some external build failures
(https://github.com/llvm/llvm-project/pull/159784#discussion_r2380574036).
We don't really need the namespace here anyways, because everything is
static. This was just following what some of the other commands in
llvm-remarkutil are doing.
Added:
Modified:
llvm/tools/llvm-remarkutil/RemarkFilter.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-remarkutil/RemarkFilter.cpp b/llvm/tools/llvm-remarkutil/RemarkFilter.cpp
index acfef6608677c..507ae36f4a594 100644
--- a/llvm/tools/llvm-remarkutil/RemarkFilter.cpp
+++ b/llvm/tools/llvm-remarkutil/RemarkFilter.cpp
@@ -20,7 +20,9 @@ using namespace llvm;
using namespace remarks;
using namespace llvm::remarkutil;
-namespace filter {
+// Note: Avoid using the identifier "filter" in this file, as it is prone to
+// namespace collision with headers that might get included e.g.
+// curses.h.
static cl::SubCommand FilterSub("filter",
"Filter remarks based on specified criteria.");
@@ -80,5 +82,3 @@ static Error tryFilter() {
}
static CommandRegistration FilterReg(&FilterSub, tryFilter);
-
-} // namespace filter
More information about the llvm-commits
mailing list