Re: Horrible compiletimes and memory usage while compiling a parser with X3
Larry Evans <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
On 11/09/2016 05:55 PM, Joel de Guzman wrote: > On 09/11/2016 9:46 PM, Larry Evans wrote: >> On 11/07/2016 05:00 PM, Peter Gerell wrote: >>> On 07/11/2016 11:01 PM, Joel de Guzman wrote: >>>> Let's fix this. Can anyone please tell me how to download all files from wandbox? >>>> Or, can you please post a zip file or something? >>> >>> Hi Joel, the mailing list server rejected my reply with a zip file. >>> You can download or clone from here instead: >>> https://github.com/pgerell/boost_1_61_problem >>> >>> Regards, >>> Peter >>> >> Joel, >> >> My fork of Peter's repo has a revised common.cpp: >> >> https://github.com/cppljevans/boost_1_61_problem/blob/master/common.cpp >> >> the comments at and after //^Purpose show an attempt to workaround the >> link problem in, what I thought, was an infallible way. >> Alas, it failed :(. Could somebody please explain why it shouldn't >> workaround the link problem? Yes, I know it's not workable as >> a final solution, but I'm just trying to figure out what's >> the actual problem with the link. > > I'll look into this next. I believe there's a smart solution to this > linking issue. It's a matter of syncing what you declare with what > you actually use. > > Regards, > Thanks Joel. I thought seeing what the compiler -E output of common.cpp might clarify what the problem was; however, I was not able to see anything except that decltype(rule_name) in BOOST_SPIRIT_DEFINE_ would return a const whereas the the other macros have no const qualification. I don't think that will cause a problem. Anyway, maybe you can see something; so, I've attached the relevant parts filtered thru linux indent for slightly easier reading. Hope you can make some sense of it. -regards, Larry ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Spirit-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/spirit-general
common.Ei.cpp
(text/x-c++src, 1.6 KB)
#3 "./common_def.hpp" 2
#1 "./common.hpp" 1
struct start_class;
using start_type =
x3::rule < start_class,
ast::Start >;
const start_type & start_rule ();
template < typename Iterator,
typename Context,
typename Attribute >
bool parse_rule (start_type rule_,
Iterator & first,
Iterator const
&last,
Context const
&context,
Attribute &
attr);;
#4 "./common_def.hpp" 2
using x3::omit;
const start_type start = "start";
const auto count = count_rule ();
const auto start_def =
x3::omit[x3::char_] >> count;
template < typename Iterator,
typename Context,
typename Attribute >
inline bool
parse_rule (decltype (start) rule_,
Iterator & first,
Iterator const &last,
Context const &context,
Attribute & attr)
{
using boost::spirit::x3::unused;
static auto const def_ = (start =
start_def);
return def_.parse (first, last,
context, unused,
attr);};
#4 "common.cpp" 2
template bool parse_rule <
iterator_type, x3::unused_type,
start_type::attribute_type >
(start_type rule_,
iterator_type & first,
iterator_type const &last,
x3::unused_type const &context,
start_type::
attribute_type & attr);;
//#define EXPLICT_SPECIALIZATION_FROM_LINKER_ERROR_MSG
#41 "common.cpp"
const start_type & start_rule ()
{