Now that options are almost all loaded with the same code, is it fine to make Compiler::Reset() and Compiler::LoadDefaultRegExArray() non-pure virtuals?
Depends on what you mean with almost here...?! If its not the same, shouldn't it remain virtual because in that case a compiler needs to implement it?!
They would still remain
virtualjust not
pure vitrualvirtual void Reset() = 0;
By almost, I mean all of the
LoadDefaultRegExArray() look like
void CompilerMSVC8::LoadDefaultRegExArray()
{
m_RegExes.Clear();
LoadRegExArray(GetID());
}
and most of the
Reset() look like
void CompilerMSVC8::Reset()
{
m_Options.ClearOptions();
LoadDefaultOptions(GetID());
LoadDefaultRegExArray();
m_CompilerOptions.Clear();
m_LinkerOptions.Clear();
m_LinkLibs.Clear();
m_CmdsBefore.Clear();
m_CmdsAfter.Clear();
}
The
Reset()s that are different include LCC (init member var), DMD (add some link libs), and the main GCC (call
SetVersionString()).
In my opinion, it make sense to move this default implementation into the base, so newly written compilers will automatically try to load their XML files. If a compiler does not want to load from XML (or wants to do additional items), then these methods can still be re-implemented, overriding the default.
I've created a branch for you work here:
Thank you (the patches against the trunk were becoming almost unreadable due to size). I have finished merging, and will be doing a few tests; the next patch should come soon.