0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-11 12:31:07 +01:00

ircd::spirit: Fix inconsistent namespace visibilities.

This commit is contained in:
Jason Volk 2022-07-04 14:22:18 -07:00
parent 8ba5548a2e
commit 03d6c32556
6 changed files with 32 additions and 52 deletions

View file

@ -15,19 +15,17 @@
// it involves extremely expensive boost headers for creating formal spirit // it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group. // grammars. This file is automatically included in the spirit.h group.
namespace ircd { namespace ircd::spirit
namespace spirit
__attribute__((visibility("internal")))
{ {
template<size_t id> struct custom_parser; template<size_t id>
struct custom_parser;
BOOST_SPIRIT_TERMINAL(custom0); BOOST_SPIRIT_TERMINAL(custom0);
BOOST_SPIRIT_TERMINAL(custom1); BOOST_SPIRIT_TERMINAL(custom1);
BOOST_SPIRIT_TERMINAL(custom2); BOOST_SPIRIT_TERMINAL(custom2);
}} }
namespace boost { namespace boost::spirit
namespace spirit
__attribute__((visibility("internal")))
{ {
namespace qi namespace qi
{ {
@ -42,23 +40,23 @@ __attribute__((visibility("internal")))
} }
template<> template<>
struct [[clang::internal_linkage]] struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom0> use_terminal<qi::domain, ircd::spirit::tag::custom0>
:mpl::true_ :mpl::true_
{}; {};
template<> template<>
struct [[clang::internal_linkage]] struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom1> use_terminal<qi::domain, ircd::spirit::tag::custom1>
:mpl::true_ :mpl::true_
{}; {};
template<> template<>
struct [[clang::internal_linkage]] struct [[gnu::visibility("internal"), clang::internal_linkage]]
use_terminal<qi::domain, ircd::spirit::tag::custom2> use_terminal<qi::domain, ircd::spirit::tag::custom2>
:mpl::true_ :mpl::true_
{}; {};
}} }
template<size_t id> template<size_t id>
struct [[gnu::visibility("internal"), clang::internal_linkage]] struct [[gnu::visibility("internal"), clang::internal_linkage]]

View file

@ -11,20 +11,17 @@
#pragma once #pragma once
#define HAVE_IRCD_SPIRIT_EXPECTATION_FAILURE_H #define HAVE_IRCD_SPIRIT_EXPECTATION_FAILURE_H
namespace ircd { namespace ircd::spirit
namespace spirit
__attribute__((visibility("default")))
{ {
template<class parent_error> template<class parent_error>
struct expectation_failure; struct expectation_failure;
// parse.cc // parse.cc
extern thread_local char rule_buffer[128]; extern thread_local char rule_buffer[128];
}} }
template<class parent_error> template<class parent_error>
struct __attribute__((visibility("default"))) struct ircd::spirit::expectation_failure
ircd::spirit::expectation_failure
:parent_error :parent_error
{ {
template<class it = const char *> template<class it = const char *>

View file

@ -40,7 +40,7 @@ namespace ircd::spirit
/// of indirect calls. /// of indirect calls.
/// ///
template<class T> template<class T>
struct [[clang::internal_linkage]] struct [[gnu::visibility("internal"), clang::internal_linkage]]
ircd::spirit::expr ircd::spirit::expr
:boost::proto::result_of::deep_copy<T>::type :boost::proto::result_of::deep_copy<T>::type
{ {

View file

@ -15,28 +15,11 @@
// it involves extremely expensive boost headers for creating formal spirit // it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group. // grammars. This file is automatically included in the spirit.h group.
namespace ircd { namespace ircd::spirit
namespace spirit
__attribute__((visibility("default")))
{ {
IRCD_EXCEPTION(error, generator_error); IRCD_EXCEPTION(error, generator_error);
IRCD_EXCEPTION(generator_error, buffer_overrun); IRCD_EXCEPTION(generator_error, buffer_overrun);
constexpr size_t
generator_buffer_size {64_KiB},
generator_buffer_count {8};
extern thread_local struct generator_state *
generator_state;
extern thread_local char
generator_buffer[generator_buffer_count][generator_buffer_size];
}}
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
{
using prop_mask = mpl_::int_ using prop_mask = mpl_::int_
< <
karma::generator_properties::no_properties karma::generator_properties::no_properties
@ -51,11 +34,22 @@ __attribute__((visibility("internal")))
char *, prop_mask, unused_type char *, prop_mask, unused_type
>; >;
constexpr size_t
generator_buffer_size {64_KiB},
generator_buffer_count {8};
extern thread_local struct generator_state *
generator_state;
extern thread_local char
generator_buffer[generator_buffer_count][generator_buffer_size];
template<bool truncation = false, template<bool truncation = false,
class gen, class gen,
class... attr> class... attr>
[[gnu::visibility("internal"), clang::internal_linkage]]
bool generate(mutable_buffer &out, gen&&, attr&&...); bool generate(mutable_buffer &out, gen&&, attr&&...);
}} }
/// This structure is a shadow for the default spirit::karma buffering /// This structure is a shadow for the default spirit::karma buffering
/// stack. They conduct buffering by allocating and copying standard strings /// stack. They conduct buffering by allocating and copying standard strings
@ -65,7 +59,7 @@ __attribute__((visibility("internal")))
/// height of any stack growing from an ircd::spirit::generate() call without /// height of any stack growing from an ircd::spirit::generate() call without
/// need for reentrancy. This gives us the ability to pre-allocate thread_local /// need for reentrancy. This gives us the ability to pre-allocate thread_local
/// buffers. /// buffers.
struct [[gnu::visibility("internal")]] struct [[gnu::visibility("default")]]
ircd::spirit::generator_state ircd::spirit::generator_state
{ {
/// The number of instances stacked behind the current state. This should /// The number of instances stacked behind the current state. This should

View file

@ -15,9 +15,7 @@
// it involves extremely expensive boost headers for creating formal spirit // it involves extremely expensive boost headers for creating formal spirit
// grammars. This file is automatically included in the spirit.h group. // grammars. This file is automatically included in the spirit.h group.
namespace ircd { namespace ircd::spirit
namespace spirit
__attribute__((visibility("internal")))
{ {
template<class rule, template<class rule,
class... attr> class... attr>
@ -32,7 +30,7 @@ __attribute__((visibility("internal")))
template<class rule, template<class rule,
class... attr> class... attr>
bool parse(std::nothrow_t, const char *&start, const char *const &stop, rule&&, attr&&...) noexcept; bool parse(std::nothrow_t, const char *&start, const char *const &stop, rule&&, attr&&...) noexcept;
}} }
/// Execute the parse. The start pointer is advanced upon successful execution. /// Execute the parse. The start pointer is advanced upon successful execution.
/// Failures must not throw: If the grammar contains any epsilon expressions or /// Failures must not throw: If the grammar contains any epsilon expressions or

View file

@ -11,17 +11,10 @@
#pragma once #pragma once
#define HAVE_IRCD_SPIRIT_SPIRIT_H #define HAVE_IRCD_SPIRIT_SPIRIT_H
namespace ircd { namespace ircd::spirit
namespace spirit
__attribute__((visibility("default")))
{ {
IRCD_EXCEPTION(ircd::error, error); IRCD_EXCEPTION(ircd::error, error);
}}
namespace ircd {
namespace spirit
__attribute__((visibility("internal")))
{
namespace phx = boost::phoenix; namespace phx = boost::phoenix;
namespace proto = boost::proto; namespace proto = boost::proto;
namespace fusion = boost::fusion; namespace fusion = boost::fusion;
@ -113,7 +106,7 @@ __attribute__((visibility("internal")))
class semantic_context> class semantic_context>
auto & auto &
local_at(semantic_context&&); local_at(semantic_context&&);
}} }
template<size_t idx, template<size_t idx,
class semantic_context> class semantic_context>