[lld][RFC] TargetLayout class removing

Hi Rui, Shankar,

Do we really need empty TargetLayout class? No we have the following hierarchy:

Layout <- DefaultLayout<> <- TargetLayout<> <- xxxTargetLayout<>

I suggest to remove TargetLayout and rename DefaultLayout to TargetLayout.

Thoughts?

I’m wondering if we even need TargetLayout.

DefaultLayout is the only derived class of Layout. TargetLayout is the only derived class of DefaultLayout. It looks like we can merge Layout, DefaultLayout and TargetLayout into one.

Agree.

Shankar Easwaran

Good point. But I suggest to do that by two steps. First, remove
TargetLayout and rename DefaultLayout to TargetLayout. Second, merge
TargetLayout and Layout. The first step is easy, the second step
generates large diff, requires reviewing etc.

Sure. Sounds good.

Merging TargetLayout and Layout classes unexpectedly produced rather
small diff. I committed the change at r234065.

Thank you for doing this!