Skip to content

Commit

Permalink
Add a -fsyntax-only argument
Browse files Browse the repository at this point in the history
llvm-svn: 38827
  • Loading branch information
lattner committed Aug 6, 2006
1 parent c697e02 commit eecc5b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions clang/Driver/clang.cpp
Expand Up @@ -47,21 +47,24 @@ Stats("stats", cl::desc("Print performance metrics and statistics"));
enum ProgActions {
ParsePrintCallbacks, // Parse and print each callback.
ParseNoop, // Parse with noop callbacks.
ParseSyntaxOnly, // Parse and perform semantic analysis.
RunPreprocessorOnly, // Just lex, no output.
PrintPreprocessedInput, // -E mode.
DumpTokens // Token dump mode.
};

static cl::opt<ProgActions>
ProgAction(cl::desc("Choose output type:"), cl::ZeroOrMore,
cl::init(ParseNoop),
cl::init(ParseSyntaxOnly),
cl::values(
clEnumValN(RunPreprocessorOnly, "Eonly",
"Just run preprocessor, no output (for timings)"),
clEnumValN(PrintPreprocessedInput, "E",
"Run preprocessor, emit preprocessed file"),
clEnumValN(DumpTokens, "dumptokens",
"Run preprocessor, dump internal rep of tokens"),
clEnumValN(ParseSyntaxOnly, "fsyntax-only",
"Run parser and perform semantic analysis"),
clEnumValN(ParsePrintCallbacks, "parse-print-callbacks",
"Run parser and print each callback invoked"),
clEnumValN(ParseNoop, "parse-noop",
Expand Down Expand Up @@ -745,11 +748,12 @@ int main(int argc, char **argv) {
break;

case ParseNoop: // -parse-noop
ParseFile(PP, new ParserActions(), MainFileID);
break;
case ParsePrintCallbacks:
//ParseFile(PP, new ParserPrintActions(PP), MainFileID);
break;
case ParseSyntaxOnly: // -fsyntax-only
ParseFile(PP, new ParserActions(), MainFileID);
break;
}

if (Stats) {
Expand Down

0 comments on commit eecc5b5

Please sign in to comment.