r307386 - [driver][mips] Pass long-calls feature flag to the MIPS backend
Simon Atanasyan via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 7 03:35:33 PDT 2017
Author: atanasyan
Date: Fri Jul 7 03:35:33 2017
New Revision: 307386
URL: http://llvm.org/viewvc/llvm-project?rev=307386&view=rev
Log:
[driver][mips] Pass long-calls feature flag to the MIPS backend
Check the `-mlong-calls` command line option and pass the `long-calls`
feature flag to the backend. Handling of this feature flag in the backend
needs to be implemented by a separate commit.
Modified:
cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp
cfe/trunk/test/Driver/mips-features.c
Modified: cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp?rev=307386&r1=307385&r2=307386&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Arch/Mips.cpp Fri Jul 7 03:35:33 2017
@@ -299,6 +299,8 @@ void mips::getMIPSTargetFeatures(const D
options::OPT_modd_spreg, "nooddspreg");
AddTargetFeature(Args, Features, options::OPT_mno_madd4, options::OPT_mmadd4,
"nomadd4");
+ AddTargetFeature(Args, Features, options::OPT_mlong_calls,
+ options::OPT_mno_long_calls, "long-calls");
}
mips::NanEncoding mips::getSupportedNanEncoding(StringRef &CPU) {
Modified: cfe/trunk/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-features.c?rev=307386&r1=307385&r2=307386&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-features.c (original)
+++ cfe/trunk/test/Driver/mips-features.c Fri Jul 7 03:35:33 2017
@@ -247,3 +247,14 @@
// RUN: | FileCheck --check-prefix=CHECK-IMG-SINGLEFLOAT-FPXX %s
// CHECK-IMG-SINGLEFLOAT-FPXX: "-target-feature" "+single-float"
// CHECK-IMG-SINGLEFLOAT-FPXX: "-target-feature" "+fpxx"
+
+// -mlong-call
+// RUN: %clang -target mips-img-linux-gnu -### -c %s -mlong-calls 2>&1 \
+// RUN: | FileCheck --check-prefix=LONG-CALLS-ON %s
+// RUN: %clang -target mips-img-linux-gnu -### -c %s -mno-long-calls 2>&1 \
+// RUN: | FileCheck --check-prefix=LONG-CALLS-OFF %s
+// RUN: %clang -target mips-img-linux-gnu -### -c %s 2>&1 \
+// RUN: | FileCheck --check-prefix=LONG-CALLS-DEF %s
+// LONG-CALLS-ON: "-target-feature" "+long-calls"
+// LONG-CALLS-OFF: "-target-feature" "-long-calls"
+// LONG-CALLS-DEF-NOT: "long-calls"
More information about the cfe-commits
mailing list