Git Product home page Git Product logo

Comments (3)

docfaraday avatar docfaraday commented on August 18, 2024

I've experimented with some success with breaking the post-processing into two phases, where the functions/macros/types/variables tables built from a first scan of the csv files, and the _decldef tables built from a second scan of the csv files, and omitting the update_decldef step. We'd need to do something similar for the _refs tables, but first we'd need to teach the clang plugin to output the qualname for 'ref' csv rows.

from dxr.

abbeyj avatar abbeyj commented on August 18, 2024

Relying on the qualname being unique might not be such a good idea right
now. For one thing, static global variables are going to cause
collisions. Think of having "static int foo;" in two different translation
units. This could be solved by mangling the qualname for such variables,
perhaps by appending "::" to them or something along
those lines.

There's also the case where you're building multiple binaries and each one
contains "extern int foo = 0;" in separate files. These are separate
variables but they share the same qualname. Unless we add support for
grabbing information from the link phase it would be pretty hard to
distinguish these by qualname alone.

There's also the possibility of local variables that are shadowed:
void foo()
{
int bar; // qualname is foo()::bar
{
int bar; // qualname is also foo()::bar ?
}
}

I think we may want to add qualname to the existing unique key but I seem
to recall that I ran into issues when trying that. When you have
templates, the name you get back depends on whether the template had been
instantiated or not. So you'd get Foo for the definition and then
Foo or Foo or something for the reference. Since these don't
match you'd end up with a lot of places where you couldn't find the entity
that was referenced. You'd have to find a way to get Foo from these
references. But you also have to watch out for the case where there is an
explicit specialization for Foo since in that case you do want to
stay with Foo and not have Foo. Templates are complicated.

On Fri, Mar 14, 2014 at 8:26 PM, docfaraday [email protected]:

I've experimented with some success with breaking the post-processing into
two phases, where the functions/macros/types/variables tables built from a
first scan of the csv files, and the _decldef tables built from a second
scan of the csv files, and omitting the update_decldef step. We'd need to
do something similar for the _refs tables, but first we'd need to teach the
clang plugin to output the qualname for 'ref' csv rows.

Reply to this email directly or view it on GitHubhttps://github.com//issues/257#issuecomment-37709944
.

from dxr.

docfaraday avatar docfaraday commented on August 18, 2024

I wonder if the scope information that DXR records could be useful here.

from dxr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.