Add -fno-blocks support. This fixes block-no-block-def.c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63385 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mike Stump 2009-01-30 08:22:07 +00:00
Родитель 8562ae74ae
Коммит b55cc635f5
3 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -486,7 +486,10 @@ LaxVectorConversions("flax-vector-conversions",
" with a different number of elements or " " with a different number of elements or "
"different element types")); "different element types"));
static llvm::cl::opt<bool> static llvm::cl::opt<bool>
EnableBlocks("fblocks", llvm::cl::desc("enable the 'blocks' language feature")); EnableBlocks("fblocks", llvm::cl::desc("enable the 'blocks' language feature"), llvm::cl::ValueDisallowed);
static llvm::cl::inverse_opt
DisableBlocks("fno-blocks", llvm::cl::opposite_of(EnableBlocks), llvm::cl::ValueDisallowed);
static llvm::cl::opt<bool> static llvm::cl::opt<bool>
ObjCNonFragileABI("fobjc-nonfragile-abi", llvm::cl::desc("enable objective-c's nonfragile abi")); ObjCNonFragileABI("fobjc-nonfragile-abi", llvm::cl::desc("enable objective-c's nonfragile abi"));
@ -614,7 +617,7 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
Options.WritableStrings = WritableStrings; Options.WritableStrings = WritableStrings;
Options.LaxVectorConversions = LaxVectorConversions; Options.LaxVectorConversions = LaxVectorConversions;
Options.Exceptions = Exceptions; Options.Exceptions = Exceptions;
if (EnableBlocks.getPosition()) if (EnableBlocks.getPosition() || DisableBlocks.getPosition())
Options.Blocks = EnableBlocks; Options.Blocks = EnableBlocks;
// Override the default runtime if the user requested it. // Override the default runtime if the user requested it.

Просмотреть файл

@ -768,6 +768,11 @@ class OptionParser:
# want to avoid passing them to gcc/cc1 (which will generally # want to avoid passing them to gcc/cc1 (which will generally
# not eat them), or should we let the user sort it out. # not eat them), or should we let the user sort it out.
self.fblocksGroup = OptionGroup('-fblocks')
self.f_blocks = self.addOption(FlagOption('-fblocks', self.fblocksGroup))
self.f_noblocks = self.addOption(FlagOption('-fno-blocks', self.fblocksGroup))
# self.fblocksOption = self.addOption(JoinedOption('-fblocks', self.fblocksGroup))
self.fGroup = OptionGroup('-f') self.fGroup = OptionGroup('-f')
self.fastOption = self.addOption(FlagOption('-fast', self.fGroup)) self.fastOption = self.addOption(FlagOption('-fast', self.fGroup))
self.fastfOption = self.addOption(FlagOption('-fastf', self.fGroup)) self.fastfOption = self.addOption(FlagOption('-fastf', self.fGroup))

Просмотреть файл

@ -305,8 +305,7 @@ class Clang_CompileTool(Tool):
cmd_args.append('-token-cache') cmd_args.append('-token-cache')
cmd_args.append(pthPath) cmd_args.append(pthPath)
# FIXME: Dehardcode this. arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
cmd_args.append('-fblocks')
arglist.addAllArgs(cmd_args, arglist.parser.OOption) arglist.addAllArgs(cmd_args, arglist.parser.OOption)
arglist.addAllArgs2(cmd_args, arglist.parser.ClangWGroup, arglist.parser.pedanticGroup) arglist.addAllArgs2(cmd_args, arglist.parser.ClangWGroup, arglist.parser.pedanticGroup)
@ -466,6 +465,7 @@ class Darwin_X86_CC1Tool(Tool):
# ccc treats -fsyntax-only specially. # ccc treats -fsyntax-only specially.
arglist.addAllArgs2(cmd_args, arglist.parser.fGroup, arglist.addAllArgs2(cmd_args, arglist.parser.fGroup,
arglist.parser.syntaxOnlyOption) arglist.parser.syntaxOnlyOption)
arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
arglist.addAllArgs(cmd_args, arglist.parser.undefOption) arglist.addAllArgs(cmd_args, arglist.parser.undefOption)
if arglist.getLastArg(arglist.parser.QnOption): if arglist.getLastArg(arglist.parser.QnOption):
@ -538,6 +538,7 @@ class Darwin_X86_CC1Tool(Tool):
# ccc treats -fsyntax-only specially. # ccc treats -fsyntax-only specially.
arglist.addAllArgs2(cmd_args, arglist.parser.fGroup, arglist.addAllArgs2(cmd_args, arglist.parser.fGroup,
arglist.parser.syntaxOnlyOption) arglist.parser.syntaxOnlyOption)
arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
if (arglist.getLastArg(arglist.parser.gGroup) and if (arglist.getLastArg(arglist.parser.gGroup) and
not arglist.getLastArg(arglist.parser.g0Option) and not arglist.getLastArg(arglist.parser.g0Option) and