[PATCH] D143280: [include-mapping] Better #includes support for std input/output symbols
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 6 01:37:20 PST 2023
kadircet added inline comments.
================
Comment at: clang/tools/include-mapping/gen_std.py:160
+ headers = [sym_header]
+ if symbol.name in iosfwd_symbols:
+ headers.append("<iosfwd>")
----------------
i think putting `iostream` before `iosfwd` in the alternative list makes more sense. WDYT?
================
Comment at: clang/tools/include-mapping/gen_std.py:212
# SYMBOL(unqualified_name, namespace, header)
- print("SYMBOL(%s, %s, %s)" % (symbol.name, symbol.namespace,
- symbol.headers[0]))
+ for header in AdditionalHeadersForIOSymbols(symbol):
+ print("SYMBOL(%s, %s, %s)" % (symbol.name, symbol.namespace,
----------------
what about changing this to:
```
symbol.headers.extend(AdditionalHeadersForIOSymbols(symbol))
for header in symbol.headers:
....
```
(and also changing `AdditionalHeadersForIOSymbols` to only return additional headers and an empty list if there's none)
that way it'll be easier to augment symbol headers later on.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143280/new/
https://reviews.llvm.org/D143280
More information about the cfe-commits
mailing list