From: Baptiste L. <gai...@fr...> - 2002-12-11 08:45:19
|
----- Original Message ----- From: "Sven Reichard" <rei...@ma...> To: "CppTool Mailing List" <Cpp...@li...> Sent: Tuesday, December 10, 2002 10:19 PM Subject: [Cpptool-develop] ToDo list > Baptiste, > [...] > Another easy (?) refactoring to consider is SplitTemporary. This includes > some things which might be generally useful, like determining the type of > a variable. Not so easy. You need to find where a temporary is being reassigned to which means some additional expression analysis. I think that more 'thinking' need to be done concerning this refactoring for C++. For example: double temp = 2 * (height_ + width_); print( temp ); computeArea( height_, width_, temp ); ... void computeArea( double height, double width, double &area ) { area = height + width; } computeArea() is an indirect assignment to the local variable temp... Also, I don't get what you means by 'determining the type of a variable'. For a given local variable identifier, we can already find its declaration (see ScopeHolderTest) and therefore its type. So the real issue is determining where a temporary is being reassigned to. Baptiste. > > Sven. > > -- > Sven Reichard > Dept. of Math. Sci. > University of Delaware > rei...@ma... |