diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-12-02 13:02:48 -0800 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2019-12-02 13:04:43 -0800 |
commit | 7902d6cc803065eae4d434642a8b4afd940a216b (patch) | |
tree | fe2380ce98546281a48f74510b3f016e5d07c474 /llvm/lib/LTO/LTO.cpp | |
parent | 8f2c100f6fa5250b987d11e53d24119bc1f8850e (diff) | |
download | bcm5719-llvm-7902d6cc803065eae4d434642a8b4afd940a216b.tar.gz bcm5719-llvm-7902d6cc803065eae4d434642a8b4afd940a216b.zip |
[Remarks][ThinLTO] Use the correct file extension based on the format
Since we now have multiple formats, the ThinLTO remark files should also
respect that.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r-- | llvm/lib/LTO/LTO.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index ebe22c37c70..0d48090e426 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1381,8 +1381,12 @@ lto::setupOptimizationRemarks(LLVMContext &Context, StringRef RemarksFilename, StringRef RemarksPasses, StringRef RemarksFormat, bool RemarksWithHotness, int Count) { std::string Filename = RemarksFilename; + // For ThinLTO, file.opt.<format> becomes + // file.opt.<format>.thin.<num>.<format>. if (!Filename.empty() && Count != -1) - Filename += ".thin." + llvm::utostr(Count) + ".yaml"; + Filename = + (Twine(Filename) + ".thin." + llvm::utostr(Count) + "." + RemarksFormat) + .str(); auto ResultOrErr = llvm::setupOptimizationRemarks( Context, Filename, RemarksPasses, RemarksFormat, RemarksWithHotness); |