clang-cl: Add support for /Zp

CL's /Zp flag is analogous to GCC's -fpack-struct, it controls the
default maximum alignment of records.

Differential Revision: http://reviews.llvm.org/D4671

llvm-svn: 213958
This commit is contained in:
David Majnemer 2014-07-25 17:30:10 +00:00
parent 4b4d8ecde1
commit 104fb54dfa
2 changed files with 12 additions and 3 deletions

View File

@ -132,6 +132,12 @@ def _SLASH_vd : CLJoined<"vd">, HelpText<"Control vtordisp placement">,
def _SLASH_Z7 : CLFlag<"Z7">, Alias<gline_tables_only>;
def _SLASH_Zi : CLFlag<"Zi">, HelpText<"Enable debug information">,
Alias<gline_tables_only>;
def _SLASH_Zp : CLJoined<"Zp">,
HelpText<"Specify the default maximum struct packing alignment">,
Alias<fpack_struct_EQ>;
def _SLASH_Zp_flag : CLFlag<"Zp">,
HelpText<"Set the default maximum struct packing alignment to 1">,
Alias<fpack_struct_EQ>, AliasArgs<["1"]>;
def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Syntax-check only">,
Alias<fsyntax_only>;
@ -274,5 +280,4 @@ def _SLASH_Ze : CLFlag<"Ze">;
def _SLASH_Zg : CLFlag<"Zg">;
def _SLASH_ZI : CLFlag<"ZI">;
def _SLASH_Zl : CLFlag<"Zl">;
def _SLASH_Zp : CLJoined<"Zp">;
def _SLASH_ZW : CLJoined<"ZW">;

View File

@ -135,6 +135,12 @@
// RUN: %clang_cl /w -### -- %s 2>&1 | FileCheck -check-prefix=w %s
// w: -w
// RUN: %clang_cl /Zp -### -- %s 2>&1 | FileCheck -check-prefix=ZP %s
// ZP: -fpack-struct=1
// RUN: %clang_cl /Zp2 -### -- %s 2>&1 | FileCheck -check-prefix=ZP2 %s
// ZP2: -fpack-struct=2
// RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s
// Zs: -fsyntax-only
@ -278,8 +284,6 @@
// RUN: /Zi \
// RUN: /ZI \
// RUN: /Zl \
// RUN: /Zp \
// RUN: /Zp1 \
// RUN: /ZW:nostdlib \
// RUN: -- %s 2>&1