If you poke into bridges/ you can see that a ton of the gcc bridge code is horribly cut/paste.
We should hack the bridges/Library_cpp_uno.mk to link in a set of gcc_shared/ code - that isolates this into one place. This should then help eg. implement RTTI for Linux so that dynamic_cast<> works properly for bridged objects.
$ cd bridges
$ git grep initializeBlock
for example. At least these two guys should be shared.
return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize;
void * block, sal_Int32 slotCount, sal_Int32,
Slot * slots = mapBlockToVtable(block);
slots[-2].fn = 0;
slots[-1].fn = 0;
return slots + slotCount;
I'd start by sharing only these two - and of course carefully checking that they are in fact copy/paste identical across all of the gcc backend/bridges =)
Be /very/ careful here. There may be some low-hanging fruit that are obvious candidates for consolidation, but there may also be subtle differences that are there for a reason. Also, changes should ideally only be made if you can actually test the changed code, i.e., have access to each specific OS/hardware combination.
I agree strongly with Stephan. This is far from "difficultyBeginner". Do *not* touch code for an architecture you can't test yourself.
Migrating Whiteboard tags to Keywords: (easyHack skillCpp topicCleanup)
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC)
Please remark, the request for a way to test the changes (not with a debugger but automated). Patches need to include that part.