This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Some (small) c++ compilation profiling data (oprofile)


Zack Weinberg wrote:-

> Should just be a case of adding a pointer to a linemap structure in
> the macro context stack, right?

There isn't such a thing.  Currently cpplib knows about the macros
under expansion since it does little or no lookahead, so the
context stack is still intact.  But if you have the front-end
rampaging around the token stream, then saying "I want a
diagnostic at the position of that token 10 tokens ago",
the information is probably lost anyway as the macro has
long since been left.

Since having an array of tokens seems helpful for the front end,
logical lines are probably best expanded before handing them
to the front end, so there would be no more macro context
stack anyway.

I think the only thing to do is keep a little list of
starting and ending points of macro expansions in the token
array.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]