[LLVMdev] deglobalizing TargetOptions

Chris Lattner clattner at apple.com
Thu Dec 1 17:34:13 PST 2011


On Dec 1, 2011, at 5:23 PM, Nick Lewycky wrote:
>> Instead of adding a bunch of instance variables (+ getters/setters) into TargetMachine, why not make TargetOptions be a class, and have TM contain an instance of it?
> 
> That works too, it makes little difference to me. One reason is that
> most references to these globals are inside classes that derive from
> TargetMachine so I wouldn't need to touch those lines. The second
> reason is that I'm going to turn "bool Foo" into "unsigned Foo : 1"
> and would like that to pack in with the 6 variables that are currently
> members of the TargetMachine.
> 
> How about I just move the 6 existing flags into TargetOptions and even
> remove their getters/setters. I think that'll be cleanest overall.

I'd really prefer these to be in a separate class: TM is just too huge and full of random things already.  I'm not concerned about the actual sizeof(TargetMachine), so reusing a few bits in it shouldn't matter.

-Chris



More information about the llvm-dev mailing list