[PATCH] D79299: [TRE][NFC] Refactor shared state into member variables.

Layton Kifer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 17:14:00 PDT 2020


laytonio added a comment.

In general I agree that keeping mutable state in the class like this is not optimal. In this case though, I do believe it is better than needing to trace the variable up though several functions to find were it is declared, when in is only used in the bottom few functions. I added a comment stating that these variables are populated in createTailRecurseLoopHeader to hopefully make them a little easier to understand. As for moving the functions out of the class, I was trying to avoid cluttering the code with a bunch of "TRE->" everywhere, but if we think it is cleaner to have this be a struct that is passes around instead of a class with member functions, I am okay with that.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79299/new/

https://reviews.llvm.org/D79299





More information about the llvm-commits mailing list