This patch allows LLD to write over an existing output file that is in use - if the program using it has opened it in FILE_SHARE_DELETE mode.
https://reviews.llvm.org/D82542 must land first otherwise this will introduce a 2s delay if the output file does not exist.
You should probably wrap the internal if logic into curly braces:
Otherwise you perhaps might get a compiler warning. At least GCC would complain with:
""error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]",
see b21f32fcecd012fa2c2f8c61d7259079a7f1865e.
I believe this place is not expected to be compiled with GCC, but I guess some similar warning might be reported by MSVS compiler too.