diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-20 20:18:03 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-20 20:18:03 +0000 |
commit | af82e3510b768f2f194eaebdea5924f4f506caed (patch) | |
tree | 4524c67f4cc442ffcd2c01f312243cf1f591c4c0 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 14d74d649aba2ec3fe0d9a1fb7718d26053eeade (diff) | |
download | bcm5719-llvm-af82e3510b768f2f194eaebdea5924f4f506caed.tar.gz bcm5719-llvm-af82e3510b768f2f194eaebdea5924f4f506caed.zip |
Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.
llvm-svn: 108913
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 00363d91fd4..b007ac4bd3a 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -331,6 +331,7 @@ static const char *getActionName(frontend::ActionKind Kind) { case frontend::ParsePrintCallbacks: return "-parse-print-callbacks"; case frontend::ParseSyntaxOnly: return "-fsyntax-only"; case frontend::PrintDeclContext: return "-print-decl-contexts"; + case frontend::PrintPreamble: return "-print-preamble"; case frontend::PrintPreprocessedInput: return "-E"; case frontend::RewriteMacros: return "-rewrite-macros"; case frontend::RewriteObjC: return "-rewrite-objc"; @@ -989,6 +990,8 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Opts.ProgramAction = frontend::ParseSyntaxOnly; break; case OPT_print_decl_contexts: Opts.ProgramAction = frontend::PrintDeclContext; break; + case OPT_print_preamble: + Opts.ProgramAction = frontend::PrintPreamble; break; case OPT_E: Opts.ProgramAction = frontend::PrintPreprocessedInput; break; case OPT_rewrite_macros: |