[cfe-commits] r103258 - in /cfe/trunk: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h lib/Frontend/BoostConAction.cpp lib/Frontend/CMakeLists.txt lib/Frontend/CompilerInvocation.cpp tools/driver/cc1_main.cpp

Douglas Gregor dgregor at apple.com
Fri May 7 08:41:56 PDT 2010


Author: dgregor
Date: Fri May  7 10:41:56 2010
New Revision: 103258

URL: http://llvm.org/viewvc/llvm-project?rev=103258&view=rev
Log:
Add a stub frontend action for BoostCon, for next week's workshop.

Added:
    cfe/trunk/lib/Frontend/BoostConAction.cpp   (with props)
Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Frontend/FrontendActions.h
    cfe/trunk/include/clang/Frontend/FrontendOptions.h
    cfe/trunk/lib/Frontend/CMakeLists.txt
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/tools/driver/cc1_main.cpp

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Fri May  7 10:41:56 2010
@@ -296,6 +296,8 @@
   HelpText<"Build ASTs and then debug dump them">;
 def ast_view : Flag<"-ast-view">,
   HelpText<"Build ASTs and view them with GraphViz">;
+def boostcon : Flag<"-boostcon">,
+  HelpText<"BoostCon workshop mode">;
 def print_decl_contexts : Flag<"-print-decl-contexts">,
   HelpText<"Print DeclContexts and their Decls">;
 def emit_pth : Flag<"-emit-pth">,

Modified: cfe/trunk/include/clang/Frontend/FrontendActions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendActions.h?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendActions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendActions.h Fri May  7 10:41:56 2010
@@ -133,6 +133,12 @@
   virtual bool hasCodeCompletionSupport() const { return true; }
 };
 
+class BoostConAction : public SyntaxOnlyAction {
+protected:
+  virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,
+                                         llvm::StringRef InFile);
+};
+
 /**
  * \brief Frontend action adaptor that merges ASTs together.
  *

Modified: cfe/trunk/include/clang/Frontend/FrontendOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendOptions.h?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendOptions.h Fri May  7 10:41:56 2010
@@ -23,6 +23,7 @@
     ASTPrint,               ///< Parse ASTs and print them.
     ASTPrintXML,            ///< Parse ASTs and print them in XML.
     ASTView,                ///< Parse ASTs and view them in Graphviz.
+    BoostCon,               ///< BoostCon mode.
     DumpRawTokens,          ///< Dump out raw tokens.
     DumpTokens,             ///< Dump out preprocessed tokens.
     EmitAssembly,           ///< Emit a .s file.

Added: cfe/trunk/lib/Frontend/BoostConAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/BoostConAction.cpp?rev=103258&view=auto
==============================================================================
--- cfe/trunk/lib/Frontend/BoostConAction.cpp (added)
+++ cfe/trunk/lib/Frontend/BoostConAction.cpp Fri May  7 10:41:56 2010
@@ -0,0 +1,29 @@
+//===-- BoostConAction.cpp - BoostCon Workshop Action -----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include "clang/Frontend/FrontendActions.h"
+#include "clang/AST/ASTConsumer.h"
+using namespace clang;
+
+namespace {
+  class BoostConASTConsumer : public ASTConsumer {
+  public:
+    /// HandleTranslationUnit - This method is called when the ASTs for entire
+    /// translation unit have been parsed.
+    virtual void HandleTranslationUnit(ASTContext &Ctx);
+  };
+}
+
+ASTConsumer *BoostConAction::CreateASTConsumer(CompilerInstance &CI,
+                                               llvm::StringRef InFile) {
+  return new BoostConASTConsumer();
+}
+
+void BoostConASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
+  fprintf(stderr, "Welcome to BoostCon!\n");
+}

Propchange: cfe/trunk/lib/Frontend/BoostConAction.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/lib/Frontend/BoostConAction.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/lib/Frontend/BoostConAction.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/lib/Frontend/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CMakeLists.txt?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CMakeLists.txt (original)
+++ cfe/trunk/lib/Frontend/CMakeLists.txt Fri May  7 10:41:56 2010
@@ -5,6 +5,7 @@
   ASTMerge.cpp
   ASTUnit.cpp
   AnalysisConsumer.cpp
+  BoostConAction.cpp
   CacheTokens.cpp
   CodeGenAction.cpp
   CompilerInstance.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri May  7 10:41:56 2010
@@ -308,6 +308,7 @@
   case frontend::ASTPrint:               return "-ast-print";
   case frontend::ASTPrintXML:            return "-ast-print-xml";
   case frontend::ASTView:                return "-ast-view";
+  case frontend::BoostCon:               return "-boostcon";
   case frontend::DumpRawTokens:          return "-dump-raw-tokens";
   case frontend::DumpTokens:             return "-dump-tokens";
   case frontend::EmitAssembly:           return "-S";
@@ -937,6 +938,8 @@
       Opts.ProgramAction = frontend::ASTPrintXML; break;
     case OPT_ast_view:
       Opts.ProgramAction = frontend::ASTView; break;
+    case OPT_boostcon:
+      Opts.ProgramAction = frontend::BoostCon; break;
     case OPT_dump_raw_tokens:
       Opts.ProgramAction = frontend::DumpRawTokens; break;
     case OPT_dump_tokens:

Modified: cfe/trunk/tools/driver/cc1_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?rev=103258&r1=103257&r2=103258&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1_main.cpp Fri May  7 10:41:56 2010
@@ -63,6 +63,7 @@
   case ASTPrint:               return new ASTPrintAction();
   case ASTPrintXML:            return new ASTPrintXMLAction();
   case ASTView:                return new ASTViewAction();
+  case BoostCon:               return new BoostConAction();
   case DumpRawTokens:          return new DumpRawTokensAction();
   case DumpTokens:             return new DumpTokensAction();
   case EmitAssembly:           return new EmitAssemblyAction();





More information about the cfe-commits mailing list