[PATCH] Move logic for calculating DBG_VALUE history map into separate file/class.

David Blaikie dblaikie at gmail.com
Wed Apr 30 11:46:51 PDT 2014


================
Comment at: lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h:25
@@ +24,3 @@
+  const MachineFunction *MF;
+  const TargetRegisterInfo *TRI;
+
----------------
Alexey Samsonov wrote:
> David Blaikie wrote:
> > Immediate gut reaction is that this object has no state (presumably it doesn't mutate the MachineFunction or the TargetRegisterInfo - it just uses those to perform some computation) so it should be a free function.
> > 
> > Arguably it could still be in its own source file - it's certainly a lot of code - but I have an aversion to classes that are just containers for functions (we have namespaces for that).
> For now, when the class doesn't yet have a state, I can turn certainly turn it into a function for simplicity.
Yep - if you could just make this a function for now, that'd be great. 

It helps me to see the different design requirements motivating design changes rather than having a design that, itself, lacks the justification/requirements.

http://reviews.llvm.org/D3573






More information about the llvm-commits mailing list