member.cpp 603 B

1234567891011121314151617181920212223
  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 "executable_semantics/ast/member.h"
  5. #include "executable_semantics/common/arena.h"
  6. #include "llvm/Support/Casting.h"
  7. namespace Carbon {
  8. using llvm::cast;
  9. void Member::Print(llvm::raw_ostream& out) const {
  10. switch (kind()) {
  11. case Kind::FieldMember:
  12. const auto& field = cast<FieldMember>(*this);
  13. out << "var " << field.binding() << ";\n";
  14. break;
  15. }
  16. }
  17. } // namespace Carbon