aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-12 06:48:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-12 06:48:24 +0000
commitbfbeadba3690c5087b5feb518de086b11af03a6e (patch)
tree29e2fdf2cf0da98ca4a5e99258ca85805a7a69b3
parent32358e24af8fd7a7242d3835c444c4e822a70382 (diff)
clang-cc: -fixit is actually option, not an action, although its use with non
-fsyntax-only is probably untested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86962 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/clang-cc/clang-cc.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index e4945ecd8a..925be7efbf 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -102,7 +102,6 @@ enum ProgActions {
RewriteBlocks, // ObjC->C Rewriter for Blocks.
RewriteMacros, // Expand macros but not #includes.
RewriteTest, // Rewriter playground
- FixIt, // Fix-It Rewriter
HTMLTest, // HTML displayer testing stuff.
EmitAssembly, // Emit a .s file.
EmitLLVM, // Emit a .ll file.
@@ -182,8 +181,6 @@ ProgAction(llvm::cl::desc("Choose output type:"), llvm::cl::ZeroOrMore,
"Expand macros without full preprocessing"),
clEnumValN(RewriteBlocks, "rewrite-blocks",
"Rewrite Blocks to C"),
- clEnumValN(FixIt, "fixit",
- "Apply fix-it advice to the input source"),
clEnumValEnd));
@@ -425,6 +422,10 @@ static void ParseFile(Preprocessor &PP, MinimalAction *PA) {
//===----------------------------------------------------------------------===//
// Fix-It Options
//===----------------------------------------------------------------------===//
+
+static llvm::cl::opt<bool>
+FixItAll("fixit", llvm::cl::desc("Apply fix-it advice to the input source"));
+
static llvm::cl::list<ParsedSourceLocation>
FixItAtLocations("fixit-at", llvm::cl::value_desc("source-location"),
llvm::cl::desc("Perform Fix-It modifications at the given source location"));
@@ -608,7 +609,6 @@ static ASTConsumer *CreateConsumerAction(const CompilerInvocation &CompOpts,
return CreateBlockRewriter(InFile, PP.getDiagnostics(),
PP.getLangOptions());
- case FixIt: // We add the rewriter later.
case ParseSyntaxOnly:
return new ASTConsumer();
@@ -725,7 +725,7 @@ static void ProcessInputFile(const CompilerInvocation &CompOpts,
}
// Check if we want a fix-it rewriter.
- if (PA == FixIt || !FixItAtLocations.empty()) {
+ if (FixItAll || !FixItAtLocations.empty()) {
FixItRewrite = new FixItRewriter(PP.getDiagnostics(),
PP.getSourceManager(),
PP.getLangOptions());