]> granicus.if.org Git - clang/commitdiff
Driver: Map /Gy to -ffunction-sections
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 23 Mar 2014 17:47:22 +0000 (17:47 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 23 Mar 2014 17:47:22 +0000 (17:47 +0000)
/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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204564 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CLCompatOptions.td
test/Driver/cl-options.c

index edc932ca0c40589c84eddbdb245279bcd9a1db39..f5cd2bf1ffa3144129d9a72219bba52e84a1bd46 100644 (file)
@@ -62,6 +62,10 @@ def _SLASH_GR : CLFlag<"GR">, HelpText<"Enable RTTI">, Alias<frtti>;
 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">;
index dee71fff4f3e9aca079fa074b9b9ec85716587ff..b3623b75e01edb9a70485c2f270c650bef18c777 100644 (file)
 // 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"
 // RUN:     /Gs1000 \
 // RUN:     /GT \
 // RUN:     /GX \
-// RUN:     /Gy \
-// RUN:     /Gy- \
 // RUN:     /Gz \
 // RUN:     /GZ \
 // RUN:     /H \