[LinkerWrapper][NFC] Change interface to use a StringRef to TempFiles
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 22 Jun 2022 15:17:14 +0000 (11:17 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 22 Jun 2022 17:16:37 +0000 (13:16 -0400)
commit75979887291426acd282d638795913697b65cecb
tree2e559f1bc16bafcd9d5dc871b9a3e8a27540eb76
parent67dc8021a1796cc84bd4c1e5983605323188ce9d
[LinkerWrapper][NFC] Change interface to use a StringRef to TempFiles

Summary:
Currently we use temporary files to write the intermediate results to.
However, these are stored as regular strings and we do a few unnecessary
copies and conversions of them. This patch simply replaces these strings
with a reference to the filename stored in the list of temporary files.
The temporary files will stay alive during the whole linking phase and
have stable pointers, so we should be able to cheaply pass references to
them rather than copying them every time.
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp