0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-09 05:29:00 +02:00

ircd::spirit: Isolate aggressive inlining; remove unit-level setting.

This commit is contained in:
Jason Volk 2020-07-24 22:09:19 -07:00
parent ae2bc801f9
commit 1a756f637f
2 changed files with 13 additions and 13 deletions

View file

@ -2370,16 +2370,6 @@ SPIRIT_UNIT_CPPFLAGS+=" -include ircd/spirit.h"
AC_SUBST(SPIRIT_UNIT_CXXFLAGS)
dnl Slightly more aggressive than the default of 250. A large number of
dnl internal functions are generated out of some grammars at the default.
dnl The more aggressive value embeds rules together for optimization but
dnl may generate slightly larger functions.
AM_COND_IF([CLANG],
[
SPIRIT_UNIT_CXXFLAGS+=" -mllvm -inlinehint-threshold=1000"
SPIRIT_UNIT_CXXFLAGS+=" -mllvm -inline-threshold=400"
])
AM_COND_IF([GCC],
[
SPIRIT_UNIT_CXXFLAGS+=" -fno-var-tracking"

View file

@ -26,12 +26,19 @@
// some false asserts around boolean character tests in spirit.
#define BOOST_DISABLE_ASSERTS
#pragma GCC visibility push(default)
// This prevents spirit grammar rules from generating a very large and/or deep
// call-graph where rules compose together using wrapped indirect calls through
// boost::function -- this is higly inefficient as the grammar's logic ends up
// being a fraction of the generated code and the rest is invocation related
// overhead. By force-flattening here we can allow each entry-point into
// spirit to compose rules at once and eliminate the wrapping complex.
#pragma clang attribute push ([[gnu::always_inline]], apply_to = function)
#pragma clang attribute push ([[gnu::flatten]], apply_to = function)
#include <boost/config.hpp>
#include <boost/function.hpp>
#pragma GCC visibility pop
#pragma GCC visibility push(hidden)
#pragma GCC visibility push (internal)
#include <boost/fusion/sequence.hpp>
#include <boost/fusion/iterator.hpp>
#include <boost/fusion/adapted.hpp>
@ -45,6 +52,9 @@
#include <boost/spirit/repository/include/qi_subrule.hpp>
#pragma GCC visibility pop
#pragma clang attribute pop
#pragma clang attribute pop
namespace ircd {
namespace spirit
__attribute__((visibility("default")))