Major optimization of C/C++ dependency scanning.

Now only the dependencies for the file where the dependencies actually may
have changed are rescanned, before that this was done for all source files
even if only one source file had changed.
This reduces e.g. on my machine the time for scanning the dependencies
of kdelibs/khtml/ when only one file (khtml_global.cpp) has changed from
around 7.5 seconds to 1.2 seconds.

The tests succeed, it does what I expected it to do on kdelibs, and Brad
also reviewed the patch, so I think it should be ok.

Alex
This commit is contained in:
Alexander Neundorf
2009-09-23 14:02:05 -04:00
parent 551fcc23c2
commit 39383ef8cb
8 changed files with 96 additions and 20 deletions

View File

@@ -36,7 +36,8 @@ protected:
// Implement writing/checking methods required by superclass.
virtual bool WriteDependencies(const char *src, const char *file,
std::ostream& makeDepends, std::ostream& internalDepends);
virtual bool CheckDependencies(std::istream& internalDepends);
virtual bool CheckDependencies(std::istream& internalDepends,
std::map<std::string, DependencyVector >& validDeps);
private:
cmDependsJava(cmDependsJava const&); // Purposely not implemented.