[arm-gnu] Linker driven optimization. Possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[arm-gnu] Linker driven optimization. Possible?



I would like to know if it is possible to have the kind of optimization i 
describe here. I am building for AT91SAM7S256 (atm7tdmi) bare metal.

In the interest of maintainability and modularity, I have several abstract 
classes defined in my projects. I have many concrete implementations for each 
of the abstract class, however, only one of them is ever part of a final 
project.

For example for Analog to Digital converters i have defined an abstract base 
class:
class Adc
{
public:
...
virtual int pureVirtual() = 0;
};

I have an implementation:

class MaximAdc : public Adc
{
public:
...
int pureVirtual()
{...};
};

Now, most projects only use one of the "Adc" implementation in the entire 
project. So now, under such circumstances is it really possible to optimize so 
that MaximAdc and Adc are "merged" thereby avoiding the inheritance and the 
virtual function call? Is this also possible if the Adc and MaximAdc are part 
of a static link library?

I am trying to take advantage of object oriented programming and code 
modularity / maintainability without having to loose out on performance to the 
extent possible. Any related advise would be appreciated.
-- 
Cheers!
Kishore