ExternalSemaSource.h revision 210299
156693Sjhb//===--- ExternalSemaSource.h - External Sema Interface ---------*- C++ -*-===// 2130943Sjhb// 356693Sjhb// The LLVM Compiler Infrastructure 456693Sjhb// 5130943Sjhb// This file is distributed under the University of Illinois Open Source 6130943Sjhb// License. See LICENSE.TXT for details. 7130943Sjhb// 8130943Sjhb//===----------------------------------------------------------------------===// 9130943Sjhb// 10130943Sjhb// This file defines the ExternalSemaSource interface. 11130943Sjhb// 12130943Sjhb//===----------------------------------------------------------------------===// 13130943Sjhb#ifndef LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H 14130943Sjhb#define LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H 15130943Sjhb 1656693Sjhb#include "clang/AST/DeclObjC.h" 17130943Sjhb#include "clang/AST/ExternalASTSource.h" 18130943Sjhb 19130943Sjhbnamespace clang { 20130943Sjhb 21130943Sjhbclass Sema; 22130943Sjhb 23130943Sjhb/// \brief An abstract interface that should be implemented by 24130943Sjhb/// external AST sources that also provide information for semantic 25130943Sjhb/// analysis. 26130943Sjhbclass ExternalSemaSource : public ExternalASTSource { 27130943Sjhbpublic: 2856693Sjhb ExternalSemaSource() { 2956693Sjhb ExternalASTSource::SemaSource = true; 3056693Sjhb } 3156693Sjhb 3256693Sjhb ~ExternalSemaSource(); 3385998Sjhb 3485998Sjhb /// \brief Initialize the semantic source with the Sema instance 3585998Sjhb /// being used to perform semantic analysis on the abstract syntax 3685998Sjhb /// tree. 3756693Sjhb virtual void InitializeSema(Sema &S) {} 3885998Sjhb 3985998Sjhb /// \brief Inform the semantic consumer that Sema is no longer available. 4085998Sjhb virtual void ForgetSema() {} 4185998Sjhb 4256693Sjhb /// \brief Load the contents of the global method pool for a given 4356693Sjhb /// selector. 4456693Sjhb /// 4556693Sjhb /// \returns a pair of Objective-C methods lists containing the 4658713Sjhb /// instance and factory methods, respectively, with this selector. 4756693Sjhb virtual std::pair<ObjCMethodList, ObjCMethodList> 4856693Sjhb ReadMethodPool(Selector Sel) { 4956693Sjhb return std::pair<ObjCMethodList, ObjCMethodList>(); 5056693Sjhb } 5156693Sjhb 5256693Sjhb // isa/cast/dyn_cast support 5358713Sjhb static bool classof(const ExternalASTSource *Source) { 5456693Sjhb return Source->SemaSource; 5556693Sjhb } 5658713Sjhb static bool classof(const ExternalSemaSource *) { return true; } 5758713Sjhb}; 5858713Sjhb 5958713Sjhb} // end namespace clang 6058713Sjhb 6158713Sjhb#endif 6258713Sjhb