handle.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef CARBON_TOOLCHAIN_CHECK_HANDLE_H_
  5. #define CARBON_TOOLCHAIN_CHECK_HANDLE_H_
  6. #include "toolchain/check/context.h"
  7. #include "toolchain/check/deferred_definition_worklist.h"
  8. #include "toolchain/check/function.h"
  9. #include "toolchain/parse/node_ids.h"
  10. namespace Carbon::Check {
  11. // Parse node handlers. Returns false for unrecoverable errors.
  12. #define CARBON_PARSE_NODE_KIND(Name) \
  13. auto HandleParseNode(Context& context, Parse::Name##Id node_id) -> bool;
  14. #include "toolchain/parse/node_kind.def"
  15. // Handle suspending the definition of a function. This is used for inline
  16. // methods, which are processed out of the normal lexical order. This plus
  17. // HandleFunctionDefinitionResume carry out the same actions as
  18. // HandleFunctionDefinitionStart, except that the various context stacks are
  19. // cleared out in between.
  20. auto HandleFunctionDefinitionSuspend(Context& context,
  21. Parse::FunctionDefinitionStartId node_id)
  22. -> DeferredDefinitionWorklist::SuspendedFunction;
  23. // Handle resuming the definition of a function, after a previous suspension.
  24. auto HandleFunctionDefinitionResume(
  25. Context& context, Parse::FunctionDefinitionStartId node_id,
  26. DeferredDefinitionWorklist::SuspendedFunction&& suspended_fn) -> void;
  27. } // namespace Carbon::Check
  28. #endif // CARBON_TOOLCHAIN_CHECK_HANDLE_H_