Tools for Analyzing C++ Class Code Generation?
Milo_Mindbender submits this query: "I've got a midsize Linux project which uses a lot of STL and other C++ template code. Even considering this, I end up with a lot bigger text (generated code) segment than expected. I know the information about the amount of code generated for each class is in the objdump, but prying it out by hand is a problem when you get five line long template invocations and hundreds of methods to wade through. Can anyone can recommend some tools that analyze binary or objdump output and summarize the amount of code generated for each class, including each unique template or STL class?"
Too bad that C++ templates have nothing to do with OOP, but rather procedural programming. And while they have lots of problems (like code bloat) they are also phenomenally powerful for certain things (generic data structures). Even if you write nothing about procedural code, you could benifet from templates.
A deep unwavering belief is a sure sign you're missing something...
Our large corporation also has a project, a client has requested that we implement BubbleSort, QuickSort, ShellSort, and one other sort that we learnt in cl^H^H^H^H^H^H^H^H^H err, discussed in a business meeting. The err, client also requests a 1 page analysis comparing and contrasting the differences between the searches.
Can code generation do this? It could really increase my chances of a good mar^H^H^H err profit yeah.
Search at source forge for Open C++ or OpenCPP, not sure how it is written.
That is a programmable source to source transformer for C++.
It spits out one singel file of c++ for every compiled C++ unit, removing the includes, by expanding them into the output.
That way yo can source level debug the processed c++ code, not exactly what you want but likely more powerfull in the long run anyway.
Your request varies far to heavy from compiler to compiler.
angel'o'sphere
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
It is kinda ugly for what it does but it works. Only one instantiation of std::vector is made, it is void*. Putting the member function definitions in the header file ensures they will be inlined if necessary.
I think Scott Meyers came up with this tip first.