summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/ExternalSemaSource.h
blob: 0f0d375e9c30a729a3ea168837d9ba0c33d63d89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//===--- ExternalSemaSource.h - External Sema 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 ExternalSemaSource interface.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H
#define LLVM_CLANG_SEMA_EXTERNAL_SEMA_SOURCE_H

#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExternalASTSource.h"

namespace clang {

class Sema;

/// \brief An abstract interface that should be implemented by
/// external AST sources that also provide information for semantic
/// analysis.
class ExternalSemaSource : public ExternalASTSource {
public:
  ExternalSemaSource() {
    ExternalASTSource::SemaSource = true;
  }

  /// \brief Initialize the semantic source with the Sema instance
  /// being used to perform semantic analysis on the abstract syntax
  /// tree.
  virtual void InitializeSema(Sema &S) {}

  /// \brief Load the contents of the global method pool for a given
  /// selector.
  ///
  /// \returns a pair of Objective-C methods lists containing the
  /// instance and factory methods, respectively, with this selector.
  virtual std::pair<ObjCMethodList, ObjCMethodList> 
  ReadMethodPool(Selector Sel) { 
    return std::pair<ObjCMethodList, ObjCMethodList>();
  }
  
  // isa/cast/dyn_cast support
  static bool classof(const ExternalASTSource *Source) { 
    return Source->SemaSource;
  }
  static bool classof(const ExternalSemaSource *) { return true; }
};

} // end namespace clang

#endif
OpenPOWER on IntegriCloud