aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2021-02-17 12:34:37 -0800
committerSriraman Tallam <tmsriram@google.com>2021-02-17 12:37:50 -0800
commite74191633036905388245818f54553813c880f83 (patch)
treeb26d32b41408b4f51949a3d7cb49207497db725a /clang/lib/Frontend/CompilerInvocation.cpp
parent279c5dc2f36fe8ffe27a8679cc5ce07c7f4806f9 (diff)
downloadllvm-e74191633036905388245818f54553813c880f83.zip
llvm-e74191633036905388245818f54553813c880f83.tar.gz
llvm-e74191633036905388245818f54553813c880f83.tar.bz2
Basic block sections should enable not function sections implicitly.
Basic block sections enables function sections implicitly, this is not needed and is inefficient with "=list" option. We had basic block sections enable function sections implicitly in clang. This is particularly inefficient with "=list" option as it places functions that do not have any basic block sections in separate sections. This causes unnecessary object file overhead for large applications. This patch disables this implicit behavior. It only creates function sections for those functions that require basic block sections. This patch is the second of two patches and this patch removes the implicit enabling of function sections with basic block sections in clang. Differential Revision: https://reviews.llvm.org/D93876
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f929647..a49c978 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1383,8 +1383,7 @@ void CompilerInvocation::GenerateCodeGenArgs(
GenerateArg(Args, OPT_ftime_report, SA);
}
- if (Opts.FunctionSections &&
- (Opts.BBSections == "none" || Opts.BBSections == "labels"))
+ if (Opts.FunctionSections)
GenerateArg(Args, OPT_ffunction_sections, SA);
if (Opts.PrepareForLTO && !Opts.PrepareForThinLTO)
@@ -1678,9 +1677,7 @@ bool CompilerInvocation::ParseCodeGenArgsImpl(CodeGenOptions &Opts,
}
// Basic Block Sections implies Function Sections.
- Opts.FunctionSections =
- Args.hasArg(OPT_ffunction_sections) ||
- (Opts.BBSections != "none" && Opts.BBSections != "labels");
+ Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections);
Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ);
Opts.PrepareForThinLTO = false;