Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Adds more forward declaration headers.
The module validation script of D144994 validate whether the contents of an include match its module. An include is the set of files matching the pattern: - foo - foo/*. - __fwd/foo.h Several declarations of the stream headers are in the header iosfwd. This gives issue using the validation script. Adding iosfwd to the set of matching files gives too many declarations. For example when validating the fstream header it will pull in declarations of the istream header. Instead if writing a set of filters the headers are granularized into smaller headers containing the expected declarations. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D148927
- Loading branch information
Showing
17 changed files
with
303 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_FSTREAM_H | ||
#define _LIBCPP___FWD_FSTREAM_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_filebuf; | ||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_ifstream; | ||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_ofstream; | ||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_fstream; | ||
|
||
typedef basic_filebuf<char> filebuf; | ||
typedef basic_ifstream<char> ifstream; | ||
typedef basic_ofstream<char> ofstream; | ||
typedef basic_fstream<char> fstream; | ||
|
||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_filebuf<wchar_t> wfilebuf; | ||
typedef basic_ifstream<wchar_t> wifstream; | ||
typedef basic_ofstream<wchar_t> wofstream; | ||
typedef basic_fstream<wchar_t> wfstream; | ||
#endif | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(filebuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfilebuf)) basic_filebuf; | ||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(ifstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wifstream)) basic_ifstream; | ||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(ofstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wofstream)) basic_ofstream; | ||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(fstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wfstream)) basic_fstream; | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_FSTREAM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_IOS_H | ||
#define _LIBCPP___FWD_IOS_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_ios; | ||
|
||
typedef basic_ios<char> ios; | ||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_ios<wchar_t> wios; | ||
#endif | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(ios) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wios)) basic_ios; | ||
|
||
#if defined(_NEWLIB_VERSION) | ||
// On newlib, off_t is 'long int' | ||
typedef long int streamoff; // for char_traits in <string> | ||
#else | ||
typedef long long streamoff; // for char_traits in <string> | ||
#endif | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_IOS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_ISTREAM_H | ||
#define _LIBCPP___FWD_ISTREAM_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_istream; | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_iostream; | ||
|
||
typedef basic_istream<char> istream; | ||
typedef basic_iostream<char> iostream; | ||
|
||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_istream<wchar_t> wistream; | ||
typedef basic_iostream<wchar_t> wiostream; | ||
#endif | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(istream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistream)) basic_istream; | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(iostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wiostream)) basic_iostream; | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_ISTREAM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_OSTREAM_H | ||
#define _LIBCPP___FWD_OSTREAM_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_ostream; | ||
|
||
typedef basic_ostream<char> ostream; | ||
|
||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_ostream<wchar_t> wostream; | ||
#endif | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(ostream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostream)) basic_ostream; | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_OSTREAM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_SSTREAM_H | ||
#define _LIBCPP___FWD_SSTREAM_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT>, | ||
class _Allocator = allocator<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_stringbuf; | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT>, | ||
class _Allocator = allocator<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_istringstream; | ||
template <class _CharT, class _Traits = char_traits<_CharT>, | ||
class _Allocator = allocator<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_ostringstream; | ||
template <class _CharT, class _Traits = char_traits<_CharT>, | ||
class _Allocator = allocator<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_stringstream; | ||
|
||
typedef basic_stringbuf<char> stringbuf; | ||
typedef basic_istringstream<char> istringstream; | ||
typedef basic_ostringstream<char> ostringstream; | ||
typedef basic_stringstream<char> stringstream; | ||
|
||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_stringbuf<wchar_t> wstringbuf; | ||
typedef basic_istringstream<wchar_t> wistringstream; | ||
typedef basic_ostringstream<wchar_t> wostringstream; | ||
typedef basic_stringstream<wchar_t> wstringstream; | ||
#endif | ||
|
||
template <class _CharT, class _Traits, class _Allocator> | ||
class _LIBCPP_PREFERRED_NAME(stringbuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringbuf)) basic_stringbuf; | ||
template <class _CharT, class _Traits, class _Allocator> | ||
class _LIBCPP_PREFERRED_NAME(istringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wistringstream)) basic_istringstream; | ||
template <class _CharT, class _Traits, class _Allocator> | ||
class _LIBCPP_PREFERRED_NAME(ostringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wostringstream)) basic_ostringstream; | ||
template <class _CharT, class _Traits, class _Allocator> | ||
class _LIBCPP_PREFERRED_NAME(stringstream) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstringstream)) basic_stringstream; | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_SSTREAM_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef _LIBCPP___FWD_STREAMBUF_H | ||
#define _LIBCPP___FWD_STREAMBUF_H | ||
|
||
#include <__config> | ||
#include <__fwd/string.h> | ||
|
||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) | ||
# pragma GCC system_header | ||
#endif | ||
|
||
_LIBCPP_BEGIN_NAMESPACE_STD | ||
|
||
template <class _CharT, class _Traits = char_traits<_CharT> > | ||
class _LIBCPP_TEMPLATE_VIS basic_streambuf; | ||
|
||
typedef basic_streambuf<char> streambuf; | ||
|
||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS | ||
typedef basic_streambuf<wchar_t> wstreambuf; | ||
#endif | ||
|
||
template <class _CharT, class _Traits> | ||
class _LIBCPP_PREFERRED_NAME(streambuf) _LIBCPP_IF_WIDE_CHARACTERS(_LIBCPP_PREFERRED_NAME(wstreambuf)) basic_streambuf; | ||
|
||
_LIBCPP_END_NAMESPACE_STD | ||
|
||
#endif // _LIBCPP___FWD_STREAMBUF_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.