diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-13 17:21:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-13 17:21:33 +0000 |
commit | 79a91418bd1a5e1cb50b34ec8a5d45a4eea4e898 (patch) | |
tree | e0871a264eeffe0faaf2e7bf42dc4eb0fd83bce3 /clang/lib/Frontend | |
parent | 0494c5c35d801083f63b033d8367909288b50a76 (diff) | |
download | bcm5719-llvm-79a91418bd1a5e1cb50b34ec8a5d45a4eea4e898.tar.gz bcm5719-llvm-79a91418bd1a5e1cb50b34ec8a5d45a4eea4e898.zip |
Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.
AST serialization changes are next up.
llvm-svn: 139605
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 20 | ||||
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index e7b88542241..6c999caf24f 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -713,11 +713,11 @@ static void LangOptsToArgs(const LangOptions &Opts, Res.push_back("-fshort-wchar"); if (!Opts.ElideConstructors) Res.push_back("-fno-elide-constructors"); - if (Opts.getGCMode() != LangOptions::NonGC) { - if (Opts.getGCMode() == LangOptions::HybridGC) { + if (Opts.getGC() != LangOptions::NonGC) { + if (Opts.getGC() == LangOptions::HybridGC) { Res.push_back("-fobjc-gc"); } else { - assert(Opts.getGCMode() == LangOptions::GCOnly && "Invalid GC mode!"); + assert(Opts.getGC() == LangOptions::GCOnly && "Invalid GC mode!"); Res.push_back("-fobjc-gc-only"); } } @@ -744,9 +744,9 @@ static void LangOptsToArgs(const LangOptions &Opts, if (Opts.InlineVisibilityHidden) Res.push_back("-fvisibility-inlines-hidden"); - if (Opts.getStackProtectorMode() != 0) { + if (Opts.getStackProtector() != 0) { Res.push_back("-stack-protector"); - Res.push_back(llvm::utostr(Opts.getStackProtectorMode())); + Res.push_back(llvm::utostr(Opts.getStackProtector())); } if (Opts.InstantiationDepth != DefaultLangOpts.InstantiationDepth) { Res.push_back("-ftemplate-depth"); @@ -1586,9 +1586,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, if (Opts.ObjC1) { if (Args.hasArg(OPT_fobjc_gc_only)) - Opts.setGCMode(LangOptions::GCOnly); + Opts.setGC(LangOptions::GCOnly); else if (Args.hasArg(OPT_fobjc_gc)) - Opts.setGCMode(LangOptions::HybridGC); + Opts.setGC(LangOptions::HybridGC); else if (Args.hasArg(OPT_fobjc_arc)) { Opts.ObjCAutoRefCount = 1; if (!Args.hasArg(OPT_fobjc_nonfragile_abi)) @@ -1737,9 +1737,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Diags.Report(diag::err_drv_invalid_value) << Args.getLastArg(OPT_stack_protector)->getAsString(Args) << SSP; break; - case 0: Opts.setStackProtectorMode(LangOptions::SSPOff); break; - case 1: Opts.setStackProtectorMode(LangOptions::SSPOn); break; - case 2: Opts.setStackProtectorMode(LangOptions::SSPReq); break; + case 0: Opts.setStackProtector(LangOptions::SSPOff); break; + case 1: Opts.setStackProtector(LangOptions::SSPOn); break; + case 2: Opts.setStackProtector(LangOptions::SSPReq); break; } } diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index d356c66c94e..474de77f267 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -431,7 +431,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, Builder.defineMacro("OBJC_ZEROCOST_EXCEPTIONS"); } - if (LangOpts.getGCMode() != LangOptions::NonGC) + if (LangOpts.getGC() != LangOptions::NonGC) Builder.defineMacro("__OBJC_GC__"); if (LangOpts.NeXTRuntime) @@ -604,9 +604,9 @@ static void InitializePredefinedMacros(const TargetInfo &TI, int Dig = PickFP(&TI.getLongDoubleFormat(), -1/*FIXME*/, 17, 21, 33, 36); Builder.defineMacro("__DECIMAL_DIG__", Twine(Dig)); - if (LangOpts.getStackProtectorMode() == LangOptions::SSPOn) + if (LangOpts.getStackProtector() == LangOptions::SSPOn) Builder.defineMacro("__SSP__"); - else if (LangOpts.getStackProtectorMode() == LangOptions::SSPReq) + else if (LangOpts.getStackProtector() == LangOptions::SSPReq) Builder.defineMacro("__SSP_ALL__", "2"); if (FEOpts.ProgramAction == frontend::RewriteObjC) |