When the new file is empty, always copy to new file, un-map old file, map to new file.
When the new file is non-empty:
- If neither %m in LLVM_PROFILE_FILE nor EnableMerge = 0, append old profile to the end of the new profile
- If %m in LLVM_PROFILE_FILE and EnableMerge = 1, merging old profile into new profile.
- Otherwise, just fail. This is because any of old profile or new file was in appending mode before, not sure if we should merge the first part or the last part of profile.
I'm not sure if we should try to merge in the third case.
clang-format: please reformat the code