Developer forums (C::B DEVELOPMENT STRICTLY!) > Compiler Framework Redesign
XML based compilers
MortenMacFly:
--- Quote from: Alpha on July 10, 2012, 05:35:29 am ---By the way, this change causes the passing on of the event id to mysteriously fail (no errors are raised, and according to gdb, m_MenuOption reverts -1 when OnFlagsPopupClick() returns).
--- End quote ---
Huh? How weird is that?! Maybe we are overriding a member variable with the same name of a base class?! I'll have a look.
--- Quote from: Alpha on July 10, 2012, 05:35:29 am ---However, it does work if I make it a static class member. Would this still be the preferred method?
--- End quote ---
...in the mean time: Yes. :-)
Alpha:
OK, thanks.
Now that options are almost all loaded with the same code, is it fine to make Compiler::Reset() and Compiler::LoadDefaultRegExArray() non-pure virtuals?
MortenMacFly:
--- Quote from: Alpha on July 11, 2012, 02:22:50 pm ---Now that options are almost all loaded with the same code, is it fine to make Compiler::Reset() and Compiler::LoadDefaultRegExArray() non-pure virtuals?
--- End quote ---
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?!
MortenMacFly:
I've created a branch for you work here:
http://svn.berlios.de/svnroot/repos/codeblocks/branches/xml_compiler
If you have time, please switch to it and provide patches against the branch. This should make things easier and track-able. Notice that I also integrated a few corrections from my side concerning compiler errors and alike (no functional changes). So be careful, I guess the first time you need some clever merging. If you can't do that, just provide patches against the branch, I'll do the rest.
Alpha:
--- Quote from: MortenMacFly on July 11, 2012, 02:29:40 pm ---
--- Quote from: Alpha on July 11, 2012, 02:22:50 pm ---Now that options are almost all loaded with the same code, is it fine to make Compiler::Reset() and Compiler::LoadDefaultRegExArray() non-pure virtuals?
--- End quote ---
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?!
--- End quote ---
They would still remain virtual
--- Code: ---virtual void Reset();
--- End code ---
just not pure vitrual
--- Code: ---virtual void Reset() = 0;
--- End code ---
By almost, I mean all of the LoadDefaultRegExArray() look like
--- Code: ---void CompilerMSVC8::LoadDefaultRegExArray()
{
m_RegExes.Clear();
LoadRegExArray(GetID());
}
--- End code ---
and most of the Reset() look like
--- Code: ---void CompilerMSVC8::Reset()
{
m_Options.ClearOptions();
LoadDefaultOptions(GetID());
LoadDefaultRegExArray();
m_CompilerOptions.Clear();
m_LinkerOptions.Clear();
m_LinkLibs.Clear();
m_CmdsBefore.Clear();
m_CmdsAfter.Clear();
}
--- End code ---
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.
--- Quote from: MortenMacFly on July 11, 2012, 07:51:40 pm ---I've created a branch for you work here:
--- End quote ---
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version