forked from OSchip/llvm-project
clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.
llvm-svn: 95785
This commit is contained in:
parent
c7e14704d0
commit
925152c2d0
|
@ -140,6 +140,9 @@ def warn_pch_elide_constructors : Error<
|
|||
def warn_pch_exceptions : Error<
|
||||
"exceptions were %select{disabled|enabled}0 in PCH file but "
|
||||
"are currently %select{disabled|enabled}1">;
|
||||
def warn_pch_sjlj_exceptions : Error<
|
||||
"sjlj-exceptions were %select{disabled|enabled}0 in PCH file but "
|
||||
"are currently %select{disabled|enabled}1">;
|
||||
def warn_pch_objc_runtime : Error<
|
||||
"PCH file was compiled with the %select{NeXT|GNU}0 runtime but the "
|
||||
"%select{NeXT|GNU}1 runtime is selected">;
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
unsigned LaxVectorConversions : 1;
|
||||
unsigned AltiVec : 1; // Support AltiVec-style vector initializers.
|
||||
unsigned Exceptions : 1; // Support exception handling.
|
||||
unsigned SjLjExceptions : 1; // Use setjmp-longjump exception handling.
|
||||
unsigned RTTI : 1; // Support RTTI information.
|
||||
|
||||
unsigned NeXTRuntime : 1; // Use NeXT runtime.
|
||||
|
@ -128,7 +129,7 @@ public:
|
|||
GC = ObjC1 = ObjC2 = ObjCNonFragileABI = ObjCNonFragileABI2 = 0;
|
||||
C99 = Microsoft = CPlusPlus = CPlusPlus0x = 0;
|
||||
CXXOperatorNames = PascalStrings = WritableStrings = 0;
|
||||
Exceptions = Freestanding = NoBuiltin = 0;
|
||||
Exceptions = SjLjExceptions = Freestanding = NoBuiltin = 0;
|
||||
NeXTRuntime = 1;
|
||||
RTTI = 1;
|
||||
LaxVectorConversions = 1;
|
||||
|
|
|
@ -327,6 +327,8 @@ def fblocks : Flag<"-fblocks">,
|
|||
def fheinous_gnu_extensions : Flag<"-fheinous-gnu-extensions">;
|
||||
def fexceptions : Flag<"-fexceptions">,
|
||||
HelpText<"Enable support for exception handling">;
|
||||
def fsjlj_exceptions : Flag<"-fsjlj-exceptions">,
|
||||
HelpText<"Use SjLj style exceptions">;
|
||||
def ffreestanding : Flag<"-ffreestanding">,
|
||||
HelpText<"Assert that the compilation takes place in a freestanding environment">;
|
||||
def fgnu_runtime : Flag<"-fgnu-runtime">,
|
||||
|
|
|
@ -476,6 +476,8 @@ static void LangOptsToArgs(const LangOptions &Opts,
|
|||
Res.push_back("-faltivec");
|
||||
if (Opts.Exceptions)
|
||||
Res.push_back("-fexceptions");
|
||||
if (Opts.SjLjExceptions)
|
||||
Res.push_back("-fsjlj-exceptions");
|
||||
if (!Opts.RTTI)
|
||||
Res.push_back("-fno-rtti");
|
||||
if (!Opts.NeXTRuntime)
|
||||
|
@ -1189,6 +1191,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
|||
Opts.CatchUndefined = Args.hasArg(OPT_fcatch_undefined_behavior);
|
||||
Opts.EmitAllDecls = Args.hasArg(OPT_femit_all_decls);
|
||||
Opts.PICLevel = getLastArgIntValue(Args, OPT_pic_level, 0, Diags);
|
||||
Opts.SjLjExceptions = Args.hasArg(OPT_fsjlj_exceptions);
|
||||
Opts.Static = Args.hasArg(OPT_static_define);
|
||||
Opts.OptimizeSize = 0;
|
||||
|
||||
|
|
|
@ -79,6 +79,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
|
|||
diag::warn_pch_lax_vector_conversions);
|
||||
PARSE_LANGOPT_IMPORTANT(AltiVec, diag::warn_pch_altivec);
|
||||
PARSE_LANGOPT_IMPORTANT(Exceptions, diag::warn_pch_exceptions);
|
||||
PARSE_LANGOPT_IMPORTANT(SjLjExceptions, diag::warn_pch_sjlj_exceptions);
|
||||
PARSE_LANGOPT_IMPORTANT(NeXTRuntime, diag::warn_pch_objc_runtime);
|
||||
PARSE_LANGOPT_IMPORTANT(Freestanding, diag::warn_pch_freestanding);
|
||||
PARSE_LANGOPT_IMPORTANT(NoBuiltin, diag::warn_pch_builtins);
|
||||
|
@ -1747,6 +1748,7 @@ bool PCHReader::ParseLanguageOptions(
|
|||
PARSE_LANGOPT(LaxVectorConversions);
|
||||
PARSE_LANGOPT(AltiVec);
|
||||
PARSE_LANGOPT(Exceptions);
|
||||
PARSE_LANGOPT(SjLjExceptions);
|
||||
PARSE_LANGOPT(NeXTRuntime);
|
||||
PARSE_LANGOPT(Freestanding);
|
||||
PARSE_LANGOPT(NoBuiltin);
|
||||
|
|
|
@ -758,6 +758,7 @@ void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
|
|||
Record.push_back(LangOpts.LaxVectorConversions);
|
||||
Record.push_back(LangOpts.AltiVec);
|
||||
Record.push_back(LangOpts.Exceptions); // Support exception handling.
|
||||
Record.push_back(LangOpts.SjLjExceptions);
|
||||
|
||||
Record.push_back(LangOpts.NeXTRuntime); // Use NeXT runtime.
|
||||
Record.push_back(LangOpts.Freestanding); // Freestanding implementation
|
||||
|
|
Loading…
Reference in New Issue