[PATCH] D134375: [LTO][AIX] Invoking AIX System Assembler in LTO CodeGen
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 22:42:34 PDT 2022
MaskRay added inline comments.
================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:127
+cl::opt<bool> SaveTemps(
+ "lto-save-temps", cl::init(false),
+ cl::desc("Save temporary LTO files in the current working directory."));
----------------
Drop the default value cl::init(false)
================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:257
+bool LTOCodeGenerator::hasIntegratedAssembler() {
+ const auto &Triple = TargetMach->getTargetTriple();
----------------
The code is AIX specific. The function should be named so instead of pretending it to be generic and used by other targets.
================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:266
+
+bool LTOCodeGenerator::runSystemAssembler(SmallString<128> &Name) {
+ assert(!hasIntegratedAssembler() &&
----------------
The code is AIX specific. The function should be named so instead of pretending it to be generic and used by other targets.
================
Comment at: llvm/lib/LTO/LTOCodeGenerator.cpp:271
+ if (llvm::SaveTemps)
+ llvm::sys::fs::copy_file(Name, "ld-temp." + llvm::Twine(getpid()) + ".s");
+
----------------
Avoid getpid. See createTemporaryFile in Support/FileSystem.h
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134375/new/
https://reviews.llvm.org/D134375
More information about the llvm-commits
mailing list