diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-13 00:38:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-13 00:38:24 +0000 |
commit | bbea7168326d810eff18dfb8bc43c7790fd55010 (patch) | |
tree | cacfc50825a40a94dfd6f48bc5bcd5361539f65c /lib/Frontend/CompilerInvocation.cpp | |
parent | 0b2bd47151ee9205ad6c66d1ffb921918106088a (diff) |
add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101108 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 17007b0079..b5e5645877 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -148,6 +148,10 @@ static void CodeGenOptsToArgs(const CodeGenOptions &Opts, // VerifyModule is only derived. // Inlining is only derived. + if (Opts.DataSections) + Res.push_back("-fdata-sections"); + if (Opts.FunctionSections) + Res.push_back("-ffunction-sections"); if (Opts.AsmVerbose) Res.push_back("-masm-verbose"); if (!Opts.CodeModel.empty()) { @@ -803,6 +807,9 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.UnwindTables = Args.hasArg(OPT_munwind_tables); Opts.RelocationModel = getLastArgValue(Args, OPT_mrelocation_model, "pic"); + Opts.FunctionSections = Args.hasArg(OPT_ffunction_sections); + Opts.DataSections = Args.hasArg(OPT_fdata_sections); + Opts.MainFileName = getLastArgValue(Args, OPT_main_file_name); Opts.VerifyModule = !Args.hasArg(OPT_disable_llvm_verifier); } |