[PATCH] <<Proposed Driver Update>>

Nick Kledzik kledzik at apple.com
Mon Mar 4 14:16:27 PST 2013


On Mar 4, 2013, at 1:59 PM, Shankar Kalpathi Easwaran <shankarke at gmail.com> wrote:

> 
>  I see from clients, that dealing with a single object to deal with would be much easier than dealing with two objects. But with your design, it might lead to duplicate functionality in all the target info objects(ELF/MachO/COFF), that deal with LinkerOptions, isnt it ?
> 
>  For example :-
> 
>  ELFTargetInfo needs an implementation for globalsAreDeadStripRoots as well as MachOTargetInfo also needs an implementation for globalsAreDeadStripRoots.
For this particular case, the base class TargetInfo would declare the globalsAreDeadStripRoots() method (bcause it is needed by the Resolver which only knows about the base class TargetInfo.  The implementation would be like:

class TargetInfo {
public:
   …
   bool globalsAreDeadStripRoots() const {
	return _ globalsAreDeadStripRoots;
  }

 …

protected:
  bool _globalsAreDeadStripRoots
  …
};

Now subclasses of TargetInfo are free to set _globalsAreDeadStripRoots whenever appropriate.


-Nick






More information about the llvm-commits mailing list