ExternalPreprocessorSource.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- ExternalPreprocessorSource.h - Abstract Macro Interface --*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file defines the ExternalPreprocessorSource interface, which enables
  15. // construction of macro definitions from some external source.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
  19. #define LLVM_CLANG_LEX_EXTERNALPREPROCESSORSOURCE_H
  20. namespace clang {
  21. class IdentifierInfo;
  22. class Module;
  23. /// Abstract interface for external sources of preprocessor
  24. /// information.
  25. ///
  26. /// This abstract class allows an external sources (such as the \c ASTReader)
  27. /// to provide additional preprocessing information.
  28. class ExternalPreprocessorSource {
  29. public:
  30. virtual ~ExternalPreprocessorSource();
  31. /// Read the set of macros defined by this external macro source.
  32. virtual void ReadDefinedMacros() = 0;
  33. /// Update an out-of-date identifier.
  34. virtual void updateOutOfDateIdentifier(IdentifierInfo &II) = 0;
  35. /// Return the identifier associated with the given ID number.
  36. ///
  37. /// The ID 0 is associated with the NULL identifier.
  38. virtual IdentifierInfo *GetIdentifier(unsigned ID) = 0;
  39. /// Map a module ID to a module.
  40. virtual Module *getModule(unsigned ModuleID) = 0;
  41. };
  42. }
  43. #endif
  44. #ifdef __GNUC__
  45. #pragma GCC diagnostic pop
  46. #endif