[PATCH] D145553: [Tooling/Inclusion] Add missing placerholder _1 symbols.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 00:51:22 PST 2023


hokein created this revision.
hokein added a reviewer: kadircet.
Herald added a project: All.
hokein requested review of this revision.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145553

Files:
  clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
  clang/tools/include-mapping/gen_std.py


Index: clang/tools/include-mapping/gen_std.py
===================================================================
--- clang/tools/include-mapping/gen_std.py
+++ clang/tools/include-mapping/gen_std.py
@@ -245,9 +245,8 @@
       # We don't index std literal operators (e.g.
       # std::literals::chrono_literals::operator""d), these symbols can't be
       # accessed by std::<symbol_name>.
-      # FIXME: index std::placeholders symbols, placeholders.html page is
-      # different (which contains one entry for _1, _2, ..., _N), we need special
-      # handling.
+      #
+      # std::placeholders symbols are handled manually in StdSpecialSymbolMap.inc
       (symbol_index_root, "chrono.html", "std::chrono::"),
       (symbol_index_root, "filesystem.html", "std::filesystem::"),
       (symbol_index_root, "pmr.html", "std::pmr::"),
Index: clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
===================================================================
--- clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
+++ clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
@@ -254,6 +254,21 @@
 SYMBOL(make_index_sequence, std::, <utility>)
 SYMBOL(make_integer_sequence, std::, <utility>)
 
+// The std::placeholder symbols (_1, ..., _N) are listed in the cppreference
+// placeholder.html, but the index only contains a single entry with "_1, _2, ..., _N"
+// text, which are not handled by the script.
+// N is an implementation-defined number, 10 should be enough in practice.
+SYMBOL(_1, std::placeholders::, <functional>)
+SYMBOL(_2, std::placeholders::, <functional>)
+SYMBOL(_3, std::placeholders::, <functional>)
+SYMBOL(_4, std::placeholders::, <functional>)
+SYMBOL(_5, std::placeholders::, <functional>)
+SYMBOL(_6, std::placeholders::, <functional>)
+SYMBOL(_7, std::placeholders::, <functional>)
+SYMBOL(_8, std::placeholders::, <functional>)
+SYMBOL(_9, std::placeholders::, <functional>)
+SYMBOL(_10, std::placeholders::, <functional>)
+
 // Macros
 SYMBOL(NULL, None, <cstddef>)
 SYMBOL(NULL, None, <stddef.h>)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145553.503254.patch
Type: text/x-patch
Size: 2060 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230308/cebd9960/attachment.bin>


More information about the cfe-commits mailing list