[cfe-commits] r109392 - in /cfe/trunk: include/clang/Driver/ include/clang/Frontend/ include/clang/Parse/ lib/Frontend/ lib/Parse/ test/Coverage/ test/Parser/ tools/driver/

Douglas Gregor dgregor at apple.com
Sun Jul 25 21:08:02 PDT 2010


Author: dgregor
Date: Sun Jul 25 23:08:02 2010
New Revision: 109392

URL: http://llvm.org/viewvc/llvm-project?rev=109392&view=rev
Log:
Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.

Added:
    cfe/trunk/lib/Parse/Action.cpp   (with props)
Removed:
    cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp
    cfe/trunk/lib/Parse/MinimalAction.cpp
    cfe/trunk/test/Coverage/parse-callbacks.c
    cfe/trunk/test/Coverage/parse-callbacks.m
    cfe/trunk/test/Parser/2008-10-31-parse-noop-failure.c
Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/include/clang/Frontend/FrontendActions.h
    cfe/trunk/include/clang/Frontend/FrontendOptions.h
    cfe/trunk/include/clang/Frontend/Utils.h
    cfe/trunk/include/clang/Parse/Action.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/Frontend/CMakeLists.txt
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp
    cfe/trunk/lib/Frontend/FrontendActions.cpp
    cfe/trunk/lib/Parse/CMakeLists.txt
    cfe/trunk/test/Parser/block-block-storageclass.c
    cfe/trunk/test/Parser/block-pointer-decl.c
    cfe/trunk/test/Parser/cxx-condition.cpp
    cfe/trunk/test/Parser/cxx-namespace-alias.cpp
    cfe/trunk/test/Parser/expressions.c
    cfe/trunk/test/Parser/expressions.m
    cfe/trunk/test/Parser/method-prototype-1.m
    cfe/trunk/test/Parser/objc-messaging-1.m
    cfe/trunk/test/Parser/selector-1.m
    cfe/trunk/test/Parser/types.c
    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=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Sun Jul 25 23:08:02 2010
@@ -294,16 +294,12 @@
   HelpText<"Run preprocessor, dump internal rep of tokens">;
 def init_only : Flag<"-init-only">,
   HelpText<"Only execute frontend initialization">;
-def parse_noop : Flag<"-parse-noop">,
-  HelpText<"Run parser with noop callbacks (for timings)">;
 def fsyntax_only : Flag<"-fsyntax-only">,
   HelpText<"Run parser and perform semantic analysis">;
 def fixit : Flag<"-fixit">,
   HelpText<"Apply fix-it advice to the input source">;
 def fixit_EQ : Joined<"-fixit=">,
   HelpText<"Apply fix-it advice creating a file with the given suffix">;
-def parse_print_callbacks : Flag<"-parse-print-callbacks">,
-  HelpText<"Run parser and print each callback invoked">;
 def print_preamble : Flag<"-print-preamble">,
   HelpText<"Print the \"preamble\" of a file, which is a candidate for implicit"
            " precompiled headers.">;

Modified: cfe/trunk/include/clang/Frontend/FrontendActions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendActions.h?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendActions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendActions.h Sun Jul 25 23:08:02 2010
@@ -163,21 +163,11 @@
   void ExecuteAction();
 };
 
-class ParseOnlyAction : public PreprocessorFrontendAction {
-protected:
-  void ExecuteAction();
-};
-
 class PreprocessOnlyAction : public PreprocessorFrontendAction {
 protected:
   void ExecuteAction();
 };
 
-class PrintParseAction : public PreprocessorFrontendAction {
-protected:
-  void ExecuteAction();
-};
-
 class PrintPreprocessedAction : public PreprocessorFrontendAction {
 protected:
   void ExecuteAction();

Modified: cfe/trunk/include/clang/Frontend/FrontendOptions.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/FrontendOptions.h?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/FrontendOptions.h (original)
+++ cfe/trunk/include/clang/Frontend/FrontendOptions.h Sun Jul 25 23:08:02 2010
@@ -39,8 +39,6 @@
     GeneratePTH,            ///< Generate pre-tokenized header.
     InheritanceView,        ///< View C++ inheritance for a specified class.
     InitOnly,               ///< Only execute frontend initialization.
-    ParseNoop,              ///< Parse with noop callbacks.
-    ParsePrintCallbacks,    ///< Parse and print each callback.
     ParseSyntaxOnly,        ///< Parse and perform semantic analysis.
     PluginAction,           ///< Run a plugin action, \see ActionName.
     PrintDeclContext,       ///< Print DeclContext and their Decls.

Modified: cfe/trunk/include/clang/Frontend/Utils.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/Utils.h?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/Utils.h (original)
+++ cfe/trunk/include/clang/Frontend/Utils.h Sun Jul 25 23:08:02 2010
@@ -31,7 +31,6 @@
 class HeaderSearchOptions;
 class IdentifierTable;
 class LangOptions;
-class MinimalAction;
 class Preprocessor;
 class PreprocessorOptions;
 class PreprocessorOutputOptions;
@@ -65,11 +64,6 @@
 void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS,
                               const PreprocessorOutputOptions &Opts);
 
-/// CreatePrintParserActionsAction - Return the actions implementation that
-/// implements the -parse-print-callbacks option.
-MinimalAction *CreatePrintParserActionsAction(Preprocessor &PP,
-                                              llvm::raw_ostream* OS);
-
 /// CheckDiagnostics - Gather the expected diagnostics and check them.
 bool CheckDiagnostics(Preprocessor &PP);
 

Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Sun Jul 25 23:08:02 2010
@@ -61,8 +61,7 @@
 ///
 /// All of the methods here are optional except getTypeName() and
 /// isCurrentClassName(), which must be specified in order for the
-/// parse to complete accurately.  The MinimalAction class does this
-/// bare-minimum of tracking to implement this functionality.
+/// parse to complete accurately.
 class Action : public ActionBase {
   /// \brief The parser's current scope.
   ///
@@ -3182,90 +3181,6 @@
   //@}
 };
 
-/// MinimalAction - Minimal actions are used by light-weight clients of the
-/// parser that do not need name resolution or significant semantic analysis to
-/// be performed.  The actions implemented here are in the form of unresolved
-/// identifiers.  By using a simpler interface than the SemanticAction class,
-/// the parser doesn't have to build complex data structures and thus runs more
-/// quickly.
-class MinimalAction : public Action {
-  /// Translation Unit Scope - useful to Objective-C actions that need
-  /// to lookup file scope declarations in the "ordinary" C decl namespace.
-  /// For example, user-defined classes, built-in "id" type, etc.
-  Scope *TUScope;
-  IdentifierTable &Idents;
-  Preprocessor &PP;
-  void *TypeNameInfoTablePtr;
-public:
-  MinimalAction(Preprocessor &pp);
-  ~MinimalAction();
-
-  /// getTypeName - This looks at the IdentifierInfo::FETokenInfo field to
-  /// determine whether the name is a typedef or not in this scope.
-  ///
-  /// \param II the identifier for which we are performing name lookup
-  ///
-  /// \param NameLoc the location of the identifier
-  ///
-  /// \param S the scope in which this name lookup occurs
-  ///
-  /// \param SS if non-NULL, the C++ scope specifier that precedes the
-  /// identifier
-  ///
-  /// \param isClassName whether this is a C++ class-name production, in
-  /// which we can end up referring to a member of an unknown specialization
-  /// that we know (from the grammar) is supposed to be a type. For example,
-  /// this occurs when deriving from "std::vector<T>::allocator_type", where T
-  /// is a template parameter.
-  ///
-  /// \returns the type referred to by this identifier, or NULL if the type
-  /// does not name an identifier.
-  virtual TypeTy *getTypeName(IdentifierInfo &II, SourceLocation NameLoc,
-                              Scope *S, CXXScopeSpec *SS,
-                              bool isClassName = false,
-                              TypeTy *ObjectType = 0);
-
-  /// isCurrentClassName - Always returns false, because MinimalAction
-  /// does not support C++ classes with constructors.
-  virtual bool isCurrentClassName(const IdentifierInfo& II, Scope *S,
-                                  const CXXScopeSpec *SS);
-
-  virtual TemplateNameKind isTemplateName(Scope *S,
-                                          CXXScopeSpec &SS,
-                                          UnqualifiedId &Name,
-                                          TypeTy *ObjectType,
-                                          bool EnteringContext,
-                                          TemplateTy &Template,
-                                          bool &MemberOfUnknownSpecialization);
-
-  
-  /// ActOnDeclarator - If this is a typedef declarator, we modify the
-  /// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is
-  /// popped.
-  virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D);
-
-  /// ActOnPopScope - When a scope is popped, if any typedefs are now
-  /// out-of-scope, they are removed from the IdentifierInfo::FETokenInfo field.
-  virtual void ActOnPopScope(SourceLocation Loc, Scope *S);
-  virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S);
-
-  virtual DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
-                                                 IdentifierInfo **IdentList,
-                                                 SourceLocation *SLocs,
-                                                 unsigned NumElts);
-
-  virtual DeclPtrTy ActOnStartClassInterface(SourceLocation interLoc,
-                                             IdentifierInfo *ClassName,
-                                             SourceLocation ClassLoc,
-                                             IdentifierInfo *SuperName,
-                                             SourceLocation SuperLoc,
-                                             const DeclPtrTy *ProtoRefs,
-                                             unsigned NumProtoRefs,
-                                             const SourceLocation *ProtoLocs,
-                                             SourceLocation EndProtoLoc,
-                                             AttributeList *AttrList);
-};
-
 /// PrettyStackTraceActionsDecl - If a crash occurs in the parser while parsing
 /// something related to a virtualized decl, include that virtualized decl in
 /// the stack trace.
@@ -3275,11 +3190,12 @@
   Action &Actions;
   SourceManager &SM;
   const char *Message;
+  
 public:
   PrettyStackTraceActionsDecl(Action::DeclPtrTy Decl, SourceLocation L,
                               Action &actions, SourceManager &sm,
                               const char *Msg)
-  : TheDecl(Decl), Loc(L), Actions(actions), SM(sm), Message(Msg) {}
+    : TheDecl(Decl), Loc(L), Actions(actions), SM(sm), Message(Msg) {}
 
   virtual void print(llvm::raw_ostream &OS) const;
 };
@@ -3291,7 +3207,7 @@
 
 public:
   EnterExpressionEvaluationContext(Action &Actions,
-                              Action::ExpressionEvaluationContext NewContext)
+                                   Action::ExpressionEvaluationContext NewContext)
     : Actions(Actions) {
     Actions.PushExpressionEvaluationContext(NewContext);
   }
@@ -3301,6 +3217,7 @@
   }
 };
 
+
 }  // end namespace clang
 
 #endif

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Sun Jul 25 23:08:02 2010
@@ -90,8 +90,7 @@
   unsigned short ParenCount, BracketCount, BraceCount;
 
   /// Actions - These are the callbacks we invoke as we parse various constructs
-  /// in the file.  This refers to the common base class between MinimalActions
-  /// and SemaActions for those uses that don't matter.
+  /// in the file. 
   Action &Actions;
 
   Diagnostic &Diags;

Modified: cfe/trunk/lib/Frontend/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CMakeLists.txt?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CMakeLists.txt (original)
+++ cfe/trunk/lib/Frontend/CMakeLists.txt Sun Jul 25 23:08:02 2010
@@ -25,7 +25,6 @@
   PCHWriter.cpp
   PCHWriterDecl.cpp
   PCHWriterStmt.cpp
-  PrintParserCallbacks.cpp
   PrintPreprocessedOutput.cpp
   StmtXML.cpp
   TextDiagnosticBuffer.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Sun Jul 25 23:08:02 2010
@@ -327,8 +327,6 @@
   case frontend::GeneratePCH:            return "-emit-pch";
   case frontend::GeneratePTH:            return "-emit-pth";
   case frontend::InitOnly:               return "-init-only";
-  case frontend::ParseNoop:              return "-parse-noop";
-  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";
@@ -982,10 +980,6 @@
       Opts.ProgramAction = frontend::GeneratePTH; break;
     case OPT_init_only:
       Opts.ProgramAction = frontend::InitOnly; break;
-    case OPT_parse_noop:
-      Opts.ProgramAction = frontend::ParseNoop; break;
-    case OPT_parse_print_callbacks:
-      Opts.ProgramAction = frontend::ParsePrintCallbacks; break;
     case OPT_fsyntax_only:
       Opts.ProgramAction = frontend::ParseSyntaxOnly; break;
     case OPT_print_decl_contexts:

Modified: cfe/trunk/lib/Frontend/FrontendActions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendActions.cpp?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendActions.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendActions.cpp Sun Jul 25 23:08:02 2010
@@ -147,15 +147,6 @@
   CacheTokens(CI.getPreprocessor(), OS);
 }
 
-void ParseOnlyAction::ExecuteAction() {
-  Preprocessor &PP = getCompilerInstance().getPreprocessor();
-  llvm::OwningPtr<Action> PA(new MinimalAction(PP));
-
-  Parser P(PP, *PA);
-  PP.EnterMainSourceFile();
-  P.ParseTranslationUnit();
-}
-
 void PreprocessOnlyAction::ExecuteAction() {
   Preprocessor &PP = getCompilerInstance().getPreprocessor();
 
@@ -170,19 +161,6 @@
   } while (Tok.isNot(tok::eof));
 }
 
-void PrintParseAction::ExecuteAction() {
-  CompilerInstance &CI = getCompilerInstance();
-  Preprocessor &PP = getCompilerInstance().getPreprocessor();
-  llvm::raw_ostream *OS = CI.createDefaultOutputFile(false, getCurrentFile());
-  if (!OS) return;
-
-  llvm::OwningPtr<Action> PA(CreatePrintParserActionsAction(PP, OS));
-
-  Parser P(PP, *PA);
-  PP.EnterMainSourceFile();
-  P.ParseTranslationUnit();
-}
-
 void PrintPreprocessedAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   // Output file needs to be set to 'Binary', to avoid converting Unix style

Removed: cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp?rev=109391&view=auto
==============================================================================
--- cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp (original)
+++ cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp (removed)
@@ -1,852 +0,0 @@
-//===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This code simply runs the preprocessor on the input file and prints out the
-// result.  This is the traditional behavior of the -E option.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Frontend/Utils.h"
-#include "clang/Parse/Action.h"
-#include "clang/Parse/DeclSpec.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace clang;
-
-namespace {
-  class ParserPrintActions : public MinimalAction {
-  llvm::raw_ostream& Out;
-
-  public:
-    ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS)
-      : MinimalAction(PP), Out(OS) {}
-
-    // Printing Functions which also must call MinimalAction
-
-    /// ActOnDeclarator - This callback is invoked when a declarator is parsed
-    /// and 'Init' specifies the initializer if any.  This is for things like:
-    /// "int X = 4" or "typedef int foo".
-    virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
-      Out << __FUNCTION__ << " ";
-      if (IdentifierInfo *II = D.getIdentifier()) {
-        Out << "'" << II->getName() << "'";
-      } else {
-        Out << "<anon>";
-      }
-      Out << "\n";
-
-      // Pass up to EmptyActions so that the symbol table is maintained right.
-      return MinimalAction::ActOnDeclarator(S, D);
-    }
-    /// ActOnPopScope - This callback is called immediately before the specified
-    /// scope is popped and deleted.
-    virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
-      Out << __FUNCTION__ << "\n";
-      return MinimalAction::ActOnPopScope(Loc, S);
-    }
-
-    /// ActOnTranslationUnitScope - This callback is called once, immediately
-    /// after creating the translation unit scope (in Parser::Initialize).
-    virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
-      Out << __FUNCTION__ << "\n";
-      MinimalAction::ActOnTranslationUnitScope(Loc, S);
-    }
-
-
-    Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
-                                               IdentifierInfo *ClassName,
-                                               SourceLocation ClassLoc,
-                                               IdentifierInfo *SuperName,
-                                               SourceLocation SuperLoc,
-                                               const DeclPtrTy *ProtoRefs,
-                                               unsigned NumProtocols,
-                                               const SourceLocation *ProtoLocs,
-                                               SourceLocation EndProtoLoc,
-                                               AttributeList *AttrList) {
-      Out << __FUNCTION__ << "\n";
-      return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
-                                                     ClassName, ClassLoc,
-                                                     SuperName, SuperLoc,
-                                                     ProtoRefs, NumProtocols,
-                                                     ProtoLocs, EndProtoLoc,
-                                                     AttrList);
-    }
-
-    /// ActOnForwardClassDeclaration -
-    /// Scope will always be top level file scope.
-    Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
-                                                   IdentifierInfo **IdentList,
-                                                   SourceLocation *IdentLocs,
-                                                   unsigned NumElts) {
-      Out << __FUNCTION__ << "\n";
-      return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
-                                                         IdentLocs, NumElts);
-    }
-
-    // Pure Printing
-
-    /// ActOnParamDeclarator - This callback is invoked when a parameter
-    /// declarator is parsed. This callback only occurs for functions
-    /// with prototypes. S is the function prototype scope for the
-    /// parameters (C++ [basic.scope.proto]).
-    virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
-      Out << __FUNCTION__ << " ";
-      if (IdentifierInfo *II = D.getIdentifier()) {
-        Out << "'" << II->getName() << "'";
-      } else {
-        Out << "<anon>";
-      }
-      Out << "\n";
-      return DeclPtrTy();
-    }
-
-    /// AddInitializerToDecl - This action is called immediately after
-    /// ParseDeclarator (when an initializer is present). The code is factored
-    /// this way to make sure we are able to handle the following:
-    ///   void func() { int xx = xx; }
-    /// This allows ActOnDeclarator to register "xx" prior to parsing the
-    /// initializer. The declaration above should still result in a warning,
-    /// since the reference to "xx" is uninitialized.
-    virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
-    /// this gives the actions implementation a chance to process the group as
-    /// a whole.
-    virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
-                                                   DeclPtrTy *Group,
-                                                   unsigned NumDecls) {
-      Out << __FUNCTION__ << "\n";
-      return DeclGroupPtrTy();
-    }
-
-    /// ActOnStartOfFunctionDef - This is called at the start of a function
-    /// definition, instead of calling ActOnDeclarator.  The Declarator includes
-    /// information about formal arguments that are part of this function.
-    virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
-                                              Declarator &D){
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    /// ActOnStartOfFunctionDef - This is called at the start of a function
-    /// definition, after the FunctionDecl has already been created.
-    virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    /// ActOnFunctionDefBody - This is called when a function body has completed
-    /// parsing.  Decl is the DeclTy returned by ParseStartOfFunctionDef.
-    virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
-                                            ExprArg AsmString) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
-    /// no declarator (e.g. "struct foo;") is parsed.
-    virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
-                                                 DeclSpec &DS) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
-    /// contained braces. Lang/StrSize contains the language string that
-    /// was parsed at location Loc. Decls/NumDecls provides the
-    /// declarations parsed inside the linkage specification.
-    virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
-                                       SourceLocation LBrace,
-                                       SourceLocation RBrace, const char *Lang,
-                                       unsigned StrSize,
-                                       DeclPtrTy *Decls, unsigned NumDecls) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
-    /// braces. Lang/StrSize contains the language string that was
-    /// parsed at location Loc. D is the declaration parsed.
-    virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
-                                       unsigned StrSize, DeclPtrTy D) {
-      return DeclPtrTy();
-    }
-
-    //===------------------------------------------------------------------===//
-    // Type Parsing Callbacks.
-    //===------------------------------------------------------------------===//
-
-    virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
-      Out << __FUNCTION__ << "\n";
-      return TypeResult();
-    }
-
-    virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
-                               SourceLocation KWLoc, CXXScopeSpec &SS,
-                               IdentifierInfo *Name, SourceLocation NameLoc,
-                               AttributeList *Attr, AccessSpecifier AS,
-                               MultiTemplateParamsArg TemplateParameterLists,
-                               bool &OwnedDecl, bool &IsDependent) {
-      // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
-      // is (struct/union/enum/class).
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    /// Act on @defs() element found when parsing a structure.  ClassName is the
-    /// name of the referenced class.
-    virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
-                           IdentifierInfo *ClassName,
-                           llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
-                                 SourceLocation DeclStart,
-                                 Declarator &D, ExprTy *BitfieldWidth) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
-                                DeclPtrTy IntfDecl,
-                                Declarator &D, ExprTy *BitfieldWidth,
-                                tok::ObjCKeywordKind visibility) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
-                             DeclPtrTy *Fields, unsigned NumFields,
-                             SourceLocation LBrac, SourceLocation RBrac,
-                             AttributeList *AttrList) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
-                                        DeclPtrTy LastEnumConstant,
-                                        SourceLocation IdLoc,IdentifierInfo *Id,
-                                        SourceLocation EqualLoc, ExprTy *Val) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
-                               SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
-                               DeclPtrTy *Elements, unsigned NumElements,
-                               Scope *S, AttributeList *AttrList) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    //===------------------------------------------------------------------===//
-    // Statement Parsing Callbacks.
-    //===------------------------------------------------------------------===//
-
-    virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
-                                               SourceLocation R,
-                                               MultiStmtArg Elts,
-                                               bool isStmtExpr) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
-                                           SourceLocation StartLoc,
-                                           SourceLocation EndLoc) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
-      Out << __FUNCTION__ << "\n";
-      return OwningStmtResult(*this, Expr->release());
-    }
-
-    /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
-    /// which can specify an RHS value.
-    virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
-                                           ExprArg LHSVal,
-                                           SourceLocation DotDotDotLoc,
-                                           ExprArg RHSVal,
-                                           SourceLocation ColonLoc) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
-                                              SourceLocation ColonLoc,
-                                              StmtArg SubStmt, Scope *CurScope){
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
-                                            IdentifierInfo *II,
-                                            SourceLocation ColonLoc,
-                                            StmtArg SubStmt) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
-                                         FullExprArg CondVal, DeclPtrTy CondVar,
-                                         StmtArg ThenVal,
-                                         SourceLocation ElseLoc,
-                                         StmtArg ElseVal) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
-                                                    ExprArg Cond, 
-                                                    DeclPtrTy CondVar) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
-                                                   StmtArg Switch,
-                                                   StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
-                                            FullExprArg Cond, DeclPtrTy CondVar,
-                                            StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
-                                         SourceLocation WhileLoc,
-                                         SourceLocation LPLoc, ExprArg Cond,
-                                         SourceLocation RPLoc){
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
-                                        SourceLocation LParenLoc,
-                                        StmtArg First, FullExprArg Second,
-                                        DeclPtrTy SecondVar,
-                                        FullExprArg Third, 
-                                        SourceLocation RParenLoc,
-                                        StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnObjCForCollectionStmt(
-                                       SourceLocation ForColLoc,
-                                       SourceLocation LParenLoc,
-                                       StmtArg First, ExprArg Second,
-                                       SourceLocation RParenLoc, StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
-                                           SourceLocation LabelLoc,
-                                           IdentifierInfo *LabelII) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
-                                                   SourceLocation StarLoc,
-                                                   ExprArg DestExp) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
-                                               Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
-                                            Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
-                                             ExprArg RetValExp) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-    virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
-                                          bool IsSimple,
-                                          bool IsVolatile,
-                                          unsigned NumOutputs,
-                                          unsigned NumInputs,
-                                          IdentifierInfo **Names,
-                                          MultiExprArg Constraints,
-                                          MultiExprArg Exprs,
-                                          ExprArg AsmString,
-                                          MultiExprArg Clobbers,
-                                          SourceLocation RParenLoc,
-                                          bool MSAsm) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    // Objective-c statements
-    virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
-                                                  SourceLocation RParen,
-                                                  DeclPtrTy Parm,
-                                                  StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
-                                                    StmtArg Body) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
-                                                StmtArg Try,
-                                                MultiStmtArg CatchStmts,
-                                                StmtArg Finally) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
-                                                  ExprArg Throw,
-                                                  Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
-                                                         ExprArg SynchExpr,
-                                                         StmtArg SynchBody) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    // C++ Statements
-    virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
-                                                DeclPtrTy ExceptionDecl,
-                                                StmtArg HandlerBlock) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
-                                              StmtArg TryBlock,
-                                              MultiStmtArg Handlers) {
-      Out << __FUNCTION__ << "\n";
-      return StmtEmpty();
-    }
-
-    //===------------------------------------------------------------------===//
-    // Expression Parsing Callbacks.
-    //===------------------------------------------------------------------===//
-
-    // Primary Expressions.
-
-    /// ActOnIdentifierExpr - Parse an identifier in expression context.
-    /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
-    /// token immediately after it.
-    virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
-                                                 IdentifierInfo &II,
-                                                 bool HasTrailingLParen,
-                                                 const CXXScopeSpec *SS,
-                                                 bool isAddressOfOperand) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
-                               Scope *S, SourceLocation OperatorLoc,
-                               OverloadedOperatorKind Op,
-                               bool HasTrailingLParen, const CXXScopeSpec &SS,
-                               bool isAddressOfOperand) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXConversionFunctionExpr(
-                               Scope *S, SourceLocation OperatorLoc,
-                               TypeTy *Type, bool HasTrailingLParen,
-                               const CXXScopeSpec &SS,bool isAddressOfOperand) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
-                                                 tok::TokenKind Kind) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCharacterConstant(const Token &) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnNumericConstant(const Token &) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    /// ActOnStringLiteral - The specified tokens were lexed as pasted string
-    /// fragments (e.g. "foo" "bar" L"baz").
-    virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
-                                                unsigned NumToks) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
-                                            ExprArg Val) {
-      Out << __FUNCTION__ << "\n";
-      return move(Val);  // Default impl returns operand.
-    }
-
-    // Postfix Expressions.
-    virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
-                                                 tok::TokenKind Kind,
-                                                 ExprArg Input) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
-                                                     SourceLocation LLoc,
-                                                     ExprArg Idx,
-                                                     SourceLocation RLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
-                                                      SourceLocation OpLoc,
-                                                      tok::TokenKind OpKind,
-                                                      SourceLocation MemberLoc,
-                                                      IdentifierInfo &Member,
-                                                      DeclPtrTy ImplDecl,
-                                                      const CXXScopeSpec *SS=0) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
-                                           SourceLocation LParenLoc,
-                                           MultiExprArg Args,
-                                           SourceLocation *CommaLocs,
-                                           SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    // Unary Operators.  'Tok' is the token for the operator.
-    virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
-                                          tok::TokenKind Op, ExprArg Input) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    virtual OwningExprResult
-      ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
-                             void *TyOrEx, const SourceRange &ArgRange) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
-                                                  TypeTy *Ty,
-                                                  SourceLocation RParen,
-                                                  ExprArg Op) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
-                                           MultiExprArg InitList,
-                                           SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
-                                           TypeTy *Ty, SourceLocation RParenLoc,
-                                           ExprArg Op) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
-                                        tok::TokenKind Kind,
-                                        ExprArg LHS, ExprArg RHS) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    /// ActOnConditionalOp - Parse a ?: operation.  Note that 'LHS' may be null
-    /// in the case of a the GNU conditional expr extension.
-    virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
-                                                SourceLocation ColonLoc,
-                                                ExprArg Cond, ExprArg LHS,
-                                                ExprArg RHS) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    //===--------------------- GNU Extension Expressions ------------------===//
-
-    virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
-                                            SourceLocation LabLoc,
-                                            IdentifierInfo *LabelII) {// "&&foo"
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
-                                           StmtArg SubStmt,
-                                           SourceLocation RPLoc) { // "({..})"
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
-                                                  SourceLocation BuiltinLoc,
-                                                  SourceLocation TypeLoc,
-                                                  TypeTy *Arg1,
-                                                  OffsetOfComponent *CompPtr,
-                                                  unsigned NumComponents,
-                                                  SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    // __builtin_types_compatible_p(type1, type2)
-    virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
-                                                      TypeTy *arg1,TypeTy *arg2,
-                                                      SourceLocation RPLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-    // __builtin_choose_expr(constExpr, expr1, expr2)
-    virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
-                                             ExprArg cond, ExprArg expr1,
-                                             ExprArg expr2,
-                                             SourceLocation RPLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    // __builtin_va_arg(expr, type)
-    virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
-                                  ExprArg expr, TypeTy *type,
-                                  SourceLocation RPLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
-                                                StmtArg Body,
-                                                Scope *CurScope) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
-                                             IdentifierInfo *Ident,
-                                             SourceLocation LBrace,
-                                             AttributeList *AttrList) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
-      Out << __FUNCTION__ << "\n";
-      return;
-    }
-
-#if 0
-    // FIXME: AttrList should be deleted by this function, but the definition
-    // would have to be available.
-    virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
-                                          SourceLocation UsingLoc,
-                                          SourceLocation NamespcLoc,
-                                          const CXXScopeSpec &SS,
-                                          SourceLocation IdentLoc,
-                                          IdentifierInfo *NamespcName,
-                                          AttributeList *AttrList) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-#endif
-
-    virtual void ActOnParamDefaultArgument(DeclPtrTy param,
-                                           SourceLocation EqualLoc,
-                                           ExprArg defarg) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
-                                                   SourceLocation EqualLoc,
-                                                   SourceLocation ArgLoc) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
-                                               SourceLocation LParenLoc,
-                                               MultiExprArg Exprs,
-                                               SourceLocation *CommaLocs,
-                                               SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return;
-    }
-
-    virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
-                                                       DeclPtrTy Method) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
-                                                        DeclPtrTy Method) {
-      Out << __FUNCTION__ << "\n";
-    }
-
-    virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
-                                                   ExprArg AssertExpr,
-                                                   ExprArg AssertMessageExpr) {
-      Out << __FUNCTION__ << "\n";
-      return DeclPtrTy();
-    }
-
-    virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
-                                               tok::TokenKind Kind,
-                                               SourceLocation LAngleBracketLoc,
-                                               TypeTy *Ty,
-                                               SourceLocation RAngleBracketLoc,
-                                               SourceLocation LParenLoc,
-                                               ExprArg Op,
-                                               SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
-                                            SourceLocation LParenLoc,
-                                            bool isType, void *TyOrExpr,
-                                            SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
-                                                 tok::TokenKind Kind) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
-                                                     TypeTy *TypeRep,
-                                                     SourceLocation LParenLoc,
-                                                     MultiExprArg Exprs,
-                                                     SourceLocation *CommaLocs,
-                                                     SourceLocation RParenLoc) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
-                                                        SourceLocation StartLoc,
-                                                        Declarator &D,
-                                                        SourceLocation EqualLoc,
-                                                        ExprArg AssignExprVal) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
-                                         bool UseGlobal,
-                                         SourceLocation PlacementLParen,
-                                         MultiExprArg PlacementArgs,
-                                         SourceLocation PlacementRParen,
-                                         SourceRange TypeIdParens, 
-                                         Declarator &D,
-                                         SourceLocation ConstructorLParen,
-                                         MultiExprArg ConstructorArgs,
-                                         SourceLocation ConstructorRParen) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
-                                            bool UseGlobal, bool ArrayForm,
-                                            ExprArg Operand) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-
-    virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
-                                                 SourceLocation KWLoc,
-                                                 SourceLocation LParen,
-                                                 TypeTy *Ty,
-                                                 SourceLocation RParen) {
-      Out << __FUNCTION__ << "\n";
-      return ExprEmpty();
-    }
-  };
-}
-
-MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
-                                                     llvm::raw_ostream* OS) {
-  return new ParserPrintActions(PP, *OS);
-}

Added: cfe/trunk/lib/Parse/Action.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Action.cpp?rev=109392&view=auto
==============================================================================
--- cfe/trunk/lib/Parse/Action.cpp (added)
+++ cfe/trunk/lib/Parse/Action.cpp Sun Jul 25 23:08:02 2010
@@ -0,0 +1,104 @@
+//===--- Action.cpp - Implement the Action class --------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file implements the Action interface.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Parse/Parser.h"
+#include "clang/Parse/DeclSpec.h"
+#include "clang/Parse/Scope.h"
+#include "clang/Basic/TargetInfo.h"
+#include "llvm/Support/Allocator.h"
+#include "llvm/Support/RecyclingAllocator.h"
+#include "llvm/Support/raw_ostream.h"
+using namespace clang;
+
+void PrettyStackTraceActionsDecl::print(llvm::raw_ostream &OS) const {
+  if (Loc.isValid()) {
+    Loc.print(OS, SM);
+    OS << ": ";
+  }
+  OS << Message;
+
+  std::string Name = Actions.getDeclName(TheDecl);
+  if (!Name.empty())
+    OS << " '" << Name << '\'';
+
+  OS << '\n';
+}
+
+///  Out-of-line virtual destructor to provide home for ActionBase class.
+ActionBase::~ActionBase() {}
+
+///  Out-of-line virtual destructor to provide home for Action class.
+Action::~Action() {}
+
+Action::ObjCMessageKind Action::getObjCMessageKind(Scope *S,
+                                                   IdentifierInfo *Name,
+                                                   SourceLocation NameLoc,
+                                                   bool IsSuper,
+                                                   bool HasTrailingDot,
+                                                   TypeTy *&ReceiverType) {
+  ReceiverType = 0;
+
+  if (IsSuper && !HasTrailingDot && S->isInObjcMethodScope())
+    return ObjCSuperMessage;
+      
+  if (TypeTy *TyName = getTypeName(*Name, NameLoc, S)) {
+    DeclSpec DS;
+    const char *PrevSpec = 0;
+    unsigned DiagID = 0;
+    if (!DS.SetTypeSpecType(DeclSpec::TST_typename, NameLoc, PrevSpec,
+                            DiagID, TyName)) {
+      DS.SetRangeEnd(NameLoc);
+      Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
+      TypeResult Ty = ActOnTypeName(S, DeclaratorInfo);
+      if (!Ty.isInvalid())
+        ReceiverType = Ty.get();
+    }
+    return ObjCClassMessage;
+  }
+      
+  return ObjCInstanceMessage;
+}
+
+// Defined out-of-line here because of dependecy on AttributeList
+Action::DeclPtrTy Action::ActOnUsingDirective(Scope *CurScope,
+                                              SourceLocation UsingLoc,
+                                              SourceLocation NamespcLoc,
+                                              CXXScopeSpec &SS,
+                                              SourceLocation IdentLoc,
+                                              IdentifierInfo *NamespcName,
+                                              AttributeList *AttrList) {
+
+  // FIXME: Parser seems to assume that Action::ActOn* takes ownership over
+  // passed AttributeList, however other actions don't free it, is it
+  // temporary state or bug?
+  delete AttrList;
+  return DeclPtrTy();
+}
+
+// Defined out-of-line here because of dependency on AttributeList
+Action::DeclPtrTy Action::ActOnUsingDeclaration(Scope *CurScope,
+                                                AccessSpecifier AS,
+                                                bool HasUsingKeyword,
+                                                SourceLocation UsingLoc,
+                                                CXXScopeSpec &SS,
+                                                UnqualifiedId &Name,
+                                                AttributeList *AttrList,
+                                                bool IsTypeName,
+                                                SourceLocation TypenameLoc) {
+
+  // FIXME: Parser seems to assume that Action::ActOn* takes ownership over
+  // passed AttributeList, however other actions don't free it, is it
+  // temporary state or bug?
+  delete AttrList;
+  return DeclPtrTy();
+}

Propchange: cfe/trunk/lib/Parse/Action.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cfe/trunk/lib/Parse/Action.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cfe/trunk/lib/Parse/Action.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cfe/trunk/lib/Parse/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/CMakeLists.txt?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/CMakeLists.txt (original)
+++ cfe/trunk/lib/Parse/CMakeLists.txt Sun Jul 25 23:08:02 2010
@@ -1,9 +1,9 @@
 set(LLVM_NO_RTTI 1)
 
 add_clang_library(clangParse
+  Action.cpp
   AttributeList.cpp
   DeclSpec.cpp
-  MinimalAction.cpp
   ParseCXXInlineMethods.cpp
   ParseDecl.cpp
   ParseDeclCXX.cpp

Removed: cfe/trunk/lib/Parse/MinimalAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/MinimalAction.cpp?rev=109391&view=auto
==============================================================================
--- cfe/trunk/lib/Parse/MinimalAction.cpp (original)
+++ cfe/trunk/lib/Parse/MinimalAction.cpp (removed)
@@ -1,281 +0,0 @@
-//===--- MinimalAction.cpp - Implement the MinimalAction class ------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file implements the MinimalAction interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Parse/Parser.h"
-#include "clang/Parse/DeclSpec.h"
-#include "clang/Parse/Scope.h"
-#include "clang/Basic/TargetInfo.h"
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/RecyclingAllocator.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace clang;
-
-///  Out-of-line virtual destructor to provide home for ActionBase class.
-ActionBase::~ActionBase() {}
-
-///  Out-of-line virtual destructor to provide home for Action class.
-Action::~Action() {}
-
-Action::ObjCMessageKind Action::getObjCMessageKind(Scope *S,
-                                                   IdentifierInfo *Name,
-                                                   SourceLocation NameLoc,
-                                                   bool IsSuper,
-                                                   bool HasTrailingDot,
-                                                   TypeTy *&ReceiverType) {
-  ReceiverType = 0;
-
-  if (IsSuper && !HasTrailingDot && S->isInObjcMethodScope())
-    return ObjCSuperMessage;
-      
-  if (TypeTy *TyName = getTypeName(*Name, NameLoc, S)) {
-    DeclSpec DS;
-    const char *PrevSpec = 0;
-    unsigned DiagID = 0;
-    if (!DS.SetTypeSpecType(DeclSpec::TST_typename, NameLoc, PrevSpec,
-                            DiagID, TyName)) {
-      DS.SetRangeEnd(NameLoc);
-      Declarator DeclaratorInfo(DS, Declarator::TypeNameContext);
-      TypeResult Ty = ActOnTypeName(S, DeclaratorInfo);
-      if (!Ty.isInvalid())
-        ReceiverType = Ty.get();
-    }
-    return ObjCClassMessage;
-  }
-      
-  return ObjCInstanceMessage;
-}
-
-// Defined out-of-line here because of dependecy on AttributeList
-Action::DeclPtrTy Action::ActOnUsingDirective(Scope *CurScope,
-                                              SourceLocation UsingLoc,
-                                              SourceLocation NamespcLoc,
-                                              CXXScopeSpec &SS,
-                                              SourceLocation IdentLoc,
-                                              IdentifierInfo *NamespcName,
-                                              AttributeList *AttrList) {
-
-  // FIXME: Parser seems to assume that Action::ActOn* takes ownership over
-  // passed AttributeList, however other actions don't free it, is it
-  // temporary state or bug?
-  delete AttrList;
-  return DeclPtrTy();
-}
-
-// Defined out-of-line here because of dependency on AttributeList
-Action::DeclPtrTy Action::ActOnUsingDeclaration(Scope *CurScope,
-                                                AccessSpecifier AS,
-                                                bool HasUsingKeyword,
-                                                SourceLocation UsingLoc,
-                                                CXXScopeSpec &SS,
-                                                UnqualifiedId &Name,
-                                                AttributeList *AttrList,
-                                                bool IsTypeName,
-                                                SourceLocation TypenameLoc) {
-
-  // FIXME: Parser seems to assume that Action::ActOn* takes ownership over
-  // passed AttributeList, however other actions don't free it, is it
-  // temporary state or bug?
-  delete AttrList;
-  return DeclPtrTy();
-}
-
-
-void PrettyStackTraceActionsDecl::print(llvm::raw_ostream &OS) const {
-  if (Loc.isValid()) {
-    Loc.print(OS, SM);
-    OS << ": ";
-  }
-  OS << Message;
-
-  std::string Name = Actions.getDeclName(TheDecl);
-  if (!Name.empty())
-    OS << " '" << Name << '\'';
-
-  OS << '\n';
-}
-
-/// TypeNameInfo - A link exists here for each scope that an identifier is
-/// defined.
-namespace {
-  struct TypeNameInfo {
-    TypeNameInfo *Prev;
-    bool isTypeName;
-
-    TypeNameInfo(bool istypename, TypeNameInfo *prev) {
-      isTypeName = istypename;
-      Prev = prev;
-    }
-  };
-
-  struct TypeNameInfoTable {
-    llvm::RecyclingAllocator<llvm::BumpPtrAllocator, TypeNameInfo> Allocator;
-
-    void AddEntry(bool isTypename, IdentifierInfo *II) {
-      TypeNameInfo *TI = Allocator.Allocate<TypeNameInfo>();
-      new (TI) TypeNameInfo(isTypename, II->getFETokenInfo<TypeNameInfo>());
-      II->setFETokenInfo(TI);
-    }
-
-    void DeleteEntry(TypeNameInfo *Entry) {
-      Entry->~TypeNameInfo();
-      Allocator.Deallocate(Entry);
-    }
-  };
-}
-
-static TypeNameInfoTable *getTable(void *TP) {
-  return static_cast<TypeNameInfoTable*>(TP);
-}
-
-MinimalAction::MinimalAction(Preprocessor &pp)
-  : Idents(pp.getIdentifierTable()), PP(pp) {
-  TypeNameInfoTablePtr = new TypeNameInfoTable();
-}
-
-MinimalAction::~MinimalAction() {
-  delete getTable(TypeNameInfoTablePtr);
-}
-
-void MinimalAction::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
-  TUScope = S;
-
-  TypeNameInfoTable &TNIT = *getTable(TypeNameInfoTablePtr);
-
-  if (PP.getTargetInfo().getPointerWidth(0) >= 64) {
-    // Install [u]int128_t for 64-bit targets.
-    TNIT.AddEntry(true, &Idents.get("__int128_t"));
-    TNIT.AddEntry(true, &Idents.get("__uint128_t"));
-  }
-
-  if (PP.getLangOptions().ObjC1) {
-    // Recognize the ObjC built-in type identifiers as types.
-    TNIT.AddEntry(true, &Idents.get("id"));
-    TNIT.AddEntry(true, &Idents.get("SEL"));
-    TNIT.AddEntry(true, &Idents.get("Class"));
-    TNIT.AddEntry(true, &Idents.get("Protocol"));
-  }
-}
-
-/// isTypeName - This looks at the IdentifierInfo::FETokenInfo field to
-/// determine whether the name is a type name (objc class name or typedef) or
-/// not in this scope.
-///
-/// FIXME: Use the passed CXXScopeSpec for accurate C++ type checking.
-Action::TypeTy *
-MinimalAction::getTypeName(IdentifierInfo &II, SourceLocation Loc,
-                           Scope *S, CXXScopeSpec *SS,
-                           bool isClassName, TypeTy *ObjectType) {
-  if (TypeNameInfo *TI = II.getFETokenInfo<TypeNameInfo>())
-    if (TI->isTypeName)
-      return TI;
-  return 0;
-}
-
-/// isCurrentClassName - Always returns false, because MinimalAction
-/// does not support C++ classes with constructors.
-bool MinimalAction::isCurrentClassName(const IdentifierInfo &, Scope *,
-                                       const CXXScopeSpec *) {
-  return false;
-}
-
-TemplateNameKind
-MinimalAction::isTemplateName(Scope *S,
-                              CXXScopeSpec &SS,
-                              UnqualifiedId &Name,
-                              TypeTy *ObjectType,
-                              bool EnteringScope,
-                              TemplateTy &TemplateDecl,
-                              bool &MemberOfUnknownSpecialization) {
-  MemberOfUnknownSpecialization = false;
-  return TNK_Non_template;
-}
-
-/// ActOnDeclarator - If this is a typedef declarator, we modify the
-/// IdentifierInfo::FETokenInfo field to keep track of this fact, until S is
-/// popped.
-Action::DeclPtrTy
-MinimalAction::ActOnDeclarator(Scope *S, Declarator &D) {
-  IdentifierInfo *II = D.getIdentifier();
-
-  // If there is no identifier associated with this declarator, bail out.
-  if (II == 0) return DeclPtrTy();
-
-  TypeNameInfo *weCurrentlyHaveTypeInfo = II->getFETokenInfo<TypeNameInfo>();
-  bool isTypeName =
-    D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef;
-
-  // this check avoids creating TypeNameInfo objects for the common case.
-  // It does need to handle the uncommon case of shadowing a typedef name with a
-  // non-typedef name. e.g. { typedef int a; a xx; { int a; } }
-  if (weCurrentlyHaveTypeInfo || isTypeName) {
-    // Allocate and add the 'TypeNameInfo' "decl".
-    getTable(TypeNameInfoTablePtr)->AddEntry(isTypeName, II);
-
-    // Remember that this needs to be removed when the scope is popped.
-    S->AddDecl(DeclPtrTy::make(II));
-  }
-  return DeclPtrTy();
-}
-
-Action::DeclPtrTy
-MinimalAction::ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
-                                        IdentifierInfo *ClassName,
-                                        SourceLocation ClassLoc,
-                                        IdentifierInfo *SuperName,
-                                        SourceLocation SuperLoc,
-                                        const DeclPtrTy *ProtoRefs,
-                                        unsigned NumProtocols,
-                                        const SourceLocation *ProtoLocs,
-                                        SourceLocation EndProtoLoc,
-                                        AttributeList *AttrList) {
-  // Allocate and add the 'TypeNameInfo' "decl".
-  getTable(TypeNameInfoTablePtr)->AddEntry(true, ClassName);
-  return DeclPtrTy();
-}
-
-/// ActOnForwardClassDeclaration -
-/// Scope will always be top level file scope.
-Action::DeclPtrTy
-MinimalAction::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
-                                            IdentifierInfo **IdentList,
-                                            SourceLocation *IdentLocs,
-                                            unsigned NumElts) {
-  for (unsigned i = 0; i != NumElts; ++i) {
-    // Allocate and add the 'TypeNameInfo' "decl".
-    getTable(TypeNameInfoTablePtr)->AddEntry(true, IdentList[i]);
-
-    // Remember that this needs to be removed when the scope is popped.
-    TUScope->AddDecl(DeclPtrTy::make(IdentList[i]));
-  }
-  return DeclPtrTy();
-}
-
-/// ActOnPopScope - When a scope is popped, if any typedefs are now
-/// out-of-scope, they are removed from the IdentifierInfo::FETokenInfo field.
-void MinimalAction::ActOnPopScope(SourceLocation Loc, Scope *S) {
-  TypeNameInfoTable &Table = *getTable(TypeNameInfoTablePtr);
-
-  for (Scope::decl_iterator I = S->decl_begin(), E = S->decl_end();
-       I != E; ++I) {
-    IdentifierInfo &II = *(*I).getAs<IdentifierInfo>();
-    TypeNameInfo *TI = II.getFETokenInfo<TypeNameInfo>();
-    assert(TI && "This decl didn't get pushed??");
-
-    if (TI) {
-      TypeNameInfo *Next = TI->Prev;
-      Table.DeleteEntry(TI);
-
-      II.setFETokenInfo(Next);
-    }
-  }
-}

Removed: cfe/trunk/test/Coverage/parse-callbacks.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/parse-callbacks.c?rev=109391&view=auto
==============================================================================
--- cfe/trunk/test/Coverage/parse-callbacks.c (original)
+++ cfe/trunk/test/Coverage/parse-callbacks.c (removed)
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -parse-noop %s
-// RUN: %clang_cc1 -parse-print-callbacks %s
-
-#include "c-language-features.inc"

Removed: cfe/trunk/test/Coverage/parse-callbacks.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Coverage/parse-callbacks.m?rev=109391&view=auto
==============================================================================
--- cfe/trunk/test/Coverage/parse-callbacks.m (original)
+++ cfe/trunk/test/Coverage/parse-callbacks.m (removed)
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -parse-noop %s
-// RUN: %clang_cc1 -parse-print-callbacks %s
-
-#include "objc-language-features.inc"

Removed: cfe/trunk/test/Parser/2008-10-31-parse-noop-failure.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/2008-10-31-parse-noop-failure.c?rev=109391&view=auto
==============================================================================
--- cfe/trunk/test/Parser/2008-10-31-parse-noop-failure.c (original)
+++ cfe/trunk/test/Parser/2008-10-31-parse-noop-failure.c (removed)
@@ -1,4 +0,0 @@
-// RUN: %clang_cc1 -verify -parse-noop %s
-
-void add_attribute(id) int id; {}
-

Modified: cfe/trunk/test/Parser/block-block-storageclass.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/block-block-storageclass.c?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/block-block-storageclass.c (original)
+++ cfe/trunk/test/Parser/block-block-storageclass.c Sun Jul 25 23:08:02 2010
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -parse-noop %s
-#if 0
+// RUN: %clang_cc1 -fsyntax-only -fblocks -verify %s
 int printf(const char *, ...);
 void _Block_byref_release(void*src){}
 
@@ -16,4 +15,3 @@
 
    return X;
 }
-#endif

Modified: cfe/trunk/test/Parser/block-pointer-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/block-pointer-decl.c?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/block-pointer-decl.c (original)
+++ cfe/trunk/test/Parser/block-pointer-decl.c Sun Jul 25 23:08:02 2010
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -parse-noop -fblocks %s
+// RUN: %clang_cc1 -fsyntax-only -verify -fblocks %s
+
+int printf(char const *, ...);
 
 struct blockStruct {
   int (^a)(float, int);

Modified: cfe/trunk/test/Parser/cxx-condition.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-condition.cpp?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-condition.cpp (original)
+++ cfe/trunk/test/Parser/cxx-condition.cpp Sun Jul 25 23:08:02 2010
@@ -1,11 +1,11 @@
-// RUN: %clang_cc1 -parse-noop -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 void f() {
   int a;
   while (a) ;
   while (int x) ; // expected-error {{expected '=' after declarator}}
   while (float x = 0) ;
-  if (const int x = a) ;
+  if (const int x = a) ; // expected-warning{{empty body}}
   switch (int x = a+10) {}
   for (; int x = ++a; ) ;
 }

Modified: cfe/trunk/test/Parser/cxx-namespace-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-namespace-alias.cpp?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-namespace-alias.cpp (original)
+++ cfe/trunk/test/Parser/cxx-namespace-alias.cpp Sun Jul 25 23:08:02 2010
@@ -1,8 +1,9 @@
-// RUN: %clang_cc1 -parse-noop -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
-namespace A = B;
+namespace A = B; // expected-error{{namespace name}}
 
 namespace A = !; // expected-error {{expected namespace name}}
-namespace A = A::!; // expected-error {{expected namespace name}}
+namespace A = A::!; // expected-error {{expected namespace name}} \
+                    // expected-error{{use of undeclared identifier 'A'}}
 
 

Modified: cfe/trunk/test/Parser/expressions.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/expressions.c?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/expressions.c (original)
+++ cfe/trunk/test/Parser/expressions.c Sun Jul 25 23:08:02 2010
@@ -1,19 +1,17 @@
-// RUN: %clang_cc1 -parse-noop -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 void test1() {
-  if (sizeof (int){ 1});   // sizeof compound literal
-  if (sizeof (int));       // sizeof type
+  if (sizeof (int){ 1}) {}   // sizeof compound literal
+  if (sizeof (int)) {}       // sizeof type
 
-  (int)4;   // cast.
-  (int){4}; // compound literal.
+  (void)(int)4;   // cast.
+  (void)(int){4}; // compound literal.
 
-  // FIXME: change this to the struct version when we can.
-  //int A = (struct{ int a;}){ 1}.a;
-  int A = (int){ 1}.a;
+  int A = (struct{ int a;}){ 1}.a;
 }
 
 int test2(int a, int b) {
-  return a ? a,b : a;
+  return a ? (void)a,b : a;
 }
 
 int test3(int a, int b, int c) {
@@ -22,23 +20,27 @@
 
 int test4() {
   test4();
+  return 0;
 }
 
+struct X0 { struct { struct { int c[10][9]; } b; } a; };
+
 int test_offsetof() {
-  // FIXME: change into something that is semantically correct.
-  __builtin_offsetof(int, a.b.c[4][5]);
+  (void)__builtin_offsetof(struct X0, a.b.c[4][5]);
+  return 0;
 }
 
 void test_sizeof(){
         int arr[10];
-        sizeof arr[0];
-        sizeof(arr[0]);
-        sizeof(arr)[0];
+        (void)sizeof arr[0];
+        (void)sizeof(arr[0]);
+        (void)sizeof(arr)[0];
 }
 
 // PR3418
 int test_leading_extension() {
   __extension__ (*(char*)0) = 1;
+  return 0;
 }
 
 // PR3972

Modified: cfe/trunk/test/Parser/expressions.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/expressions.m?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/expressions.m (original)
+++ cfe/trunk/test/Parser/expressions.m Sun Jul 25 23:08:02 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -parse-noop %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
 
 void test1() {
   @"s";            // expected-warning {{expression result unused}}

Modified: cfe/trunk/test/Parser/method-prototype-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/method-prototype-1.m?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/method-prototype-1.m (original)
+++ cfe/trunk/test/Parser/method-prototype-1.m Sun Jul 25 23:08:02 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -parse-noop
+// RUN: %clang_cc1 %s -fsyntax-only
 @interface MyObject 
 - (void) bycopy  : (int) woodo, ... ;
 - (void) break  : (int) woodo, ... ;

Modified: cfe/trunk/test/Parser/objc-messaging-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-messaging-1.m?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/objc-messaging-1.m (original)
+++ cfe/trunk/test/Parser/objc-messaging-1.m Sun Jul 25 23:08:02 2010
@@ -1,19 +1,26 @@
-// RUN: %clang_cc1 %s -parse-noop
+// RUN: %clang_cc1 %s -fsyntax-only -verify
 int main ()
 {
 	int i,j;
 	struct S *p;
         id a, b, c;
-	[p ii];
-	[p if: 1 :2];
-	[p inout: 1 :2 another:(2,3,4)];
-	[p inout: 1 :2 another:(2,3,4), 6,6,8];
-	[p inout: 1 :2 another:(2,3,4), (6,4,5),6,8];
-	[p inout: 1 :2 another:(i+10), (i,j-1,5),6,8];
-	[p long: 1 :2 another:(i+10), (i,j-1,5),6,8];
-	[p : "Hello\n" :2 another:(i+10), (i,j-1,5),6,8];
+	[a ii]; // expected-warning{{not found}}
+	[a if: 1 :2]; // expected-warning{{not found}}
+	[a inout: 1 :2 another:(2,3,4)]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
+	[a inout: 1 :2 another:(2,3,4), 6,6,8]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
+	[a inout: 1 :2 another:(2,3,4), (6,4,5),6,8]; // expected-warning{{not found}} \
+           // expected-warning 4{{expression result unused}}
+	[a inout: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
+	[a long: 1 :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
+	[a : "Hello\n" :2 another:(i+10), (i,j-1,5),6,8]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
 
 	// Comma expression as receiver (rdar://6222856)
-	[a, b, c foo];
+	[a, b, c foo]; // expected-warning{{not found}} \
+           // expected-warning 2{{expression result unused}}
 
 }

Modified: cfe/trunk/test/Parser/selector-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/selector-1.m?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/selector-1.m (original)
+++ cfe/trunk/test/Parser/selector-1.m Sun Jul 25 23:08:02 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -parse-noop %s 
+// RUN: %clang_cc1 -fsyntax-only -verify %s 
 
 int main() {
  SEL s = @selector(retain);

Modified: cfe/trunk/test/Parser/types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/types.c?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/test/Parser/types.c (original)
+++ cfe/trunk/test/Parser/types.c Sun Jul 25 23:08:02 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -parse-noop
+// RUN: %clang_cc1 %s -fsyntax-only -verify
 
 // Test the X can be overloaded inside the struct.
 typedef int X; 

Modified: cfe/trunk/tools/driver/cc1_main.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/cc1_main.cpp?rev=109392&r1=109391&r2=109392&view=diff
==============================================================================
--- cfe/trunk/tools/driver/cc1_main.cpp (original)
+++ cfe/trunk/tools/driver/cc1_main.cpp Sun Jul 25 23:08:02 2010
@@ -80,8 +80,6 @@
   case GeneratePTH:            return new GeneratePTHAction();
   case InheritanceView:        return new InheritanceViewAction();
   case InitOnly:               return new InitOnlyAction();
-  case ParseNoop:              return new ParseOnlyAction();
-  case ParsePrintCallbacks:    return new PrintParseAction();
   case ParseSyntaxOnly:        return new SyntaxOnlyAction();
 
   case PluginAction: {





More information about the cfe-commits mailing list