function.h 918 B

12345678910111213141516171819202122232425262728293031
  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_SEMANTICS_FUNCTION_H_
  5. #define CARBON_TOOLCHAIN_SEMANTICS_FUNCTION_H_
  6. #include "toolchain/parser/parse_tree.h"
  7. namespace Carbon::Semantics {
  8. // Semantic information for a function.
  9. class Function {
  10. public:
  11. Function(ParseTree::Node decl_node, ParseTree::Node name_node)
  12. : decl_node_(decl_node), name_node_(name_node) {}
  13. auto decl_node() const -> ParseTree::Node { return decl_node_; }
  14. auto name_node() const -> ParseTree::Node { return name_node_; }
  15. private:
  16. // The FunctionDeclaration node.
  17. ParseTree::Node decl_node_;
  18. // The function's DeclaredName node.
  19. ParseTree::Node name_node_;
  20. };
  21. } // namespace Carbon::Semantics
  22. #endif // CARBON_TOOLCHAIN_SEMANTICS_FUNCTION_H_