diff options
author | Qiongsi Wu <qwu@ibm.com> | 2023-07-12 12:45:50 -0400 |
---|---|---|
committer | Qiongsi Wu <qwu@ibm.com> | 2023-07-12 13:22:02 -0400 |
commit | 41447f6fdfe4d67bbd130bc6035e66f3fa1ebeff (patch) | |
tree | 85b8676070be2a02b4fb68a5f1c94d4c5685518d /llvm/lib/CodeGen/CommandFlags.cpp | |
parent | 1ba514c2cb65a34d994c6976ac584ae70e0165ed (diff) | |
download | llvm-41447f6fdfe4d67bbd130bc6035e66f3fa1ebeff.zip llvm-41447f6fdfe4d67bbd130bc6035e66f3fa1ebeff.tar.gz llvm-41447f6fdfe4d67bbd130bc6035e66f3fa1ebeff.tar.bz2 |
[libLTO][AIX] Respect `-f[no]-integrated-as` on AIX
`libLTO` currently ignores the `-f[no-]integrated-as` flags. This patch teaches `libLTO` to respect them on AIX.
The implementation consists of two parts:
# Migrate `llc`'s `-no-integrated-as` option to a codegen option so that the option is available to `libLTO`/`lld`/`gold`.
# Teach `clang` to pass `-no-integrated-as` accordingly to `libLTO` depending on the `-f[no-]integrated-as` flags.
On platforms other than AIX, the `-f[no-]integrated-as` flags are ignored.
Reviewed By: MaskRay, steven_wu
Differential Revision: https://reviews.llvm.org/D152924
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CommandFlags.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp index 59b5decb..c34a52a 100644 --- a/llvm/lib/CodeGen/CommandFlags.cpp +++ b/llvm/lib/CodeGen/CommandFlags.cpp @@ -81,6 +81,7 @@ CGOPT(bool, StackSymbolOrdering) CGOPT(bool, StackRealign) CGOPT(std::string, TrapFuncName) CGOPT(bool, UseCtors) +CGOPT(bool, DisableIntegratedAS) CGOPT(bool, RelaxELFRelocations) CGOPT_EXP(bool, DataSections) CGOPT_EXP(bool, FunctionSections) @@ -487,6 +488,11 @@ codegen::RegisterCodeGenFlags::RegisterCodeGenFlags() { cl::init(false)); CGBINDOPT(XCOFFReadOnlyPointers); + static cl::opt<bool> DisableIntegratedAS( + "no-integrated-as", cl::desc("Disable integrated assembler"), + cl::init(false)); + CGBINDOPT(DisableIntegratedAS); + #undef CGBINDOPT mc::RegisterMCTargetOptionsFlags(); @@ -540,6 +546,7 @@ codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) { Options.GuaranteedTailCallOpt = getEnableGuaranteedTailCallOpt(); Options.StackSymbolOrdering = getStackSymbolOrdering(); Options.UseInitArray = !getUseCtors(); + Options.DisableIntegratedAS = getDisableIntegratedAS(); Options.RelaxELFRelocations = getRelaxELFRelocations(); Options.DataSections = getExplicitDataSections().value_or(TheTriple.hasDefaultDataSections()); |