clang-cc: Change -fsigned-char=0 to -fno-unsigned-char and pass -pic-level using separate args.

llvm-svn: 90054
This commit is contained in:
Daniel Dunbar 2009-11-29 02:39:08 +00:00
parent 6e227ca836
commit 5fe0866b9d
4 changed files with 15 additions and 18 deletions

View File

@ -260,8 +260,6 @@ def faltivec : Flag<"-faltivec">,
HelpText<"Enable AltiVec vector initializer syntax">;
def faccess_control : Flag<"-faccess-control">,
HelpText<"Enable C++ access control">;
def fsigned_char : Flag<"-fsigned-char">,
HelpText<"Force char to be a signed/unsigned type">;
def fdollars_in_identifiers : Flag<"-fdollars-in-identifiers">,
HelpText<"Allow '$' in identifiers">;
def femit_all_decls : Flag<"-femit-all-decls">,
@ -281,12 +279,14 @@ def fms_extensions : Flag<"-fms-extensions">,
HelpText<"Accept some non-standard constructs used in Microsoft header files ">;
def main_file_name : Separate<"-main-file-name">,
HelpText<"Main file name to use for debug info">;
def fno_math_errno : Flag<"-fno-math-errno">,
HelpText<"Don't require math functions to respect errno">;
def fno_elide_constructors : Flag<"-fno-elide-constructors">,
HelpText<"Disable C++ copy constructor elision">;
def fno_lax_vector_conversions : Flag<"-fno-lax-vector-conversions">,
HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">;
def fno_math_errno : Flag<"-fno-math-errno">,
HelpText<"Don't require math functions to respect errno">;
def fno_signed_char : Flag<"-fno-signed-char">,
HelpText<"Char is unsigned">;
def fno_operator_names : Flag<"-fno-operator-names">,
HelpText<"Do not treat C++ operator name keywords as synonyms for operators">;
def fconstant_string_class : Separate<"-fconstant-string-class">,
@ -302,7 +302,7 @@ def fobjc_nonfragile_abi : Flag<"-fobjc-nonfragile-abi">,
HelpText<"enable objective-c's nonfragile abi">;
def ftrapv : Flag<"-ftrapv">,
HelpText<"Trap on integer overflow">;
def pic_level : Separate<"pic-level">,
def pic_level : Separate<"-pic-level">,
HelpText<"-Value for __PIC__">;
def pthread : Flag<"-pthread">,
HelpText<"Support POSIX threads in generated code">;

View File

@ -708,10 +708,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// FIXME: This isn't quite right on Darwin, which always sets
// __PIC__=2.
if (strcmp(Model, "pic") == 0 || strcmp(Model, "dynamic-no-pic") == 0) {
if (Args.hasArg(options::OPT_fPIC))
CmdArgs.push_back("-pic-level=2");
else
CmdArgs.push_back("-pic-level=1");
CmdArgs.push_back("-pic-level");
CmdArgs.push_back(Args.hasArg(options::OPT_fPIC) ? "2" : "1");
}
if (Args.hasArg(options::OPT_ftime_report))
@ -935,7 +933,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// -fsigned-char is default.
if (!Args.hasFlag(options::OPT_fsigned_char, options::OPT_funsigned_char,
isSignedCharDefault(getToolChain().getTriple())))
CmdArgs.push_back("-fsigned-char=0");
CmdArgs.push_back("-fno-signed-char");
// -fms-extensions=0 is default.
if (Args.hasFlag(options::OPT_fms_extensions, options::OPT_fno_ms_extensions,

View File

@ -108,7 +108,7 @@
// PASCAL:#define __PASCAL_STRINGS__ 1
//
//
// RUN: clang-cc -fsigned-char -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix SCHAR %s
// RUN: clang-cc -E -dM -fms-extensions=0 < /dev/null | FileCheck -check-prefix SCHAR %s
//
// SCHAR:#define __STDC__ 1
// SCHAR-NOT:#define __UNSIGNED_CHAR__
@ -524,7 +524,7 @@
// PIC16:#define ram __attribute__((address_space(0)))
// PIC16:#define rom __attribute__((address_space(1)))
//
// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc64-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix PPC64 %s
// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc64-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64 %s
//
// PPC64:#define _ARCH_PPC 1
// PPC64:#define _ARCH_PPC64 1
@ -612,7 +612,7 @@
// PPC64:#define __ppc64__ 1
// PPC64:#define __ppc__ 1
//
// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix PPC %s
// RUN: clang-cc -E -dM -ffreestanding -triple=powerpc-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix PPC %s
//
// PPC:#define _ARCH_PPC 1
// PPC:#define _BIG_ENDIAN 1
@ -696,7 +696,7 @@
// PPC:#define __WINT_WIDTH__ 32
// PPC:#define __ppc__ 1
//
// RUN: clang-cc -E -dM -ffreestanding -triple=s390x-none-none -fsigned-char=0 < /dev/null | FileCheck -check-prefix S390X %s
// RUN: clang-cc -E -dM -ffreestanding -triple=s390x-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix S390X %s
//
// S390X:#define __CHAR_BIT__ 8
// S390X:#define __CHAR_UNSIGNED__ 1

View File

@ -455,8 +455,8 @@ AccessControl("faccess-control",
llvm::cl::desc("Enable C++ access control"));
static llvm::cl::opt<bool>
CharIsSigned("fsigned-char",
llvm::cl::desc("Force char to be a signed/unsigned type"));
NoSignedChar("fno-signed-char",
llvm::cl::desc("Char is unsigned"));
static llvm::cl::opt<bool>
DollarsInIdents("fdollars-in-identifiers",
@ -1140,8 +1140,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
Options.Rtti = !NoRtti;
if (EnableBlocks.getPosition())
Options.Blocks = EnableBlocks;
if (CharIsSigned.getPosition())
Options.CharIsSigned = CharIsSigned;
Options.CharIsSigned = !NoSignedChar;
if (ShortWChar.getPosition())
Options.ShortWChar = ShortWChar;