aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/clang.cpp7
-rw-r--r--tools/ccc/ccclib/Arguments.py5
-rw-r--r--tools/ccc/ccclib/Tools.py5
3 files changed, 13 insertions, 4 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 4e79733043..b16a836571 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -486,7 +486,10 @@ LaxVectorConversions("flax-vector-conversions",
" with a different number of elements or "
"different element types"));
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>
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.LaxVectorConversions = LaxVectorConversions;
Options.Exceptions = Exceptions;
- if (EnableBlocks.getPosition())
+ if (EnableBlocks.getPosition() || DisableBlocks.getPosition())
Options.Blocks = EnableBlocks;
// Override the default runtime if the user requested it.
diff --git a/tools/ccc/ccclib/Arguments.py b/tools/ccc/ccclib/Arguments.py
index 0f258cfda4..dcf1e70188 100644
--- a/tools/ccc/ccclib/Arguments.py
+++ b/tools/ccc/ccclib/Arguments.py
@@ -768,6 +768,11 @@ class OptionParser:
# want to avoid passing them to gcc/cc1 (which will generally
# 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.fastOption = self.addOption(FlagOption('-fast', self.fGroup))
self.fastfOption = self.addOption(FlagOption('-fastf', self.fGroup))
diff --git a/tools/ccc/ccclib/Tools.py b/tools/ccc/ccclib/Tools.py
index 6156684ca5..a86ab9ba9f 100644
--- a/tools/ccc/ccclib/Tools.py
+++ b/tools/ccc/ccclib/Tools.py
@@ -305,8 +305,7 @@ class Clang_CompileTool(Tool):
cmd_args.append('-token-cache')
cmd_args.append(pthPath)
- # FIXME: Dehardcode this.
- cmd_args.append('-fblocks')
+ arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
arglist.addAllArgs(cmd_args, arglist.parser.OOption)
arglist.addAllArgs2(cmd_args, arglist.parser.ClangWGroup, arglist.parser.pedanticGroup)
@@ -466,6 +465,7 @@ class Darwin_X86_CC1Tool(Tool):
# ccc treats -fsyntax-only specially.
arglist.addAllArgs2(cmd_args, arglist.parser.fGroup,
arglist.parser.syntaxOnlyOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
arglist.addAllArgs(cmd_args, arglist.parser.undefOption)
if arglist.getLastArg(arglist.parser.QnOption):
@@ -538,6 +538,7 @@ class Darwin_X86_CC1Tool(Tool):
# ccc treats -fsyntax-only specially.
arglist.addAllArgs2(cmd_args, arglist.parser.fGroup,
arglist.parser.syntaxOnlyOption)
+ arglist.addAllArgs(cmd_args, arglist.parser.fblocksGroup)
if (arglist.getLastArg(arglist.parser.gGroup) and
not arglist.getLastArg(arglist.parser.g0Option) and