tberghammer added a subscriber: tberghammer.
tberghammer added a comment.

You added 10 new function to the emulator where the first 8 functions and the 
last 2 functions are almost identical. I know that the rest of the MIPS64 
instruction emulator is having the same issue but I would like to see these 
functions to be merged into a smaller number of functions to remove code 
duplication.

I see 2 different approach to do it and I am not sure which one is better in 
this case, but both of them improves the situation by a lot.

- Write only 2 function (first 8, last 2) and that function then reads out the 
condition and the sizes from the MCInst object. I would prefer this approach, 
but I am not sure how difficult it is to read out data from an MCInst
- Keep the 10 function for the 10 different instruction, but make these 
functions to call a function (one for the first 8 and one for the last 2) with 
passing in the constants required by the specific instruction.

Both approach would reduce the amount of code in this class and help a lot in 
reducing the maintenance cost with removing a lot of duplicated code.


Repository:
  rL LLVM

http://reviews.llvm.org/D12356



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to