aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CommandFlags.cpp
diff options
context:
space:
mode:
authorjasonliu <jasonliu.development@gmail.com>2020-10-14 15:55:55 +0000
committerjasonliu <jasonliu.development@gmail.com>2020-10-14 15:58:31 +0000
commitf85bcc21ddadd07f38e1db7aa286ff985bd0eb10 (patch)
tree2d619cadda580b9f44153e87f1404ea4b258190e /llvm/lib/CodeGen/CommandFlags.cpp
parent89657b3a3b5772558ac084dc03591de5dab3f1f1 (diff)
downloadllvm-f85bcc21ddadd07f38e1db7aa286ff985bd0eb10.zip
llvm-f85bcc21ddadd07f38e1db7aa286ff985bd0eb10.tar.gz
llvm-f85bcc21ddadd07f38e1db7aa286ff985bd0eb10.tar.bz2
[AIX] Turn -fdata-sections on by default in Clang
Summary: This patch does the following: 1. Make InitTargetOptionsFromCodeGenFlags() accepts Triple as a parameter, because some options' default value is triple dependant. 2. DataSections is turned on by default on AIX for llc. 3. Test cases change accordingly because of the default behaviour change. 4. Clang Driver passes in -fdata-sections by default on AIX. Reviewed By: MaskRay, DiggerLin Differential Revision: https://reviews.llvm.org/D88737
Diffstat (limited to 'llvm/lib/CodeGen/CommandFlags.cpp')
-rw-r--r--llvm/lib/CodeGen/CommandFlags.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CommandFlags.cpp b/llvm/lib/CodeGen/CommandFlags.cpp
index 078fee6..a909358 100644
--- a/llvm/lib/CodeGen/CommandFlags.cpp
+++ b/llvm/lib/CodeGen/CommandFlags.cpp
@@ -461,7 +461,8 @@ codegen::getBBSectionsMode(llvm::TargetOptions &Options) {
// Common utility function tightly tied to the options listed here. Initializes
// a TargetOptions object with CodeGen flags and returns it.
-TargetOptions codegen::InitTargetOptionsFromCodeGenFlags() {
+TargetOptions
+codegen::InitTargetOptionsFromCodeGenFlags(const Triple &TheTriple) {
TargetOptions Options;
Options.AllowFPOpFusion = getFuseFPOps();
Options.UnsafeFPMath = getEnableUnsafeFPMath();
@@ -485,7 +486,8 @@ TargetOptions codegen::InitTargetOptionsFromCodeGenFlags() {
Options.StackSymbolOrdering = getStackSymbolOrdering();
Options.UseInitArray = !getUseCtors();
Options.RelaxELFRelocations = getRelaxELFRelocations();
- Options.DataSections = getDataSections();
+ Options.DataSections =
+ getExplicitDataSections().getValueOr(TheTriple.hasDefaultDataSections());
Options.FunctionSections = getFunctionSections();
Options.IgnoreXCOFFVisibility = getIgnoreXCOFFVisibility();
Options.BBSections = getBBSectionsMode(Options);