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/12/2016 10:45 AM, Larry Evans wrote:
> On 11/12/2016 07:15 AM, Larry Evans wrote:
>> On 11/10/2016 09:05 PM, Larry Evans wrote:
>>> On 11/10/2016 06:11 PM, Larry Evans wrote:
>>>> On 11/09/2016 05:55 PM, Joel de Guzman wrote:
>>> [snip]
>>>
>>>>> 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.
>>>>
>>> [snip]
>>> The latest commit:
>>>
>>> https://github.com/cppljevans/boost_1_61_problem/commit/8386602c2653600335d536cdd489b60d5a1433a8
>>>
>>> pointed out an oddity in the link error message.
>>> The undefined reference was for parse_rule for
>>> the count rule but the start attribute.
>>>
>> Well, maybe not so odd.
>> Going through a gdb trace helps me see what's happening.
>> Sorry for noise.
>
> My gdb trace shows:
>
> (gdb) up
> #2  0x0000000000401e2c in
> boost::spirit::x3::detail::parse_sequence<boost::spirit::x3::sequence<boost::spirit::x3::omit_directive<boost::spirit::x3::any_char<boost::spirit::char_encoding::standard>
>  >, boost::spirit::x3::rule<count_class, ast::Count, false> >,
> __gnu_cxx::__normal_iterator<char const*,
> std::__cxx11::basic_string<char, std::char_traits<char>,
> std::allocator<char> > >, boost::spirit::x3::unused_type, ast::Start,
> ast::Start> (parser=..., first=..., last=..., context=..., rcontext=...,
> attr=...) at
> /home/evansl/prog_dev/boost/releases/ro/boost_1_61_0/boost/spirit/home/x3/operator/detail/sequence.hpp:312
> 312	            && parser.right.parse(first, last, context, rcontext,
> r_attr))
> (gdb) ptype r_attr
> type = struct ast::Start {
>      ast::Count count;
> } &
> (gdb)
>
> shouldn't the r_attr be that for rule<count_class,ast::Count>, or
> ast::Count?
>
When compiled with _DKEEP_CHAR, at same place, this occurs:

(gdb) run
Starting program: 
/tmp/build/gcc5_2_0/clang/dwnlds_work/dwnlds/Gerell.Boost_1_61_Spirit.LinkError.clone/cppljevans.boost_1_61_problem/prog.exe 


Breakpoint 2, 
boost::spirit::x3::detail::parse_sequence<boost::spirit::x3::sequence<boost::spirit::x3::any_char<boost::spirit::char_encoding::standard>, 
boost::spirit::x3::rule<count_class, ast::Count, false> >, 
__gnu_cxx::__normal_iterator<char const*, 
std::__cxx11::basic_string<char, std::char_traits<char>, 
std::allocator<char> > >, boost::spirit::x3::unused_type, ast::Start, 
ast::Start> (parser=..., first=..., last=..., context=..., rcontext=..., 
attr=...) at 
/home/evansl/prog_dev/boost/releases/ro/boost_1_61_0/boost/spirit/home/x3/operator/detail/sequence.hpp:305
305	        typename partition::l_part l_part = partition::left(attr);
(gdb) n
306	        typename partition::r_part r_part = partition::right(attr);
(gdb) n
307	        typename l_pass::type l_attr = l_pass::call(l_part);
(gdb) n
308	        typename r_pass::type r_attr = r_pass::call(r_part);
(gdb) n
310	        Iterator save = first;
(gdb) ptype r_attr
type = struct ast::Count {
     int value;
} &
(gdb)

Which is what I would expect.




------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.