diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-06 09:10:25 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-06 09:10:25 -0800 |
commit | 227078b7136c09f6505dab7972d7b65d5210209d (patch) | |
tree | 0a573bfa4a49908d9c29bda5fc9c7f7b23ce28f7 /llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp | |
parent | b9f3977b26b2cb9452cda98cb4664b6910b2003a (diff) | |
download | llvm-227078b7136c09f6505dab7972d7b65d5210209d.zip llvm-227078b7136c09f6505dab7972d7b65d5210209d.tar.gz llvm-227078b7136c09f6505dab7972d7b65d5210209d.tar.bz2 |
[ADT, Support] Move operator<< to raw_ostream.h (NFC)
Without this patch, operator<< for Optional<T> and std::optional<T>
are in Optional.h. This means that a C++ source file must include
Optional.h even if it just needs to stream std::optional<T> and has
nothing to do with Optional<T>, which is counter-intuitive.
This patch moves the operator<< to raw_ostream.h.
As a bonus, we get to resolve a circular dependency. Optional.h no
longer needs to forward-declare raw_ostream. That is, raw_ostream.h
depends on Optional.h, not vice versa.
As a preparation for this patch, I've checked in
77609717410372e8c43aca49a268511378f58297 to forward-declare
raw_ostream in those header files that were relying on the forward
declaration of raw_ostream in Optional.h.
Differential Revision: https://reviews.llvm.org/D139290
Diffstat (limited to 'llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp')
0 files changed, 0 insertions, 0 deletions