[refactor][extract] insert semicolons into extracted/inserted code
when needed
This commit implements the semicolon insertion logic into the extract
refactoring. The following rules are used:
- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add
terminating ';' to the callee.
- extracting statements with ';': move (if possible) the original ';' from the
callee and add terminating ';'.
- otherwise, add ';' to both places.
Differential Revision: https://reviews.llvm.org/D39441
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317343
91177308-0d34-0410-b5e6-
96231b3b80d8