handle_noop.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "toolchain/check/context.h"
  5. #include "toolchain/check/handle.h"
  6. namespace Carbon::Check {
  7. auto HandleParseNode(Context& /*context*/, Parse::EmptyDeclId /*node_id*/)
  8. -> bool {
  9. // Empty declarations have no actions associated.
  10. return true;
  11. }
  12. auto HandleParseNode(Context& /*context*/, Parse::InvalidParseId /*node_id*/)
  13. -> bool {
  14. CARBON_FATAL("Unreachable until we support checking error parse nodes");
  15. }
  16. auto HandleParseNode(Context& /*context*/,
  17. Parse::InvalidParseStartId /*node_id*/) -> bool {
  18. CARBON_FATAL("Unreachable until we support checking error parse nodes");
  19. }
  20. auto HandleParseNode(Context& /*context*/,
  21. Parse::InvalidParseSubtreeId /*node_id*/) -> bool {
  22. CARBON_FATAL("Unreachable until we support checking error parse nodes");
  23. }
  24. auto HandleParseNode(Context& /*context*/, Parse::PlaceholderId /*node_id*/)
  25. -> bool {
  26. CARBON_FATAL(
  27. "Placeholder node should always be replaced before parse completes");
  28. }
  29. } // namespace Carbon::Check