Review Request 124285: Compare declarations using declaration chain and marshaled symbols

Milian Wolff mail at milianw.de
Wed Jul 8 20:59:25 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124285/#review82240
-----------------------------------------------------------


Hm would it help to reuse the information we store in the DUChain maybe? I'm not sure about templates, but for other stuff we intern things there already.


refactoring/declarationsymbol.cpp (line 217)
<https://git.reviewboard.kde.org/r/124285/#comment56615>

    return m_name.empty()
    
    also below



refactoring/declarationsymbol.cpp (line 244)
<https://git.reviewboard.kde.org/r/124285/#comment56616>

    join with next line



refactoring/declarationsymbol.cpp (line 283)
<https://git.reviewboard.kde.org/r/124285/#comment56620>

    see above



refactoring/refactoringmanager.cpp (line 63)
<https://git.reviewboard.kde.org/r/124285/#comment56617>

    \o/



refactoring/renamevardeclrefactoring.cpp (line 56)
<https://git.reviewboard.kde.org/r/124285/#comment56618>

    style:
    
        Foo(...)
            : m_1(...)
            , m_2(...)
            ...
        {
            ...
        }



refactoring/renamevardeclrefactoring.cpp (line 74)
<https://git.reviewboard.kde.org/r/124285/#comment56619>

    style, see above



refactoring/utils.h (line 92)
<https://git.reviewboard.kde.org/r/124285/#comment56621>

    for long comments, it's better imo to use `/* ... */`



refactoring/utils.h (line 93)
<https://git.reviewboard.kde.org/r/124285/#comment56622>

    their?



refactoring/utils.h (line 148)
<https://git.reviewboard.kde.org/r/124285/#comment56623>

    #include <language/util/kdevhash.h>
        
        ...
        size_t operator()(const LexicalLocation &o) const
        {
            return KDevHash() << hash<string>()(o.fileName) << hash<unsigned>()(o.offset);
        }



refactoring/utils.cpp (line 305)
<https://git.reviewboard.kde.org/r/124285/#comment56624>

    non-const?


- Milian Wolff


On July 7, 2015, 10:11 p.m., Maciej Poleski wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124285/
> -----------------------------------------------------------
> 
> (Updated July 7, 2015, 10:11 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> Compare declarations using declaration chain and marshaled symbols.
> 
> I have serious issue with reflecting declaration entities. Clang provides all required measures for Translation Unit, but we are refactoring whole projects, not single TU.
> 
> When I want to make even the simplest refactoring action (like rename variable) I have to find all declarations of this variable in the whole project (world). It is very simple in TU as Clang provides tools like `getCanonicalDecl()` which returns universal witness of declaration. The problem is that usages of this variable can occur also in other TUs. But in other TU we will have other witness. Clang can't help this. I introduced my own facility to compare declarations "globally". It uses two techniques depending on situation:
> - declaration chains - if we have "local" symbol (local to TU)
> - marshalled symbols (like name mangling) - if we have symbol with external linkage (global)
> 
> The second is rewriting of some language rules. It is very disappointing that such functionality had to be rewritten (it _must_ be somewhere in compiler).
> 
> Currently this feature is employed in rename varaible action. Works (as with older engine). It is going to be used in change signature as well soon. (I was working on change signature when this issue blocked me)
> 
> It seems that I successfully stripped old commits from this new review, but I'm not sure if this fact will be preserved when I begin updates.
> I still didn't succeed pushing old changes to repo...
> 
> 
> Diffs
> -----
> 
>   refactoring/CMakeLists.txt PRE-CREATION 
>   refactoring/debug.h PRE-CREATION 
>   refactoring/declarationcomparator.h PRE-CREATION 
>   refactoring/declarationcomparator.cpp PRE-CREATION 
>   refactoring/declarationsymbol.h PRE-CREATION 
>   refactoring/declarationsymbol.cpp PRE-CREATION 
>   refactoring/documentcache.cpp PRE-CREATION 
>   refactoring/redeclarationchain.h PRE-CREATION 
>   refactoring/redeclarationchain.cpp PRE-CREATION 
>   refactoring/refactoringmanager.cpp PRE-CREATION 
>   refactoring/renamevardeclrefactoring.h PRE-CREATION 
>   refactoring/renamevardeclrefactoring.cpp PRE-CREATION 
>   refactoring/tudecldispatcher.h PRE-CREATION 
>   refactoring/tudecldispatcher.cpp PRE-CREATION 
>   refactoring/utils.h PRE-CREATION 
>   refactoring/utils.cpp PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/124285/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Maciej Poleski
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20150708/f5c441d4/attachment-0001.html>


More information about the KDevelop-devel mailing list