Don't use unique section names by default if using the integrated as.

This saves some IO and ccache space by not creating long section names. It
should work with every ELF linker.

llvm-svn: 233393
This commit is contained in:
Rafael Espindola 2015-03-27 17:55:23 +00:00
parent 75e0c4b060
commit 463a0afe15
2 changed files with 16 additions and 3 deletions

View File

@ -3087,8 +3087,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.hasArg(options::OPT_dA))
CmdArgs.push_back("-masm-verbose");
if (!Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as,
IsIntegratedAssemblerDefault))
bool UsingIntegratedAssembler =
Args.hasFlag(options::OPT_fintegrated_as, options::OPT_fno_integrated_as,
IsIntegratedAssemblerDefault);
if (!UsingIntegratedAssembler)
CmdArgs.push_back("-no-integrated-as");
if (Args.hasArg(options::OPT_fdebug_pass_structure)) {
@ -3332,7 +3334,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
if (!Args.hasFlag(options::OPT_funique_section_names,
options::OPT_fno_unique_section_names, true))
options::OPT_fno_unique_section_names,
!UsingIntegratedAssembler))
CmdArgs.push_back("-fno-unique-section-names");
Args.AddAllArgs(CmdArgs, options::OPT_finstrument_functions);

View File

@ -72,3 +72,13 @@
// RUN: -target i386-unknown-linux \
// RUN: -fno-unique-section-names \
// RUN: | FileCheck --check-prefix=CHECK-NOUS %s
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: -fno-integrated-as \
// RUN: | FileCheck --check-prefix=CHECK-US %s
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target i386-unknown-linux \
// RUN: -fintegrated-as \
// RUN: | FileCheck --check-prefix=CHECK-NOUS %s