[PATCH] D31972: Do not force the frame pointer by default for ARM EABI
Christian Bruel via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 20 07:44:50 PDT 2017
chrib updated this revision to Diff 95958.
chrib added a comment.
- Fix thinko in test
https://reviews.llvm.org/D31972
Files:
lib/Driver/ToolChains/Clang.cpp
test/CodeGen/arm-fp-eabi.c
Index: test/CodeGen/arm-fp-eabi.c
===================================================================
--- /dev/null
+++ test/CodeGen/arm-fp-eabi.c
@@ -0,0 +1,13 @@
+// RUN: %clang %s -target arm-none-eabi -O2 -S -o nofp.s
+// RUN: not grep '.setfp' nofp.s
+// RUN: %clang %s -target arm-none-eabi -fno-omit-frame-pointer -O2 -S -o fp.s
+// RUN: grep '.setfp' fp.s
+
+void
+foo(void);
+
+int main()
+{
+ foo();
+ return 0;
+}
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp
+++ lib/Driver/ToolChains/Clang.cpp
@@ -566,6 +566,17 @@
}
}
+ if (Triple.getEnvironment() == llvm::Triple::EABI) {
+ switch (Triple.getArch()) {
+ case llvm::Triple::arm:
+ case llvm::Triple::thumb:
+ // ARM EABI doesn't require a frame pointer
+ return !areOptimizationsEnabled(Args);
+ default:
+ return true;
+ }
+ }
+
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31972.95958.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170420/cede290f/attachment.bin>
More information about the cfe-commits
mailing list