Do not create multiple chains/env files on update.

Review Request #119959 - Created Aug. 27, 2014 and submitted

Information
Milian Wolff
kdev-clang
685d158...
Reviewers
kdevelop
skalinichev

The implementation of ClangParsingEnvironmentFile::matchEnvironment
was too restrictive. A "match" should just indicate that a given
DUChain is valid for a given environment in principle, not whether
its environment is equal (or so I think right now).

Otherwise, we end up creating multiple TopDUContexts with associated
ClangEnvironmentFiles whenever the environment has changed and a
reparse is triggered.

Properly update environment and modification revision of includes.

Otherwise these files will be parsed over and over again since
neither their environment, nor their timestamp is updated properly.

This hopefully fixes the slowness during code completion.

The unit test now passes, but I could never reproduce this:

commit fccc9b4311abb8f858c18e80348df8d3e09b1ce3
Author: Sergey Kalinichev kalinichev.so.0@gmail.com
Date: Tue Aug 19 21:54:57 2014 +0400

Implement ClangParsingEnvironmentFile::matchEnvironment

Now code completion is so much faster!

so I don't know whether the code completion is now slower again? Anyhow, if that is the case we'd need a different fix anyways.

Sergey Kalinichev
Milian Wolff
Milian Wolff
Sergey Kalinichev
Milian Wolff
Review request changed

Status: Closed (submitted)

Change Summary:

commit 685d158c8ab0cf457bdaf52dfaabdcad39e01897
Author: Milian Wolff <mail@milianw.de>
Date:   Wed Aug 27 22:38:34 2014 +0200

    Properly update environment and modification revision of includes.
    
    Otherwise these files will be parsed over and over again since
    neither their environment, nor their timestamp is updated properly.
    
    This hopefully fixes the slowness during code completion.

commit a54b274af650c5b2e9acc4a99b0ad31ea2ea58a6
Author: Milian Wolff <mail@milianw.de>
Date:   Wed Aug 27 21:14:58 2014 +0200

    Do not create multiple chains/env files on update.
    
    The implementation of ClangParsingEnvironmentFile::matchEnvironment
    was too restrictive. A "match" should just indicate that a given
    DUChain is valid for a given environment in principle, not whether
    its environment is equal (or so I think right now).
    
    Otherwise, we end up creating multiple TopDUContexts with associated
    ClangEnvironmentFiles whenever the environment has changed and a
    reparse is triggered.
Loading...