[PATCH] D53969: [ELF] Use SaveAndRestore to simplify code

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 04:43:55 PDT 2018


ruiu added a comment.

Yeah, honestly I don't like SaveAndRestore. You can save one line per a use of SaveAndRestore, but instead everybody reading or writing the code need to learn what SaveAndRestore is. On the other hand, saving old values using local variables and assignments is really easy to read (besides that theoretically they could be overridden by operator overloading). SaveAndRestore is not a complicated class, so it's worth to learn how to use it if you have a lot of use cases of SaveAndRestore here, but three uses is too few.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D53969





More information about the llvm-commits mailing list