Core: Fixed memory info in FreeBSD, ide: Refactoring CodeBase

git-svn-id: svn://ultimatepp.org/upp/trunk@14617 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-06-22 06:38:59 +00:00
parent f0e40faf72
commit cd503a34bb
31 changed files with 351 additions and 187 deletions

View file

@ -3,7 +3,7 @@
namespace Upp {
#define LTIMING(x) DTIMING(x)
#define LTIMING(x) // DTIMING(x)
static VectorMap<String, String> sSrcFile;
static Index<uint64> sIncludes;
@ -25,6 +25,7 @@ String NormalizeSourcePath(const String& path)
void ClearSources()
{
CppBaseLock __;
sSrcFile.Clear();
sIncludes.Clear();
}
@ -41,6 +42,7 @@ const VectorMap<String, String>& GetAllSourceMasters()
void GatherSources(const String& master_path, const String& path_, Vector<int>& parents)
{
CppBaseLock __;
String path = NormalizeSourcePath(path_);
if(sSrcFile.Find(path) >= 0)
return;
@ -50,11 +52,15 @@ void GatherSources(const String& master_path, const String& path_, Vector<int>&
sSrcFile.Add(path, master_path);
parents.Add(ii);
const PPFile& f = GetPPFile(path);
Index<String> todo;
for(int i = 0; i < f.includes.GetCount(); i++) {
String p = GetIncludePath(f.includes[i], GetFileFolder(path));
if(p.GetCount())
GatherSources(master_path, p, parents);
todo.FindAdd(p);
}
MakePP(todo); // parse PP files in parallel to accelerate things...
for(String p : todo)
GatherSources(master_path, p, parents);
parents.Drop();
}