1 //===--- PPMutationListener.h - Preprocessor Mutation Interface -*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines the PPMutationListener interface. 11 // 12 //===----------------------------------------------------------------------===// 13 #ifndef LLVM_CLANG_LEX_PPTMUTATIONLISTENER_H 14 #define LLVM_CLANG_LEX_PPTMUTATIONLISTENER_H 15 16 #include "clang/Basic/SourceLocation.h" 17 18 namespace clang { 19 20 class MacroDirective; 21 22 /// \brief A record that describes an update to a macro that was 23 /// originally loaded to an AST file and has been modified within the 24 /// current translation unit. 25 struct MacroUpdate { 26 /// \brief The source location at which this macro was #undef'd. 27 SourceLocation UndefLoc; 28 }; 29 30 /// \brief An abstract interface that should be implemented by 31 /// listeners that want to be notified when a preprocessor entity gets 32 /// modified after its initial creation. 33 class PPMutationListener { 34 public: 35 virtual ~PPMutationListener(); 36 37 /// \brief A macro has been #undef'd. 38 virtual void UndefinedMacro(MacroDirective *MD) { } 39 }; 40 41 } // end namespace clang 42 43 #endif 44