r178106 - [Preprocessor] Remove PPMutationListener.

Argyrios Kyrtzidis akyrtzi at gmail.com
Tue Mar 26 18:25:25 PDT 2013


Author: akirtzidis
Date: Tue Mar 26 20:25:24 2013
New Revision: 178106

URL: http://llvm.org/viewvc/llvm-project?rev=178106&view=rev
Log:
[Preprocessor] Remove PPMutationListener.

It's not used anymore.

Removed:
    cfe/trunk/include/clang/Lex/PPMutationListener.h
Modified:
    cfe/trunk/include/clang/AST/ASTConsumer.h
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/include/clang/Serialization/ASTReader.h
    cfe/trunk/include/clang/Serialization/ASTWriter.h
    cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp
    cfe/trunk/lib/Frontend/CompilerInstance.cpp
    cfe/trunk/lib/Frontend/FrontendAction.cpp
    cfe/trunk/lib/Lex/Preprocessor.cpp
    cfe/trunk/lib/Serialization/ASTReader.cpp
    cfe/trunk/lib/Serialization/GeneratePCH.cpp

Modified: cfe/trunk/include/clang/AST/ASTConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTConsumer.h?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTConsumer.h (original)
+++ cfe/trunk/include/clang/AST/ASTConsumer.h Tue Mar 26 20:25:24 2013
@@ -20,7 +20,6 @@ namespace clang {
   class Decl;
   class DeclGroupRef;
   class HandleTagDeclDefinition;
-  class PPMutationListener;
   class ASTMutationListener;
   class ASTDeserializationListener; // layering violation because void* is ugly
   class SemaConsumer; // layering violation required for safe SemaConsumer
@@ -113,11 +112,6 @@ public:
   /// it was actually used.
   virtual void HandleVTable(CXXRecordDecl *RD, bool DefinitionRequired) {}
 
-  /// \brief If the consumer is interested in preprocessor entities getting
-  /// modified after their initial creation, it should return a pointer to
-  /// a PPMutationListener here.
-  virtual PPMutationListener *GetPPMutationListener() { return 0; }
-
   /// \brief If the consumer is interested in entities getting modified after
   /// their initial creation, it should return a pointer to
   /// an ASTMutationListener here.

Removed: cfe/trunk/include/clang/Lex/PPMutationListener.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/PPMutationListener.h?rev=178105&view=auto
==============================================================================
--- cfe/trunk/include/clang/Lex/PPMutationListener.h (original)
+++ cfe/trunk/include/clang/Lex/PPMutationListener.h (removed)
@@ -1,43 +0,0 @@
-//===--- PPMutationListener.h - Preprocessor Mutation Interface -*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-//  This file defines the PPMutationListener interface.
-//
-//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_LEX_PPTMUTATIONLISTENER_H
-#define LLVM_CLANG_LEX_PPTMUTATIONLISTENER_H
-
-#include "clang/Basic/SourceLocation.h"
-
-namespace clang {
-
-class MacroDirective;
-
-/// \brief A record that describes an update to a macro that was
-/// originally loaded to an AST file and has been modified within the
-/// current translation unit.
-struct MacroUpdate {
-  /// \brief The source location at which this macro was #undef'd.
-  SourceLocation UndefLoc;
-};
-
-/// \brief An abstract interface that should be implemented by
-/// listeners that want to be notified when a preprocessor entity gets
-/// modified after its initial creation.
-class PPMutationListener {
-public:
-  virtual ~PPMutationListener();
-
-  /// \brief A macro has been #undef'd.
-  virtual void UndefinedMacro(MacroDirective *MD) { }
-};
-
-} // end namespace clang
-
-#endif

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Tue Mar 26 20:25:24 2013
@@ -21,7 +21,6 @@
 #include "clang/Lex/Lexer.h"
 #include "clang/Lex/MacroInfo.h"
 #include "clang/Lex/PPCallbacks.h"
-#include "clang/Lex/PPMutationListener.h"
 #include "clang/Lex/PTHLexer.h"
 #include "clang/Lex/PTHManager.h"
 #include "clang/Lex/TokenLexer.h"
@@ -296,11 +295,6 @@ class Preprocessor : public RefCountedBa
   /// encountered (e.g. a file is \#included, etc).
   PPCallbacks *Callbacks;
 
-  /// \brief Listener whose actions are invoked when an entity in the
-  /// preprocessor (e.g., a macro) that was loaded from an AST file is
-  /// later mutated.
-  PPMutationListener *Listener;
-
   struct MacroExpandsInfo {
     Token Tok;
     MacroDirective *MD;
@@ -519,19 +513,6 @@ public:
     Callbacks = C;
   }
 
-  /// \brief Attach an preprocessor mutation listener to the preprocessor.
-  ///
-  /// The preprocessor mutation listener provides the ability to track
-  /// modifications to the preprocessor entities committed after they were
-  /// initially created.
-  void setPPMutationListener(PPMutationListener *Listener) {
-    this->Listener = Listener;
-  }
-
-  /// \brief Retrieve a pointer to the preprocessor mutation listener
-  /// associated with this preprocessor, if any.
-  PPMutationListener *getPPMutationListener() const { return Listener; }
-
   /// \brief Given an identifier, return its latest MacroDirective if it is
   // \#defined or null if it isn't \#define'd.
   MacroDirective *getMacroDirective(IdentifierInfo *II) const {

Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Tue Mar 26 20:25:24 2013
@@ -24,7 +24,6 @@
 #include "clang/Basic/SourceManager.h"
 #include "clang/Lex/ExternalPreprocessorSource.h"
 #include "clang/Lex/HeaderSearch.h"
-#include "clang/Lex/PPMutationListener.h"
 #include "clang/Lex/PreprocessingRecord.h"
 #include "clang/Sema/ExternalSemaSource.h"
 #include "clang/Serialization/ASTBitCodes.h"
@@ -440,15 +439,6 @@ private:
   /// global macro ID to produce a local ID.
   GlobalMacroMapType GlobalMacroMap;
 
-  typedef llvm::DenseMap<serialization::MacroID,
-            SmallVector<std::pair<serialization::SubmoduleID,
-                                        MacroUpdate>, 1> >
-    MacroUpdatesMap;
-
-  /// \brief Mapping from (global) macro IDs to the set of updates to be
-  /// performed to the corresponding macro.
-  MacroUpdatesMap MacroUpdates;
-
   /// \brief A vector containing submodules that have already been loaded.
   ///
   /// This vector is indexed by the Submodule ID (-1). NULL submodule entries

Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Tue Mar 26 20:25:24 2013
@@ -18,7 +18,6 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclarationName.h"
 #include "clang/AST/TemplateBase.h"
-#include "clang/Lex/PPMutationListener.h"
 #include "clang/Sema/SemaConsumer.h"
 #include "clang/Serialization/ASTBitCodes.h"
 #include "clang/Serialization/ASTDeserializationListener.h"
@@ -76,7 +75,6 @@ namespace SrcMgr { class SLocEntry; }
 /// data structures. This bitstream can be de-serialized via an
 /// instance of the ASTReader class.
 class ASTWriter : public ASTDeserializationListener,
-                  public PPMutationListener,
                   public ASTMutationListener {
 public:
   typedef SmallVector<uint64_t, 64> RecordData;
@@ -755,7 +753,6 @@ public:
   ~PCHGenerator();
   virtual void InitializeSema(Sema &S) { SemaPtr = &S; }
   virtual void HandleTranslationUnit(ASTContext &Ctx);
-  virtual PPMutationListener *GetPPMutationListener();
   virtual ASTMutationListener *GetASTMutationListener();
   virtual ASTDeserializationListener *GetASTDeserializationListener();
 };

Modified: cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp (original)
+++ cfe/trunk/lib/Frontend/ChainedIncludesSource.cpp Tue Mar 26 20:25:24 2013
@@ -113,8 +113,6 @@ ChainedIncludesSource *ChainedIncludesSo
     OwningPtr<ASTConsumer> consumer;
     consumer.reset(new PCHGenerator(Clang->getPreprocessor(), "-", 0,
                                     /*isysroot=*/"", &OS));
-    Clang->getPreprocessor().setPPMutationListener(
-                                            consumer->GetPPMutationListener());
     Clang->getASTContext().setASTMutationListener(
                                             consumer->GetASTMutationListener());
     Clang->setASTConsumer(consumer.take());

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Tue Mar 26 20:25:24 2013
@@ -1158,8 +1158,6 @@ CompilerInstance::loadModule(SourceLocat
           getASTConsumer().GetASTDeserializationListener());
         getASTContext().setASTMutationListener(
           getASTConsumer().GetASTMutationListener());
-        getPreprocessor().setPPMutationListener(
-          getASTConsumer().GetPPMutationListener());
       }
       OwningPtr<ExternalASTSource> Source;
       Source.reset(ModuleManager);

Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Tue Mar 26 20:25:24 2013
@@ -287,8 +287,6 @@ bool FrontendAction::BeginSourceFile(Com
       goto failure;
 
     CI.getASTContext().setASTMutationListener(Consumer->GetASTMutationListener());
-    CI.getPreprocessor().setPPMutationListener(
-      Consumer->GetPPMutationListener());
     
     if (!CI.getPreprocessorOpts().ChainedIncludes.empty()) {
       // Convert headers to PCH and chain them.

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Tue Mar 26 20:25:24 2013
@@ -54,8 +54,6 @@ using namespace clang;
 //===----------------------------------------------------------------------===//
 ExternalPreprocessorSource::~ExternalPreprocessorSource() { }
 
-PPMutationListener::~PPMutationListener() { }
-
 Preprocessor::Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> PPOpts,
                            DiagnosticsEngine &diags, LangOptions &opts,
                            const TargetInfo *target, SourceManager &SM,
@@ -68,7 +66,7 @@ Preprocessor::Preprocessor(IntrusiveRefC
       Identifiers(opts, IILookup), IncrementalProcessing(IncrProcessing),
       CodeComplete(0), CodeCompletionFile(0), CodeCompletionOffset(0),
       CodeCompletionReached(0), SkipMainFilePreamble(0, true), CurPPLexer(0),
-      CurDirLookup(0), CurLexerKind(CLK_Lexer), Callbacks(0), Listener(0),
+      CurDirLookup(0), CurLexerKind(CLK_Lexer), Callbacks(0),
       MacroArgCache(0), Record(0), MIChainHead(0), MICache(0) {
   OwnsHeaderSearch = OwnsHeaders;
   

Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Tue Mar 26 20:25:24 2013
@@ -2740,7 +2740,7 @@ void ASTReader::makeNamesVisible(const H
     }
 
     case HiddenName::MacroUndef: {
-      // FIXME: Remove HiddenName::MacroUndef and PPMutationListener.
+      // FIXME: Remove HiddenName::MacroUndef.
       break;
     }
     }

Modified: cfe/trunk/lib/Serialization/GeneratePCH.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GeneratePCH.cpp?rev=178106&r1=178105&r2=178106&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GeneratePCH.cpp (original)
+++ cfe/trunk/lib/Serialization/GeneratePCH.cpp Tue Mar 26 20:25:24 2013
@@ -55,10 +55,6 @@ void PCHGenerator::HandleTranslationUnit
   Buffer.clear();
 }
 
-PPMutationListener *PCHGenerator::GetPPMutationListener() {
-  return &Writer;
-}
-
 ASTMutationListener *PCHGenerator::GetASTMutationListener() {
   return &Writer;
 }





More information about the cfe-commits mailing list