Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719

llvm-svn: 209836
This commit is contained in:
Bob Wilson 2014-05-29 19:43:02 +00:00
parent 32685ec5fd
commit bdd2b3c7c5
2 changed files with 16 additions and 0 deletions

View File

@ -897,6 +897,14 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args,
CmdArgs.push_back("-backend-option");
CmdArgs.push_back("-aarch64-strict-align");
}
// Setting -mno-global-merge disables the codegen global merge pass. Setting
// -mglobal-merge has no effect as the pass is enabled by default.
if (Arg *A = Args.getLastArg(options::OPT_mglobal_merge,
options::OPT_mno_global_merge)) {
if (A->getOption().matches(options::OPT_mno_global_merge))
CmdArgs.push_back("-mno-global-merge");
}
}
// Get CPU and ABI names. They are not independent

View File

@ -2,11 +2,19 @@
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// RUN: %clang -target arm64-apple-ios7 \
// RUN: -mno-global-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-NGM < %t %s
// CHECK-NGM: "-mno-global-merge"
// RUN: %clang -target armv7-apple-darwin10 \
// RUN: -mglobal-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-GM < %t %s
// RUN: %clang -target arm64-apple-ios7 \
// RUN: -mglobal-merge -### -fsyntax-only %s 2> %t
// RUN: FileCheck --check-prefix=CHECK-GM < %t %s
// CHECK-GM-NOT: "-mglobal-merge"