[clang] 404b1b2 - [Tooling/Inclusion] Add missing placerholder _1 symbols.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 9 00:20:52 PST 2023


Author: Haojian Wu
Date: 2023-03-09T09:20:42+01:00
New Revision: 404b1b2ed42f6138a0e91b337150a90108c1b155

URL: https://github.com/llvm/llvm-project/commit/404b1b2ed42f6138a0e91b337150a90108c1b155
DIFF: https://github.com/llvm/llvm-project/commit/404b1b2ed42f6138a0e91b337150a90108c1b155.diff

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

Differential Revision: https://reviews.llvm.org/D145553

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc b/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
index ecdcfee35128b..aa2227b646774 100644
--- a/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
+++ b/clang/lib/Tooling/Inclusions/Stdlib/StdSpecialSymbolMap.inc
@@ -254,6 +254,40 @@ SYMBOL(index_sequence_for, std::, <utility>)
 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 for libc++; 29 for libstdc++).
+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>)
+SYMBOL(_11, std::placeholders::, <functional>)
+SYMBOL(_12, std::placeholders::, <functional>)
+SYMBOL(_13, std::placeholders::, <functional>)
+SYMBOL(_14, std::placeholders::, <functional>)
+SYMBOL(_15, std::placeholders::, <functional>)
+SYMBOL(_16, std::placeholders::, <functional>)
+SYMBOL(_17, std::placeholders::, <functional>)
+SYMBOL(_18, std::placeholders::, <functional>)
+SYMBOL(_19, std::placeholders::, <functional>)
+SYMBOL(_20, std::placeholders::, <functional>)
+SYMBOL(_21, std::placeholders::, <functional>)
+SYMBOL(_22, std::placeholders::, <functional>)
+SYMBOL(_23, std::placeholders::, <functional>)
+SYMBOL(_24, std::placeholders::, <functional>)
+SYMBOL(_25, std::placeholders::, <functional>)
+SYMBOL(_26, std::placeholders::, <functional>)
+SYMBOL(_27, std::placeholders::, <functional>)
+SYMBOL(_28, std::placeholders::, <functional>)
+SYMBOL(_29, std::placeholders::, <functional>)
+
 // Macros
 SYMBOL(NULL, None, <cstddef>)
 SYMBOL(NULL, None, <stddef.h>)

diff  --git a/clang/tools/include-mapping/gen_std.py b/clang/tools/include-mapping/gen_std.py
index 291946ef5378b..45ae60fc6f000 100755
--- a/clang/tools/include-mapping/gen_std.py
+++ b/clang/tools/include-mapping/gen_std.py
@@ -245,9 +245,8 @@ def main():
       # 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
-      # 
diff erent (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::"),


        


More information about the cfe-commits mailing list