r209836 - Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719
Bob Wilson
bob.wilson at apple.com
Thu May 29 12:43:02 PDT 2014
Author: bwilson
Date: Thu May 29 14:43:02 2014
New Revision: 209836
URL: http://llvm.org/viewvc/llvm-project?rev=209836&view=rev
Log:
Make the -mno-global-merge option work for arm64/aarch64. rdar://17024719
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/mno-global-merge.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=209836&r1=209835&r2=209836&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu May 29 14:43:02 2014
@@ -897,6 +897,14 @@ void Clang::AddAArch64TargetArgs(const A
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
Modified: cfe/trunk/test/Driver/mno-global-merge.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mno-global-merge.c?rev=209836&r1=209835&r2=209836&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mno-global-merge.c (original)
+++ cfe/trunk/test/Driver/mno-global-merge.c Thu May 29 14:43:02 2014
@@ -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"
More information about the cfe-commits
mailing list