r204564 - Driver: Map /Gy to -ffunction-sections
David Majnemer
david.majnemer at gmail.com
Sun Mar 23 10:47:22 PDT 2014
Author: majnemer
Date: Sun Mar 23 12:47:22 2014
New Revision: 204564
URL: http://llvm.org/viewvc/llvm-project?rev=204564&view=rev
Log:
Driver: Map /Gy to -ffunction-sections
/Gy is equivalent to -ffunction-sections.
/Gy- is equivalent to -fno-function-sections.
Currently, LLVM doesn't do anything interesting with -ffunction-sections
under WinCOFF.
Modified:
cfe/trunk/include/clang/Driver/CLCompatOptions.td
cfe/trunk/test/Driver/cl-options.c
Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=204564&r1=204563&r2=204564&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Sun Mar 23 12:47:22 2014
@@ -62,6 +62,10 @@ def _SLASH_GR : CLFlag<"GR">, HelpText<"
def _SLASH_GR_ : CLFlag<"GR-">, HelpText<"Disable RTTI">, Alias<fno_rtti>;
def _SLASH_GF_ : CLFlag<"GF-">, HelpText<"Disable string pooling">,
Alias<fwritable_strings>;
+def _SLASH_Gy : CLFlag<"Gy">, HelpText<"Put each function in it's own section">,
+ Alias<ffunction_sections>;
+def _SLASH_Gy_ : CLFlag<"Gy-">, HelpText<"Don't put each function in it's own section">,
+ Alias<fno_function_sections>;
def _SLASH_help : CLFlag<"help">, Alias<help>,
HelpText<"Display available options">;
def _SLASH_HELP : CLFlag<"HELP">, Alias<help>;
@@ -225,8 +229,6 @@ def _SLASH_GS : CLFlag<"GS">;
def _SLASH_Gs : CLJoined<"Gs">;
def _SLASH_GT : CLFlag<"GT">;
def _SLASH_GX : CLFlag<"GX">;
-def _SLASH_Gy : CLFlag<"Gy">;
-def _SLASH_Gy_ : CLFlag<"Gy-">;
def _SLASH_Gz : CLFlag<"Gz">;
def _SLASH_GZ : CLFlag<"GZ">;
def _SLASH_H : CLFlag<"H">;
Modified: cfe/trunk/test/Driver/cl-options.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=204564&r1=204563&r2=204564&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Sun Mar 23 12:47:22 2014
@@ -24,6 +24,12 @@
// RUN: %clang_cl /GR- -### -- %s 2>&1 | FileCheck -check-prefix=GR_ %s
// GR_: -fno-rtti
+// RUN: %clang_cl /Gy -### -- %s 2>&1 | FileCheck -check-prefix=Gy %s
+// Gy: -ffunction-sections
+
+// RUN: %clang_cl /Gy /Gy- -### -- %s 2>&1 | FileCheck -check-prefix=Gy_ %s
+// Gy_-NOT: -ffunction-sections
+
// RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
// RUN: %clang_cl /I myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
// SLASH_I: "-I" "myincludedir"
@@ -198,8 +204,6 @@
// RUN: /Gs1000 \
// RUN: /GT \
// RUN: /GX \
-// RUN: /Gy \
-// RUN: /Gy- \
// RUN: /Gz \
// RUN: /GZ \
// RUN: /H \
More information about the cfe-commits
mailing list