1 //===- ExternalPreprocessorSource.h - Abstract Macro Interface --*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file defines the ExternalPreprocessorSource interface, which enables
10 // construction of macro definitions from some external source.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
14 #define LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
21 /// Abstract interface for external sources of preprocessor
24 /// This abstract class allows an external sources (such as the \c ASTReader)
25 /// to provide additional preprocessing information.
26 class ExternalPreprocessorSource {
28 virtual ~ExternalPreprocessorSource();
30 /// Read the set of macros defined by this external macro source.
31 virtual void ReadDefinedMacros() = 0;
33 /// Update an out-of-date identifier.
34 virtual void updateOutOfDateIdentifier(IdentifierInfo &II) = 0;
36 /// Return the identifier associated with the given ID number.
38 /// The ID 0 is associated with the NULL identifier.
39 virtual IdentifierInfo *GetIdentifier(unsigned ID) = 0;
41 /// Map a module ID to a module.
42 virtual Module *getModule(unsigned ModuleID) = 0;