var_decl.h 807 B

1234567891011121314151617181920212223242526272829
  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 MIGRATE_CPP_CPP_REFACTORING_VAR_DECL_H_
  5. #define MIGRATE_CPP_CPP_REFACTORING_VAR_DECL_H_
  6. #include "migrate_cpp/cpp_refactoring/matcher.h"
  7. namespace Carbon {
  8. // Updates variable declarations for `var name: Type`.
  9. class VarDecl : public Matcher {
  10. public:
  11. using Matcher::Matcher;
  12. void Run() override;
  13. private:
  14. auto GetTypeStr(const clang::VarDecl& decl) -> std::string;
  15. };
  16. class VarDeclFactory : public MatcherFactoryBase<VarDecl> {
  17. public:
  18. auto GetAstMatcher() -> clang::ast_matchers::DeclarationMatcher override;
  19. };
  20. } // namespace Carbon
  21. #endif // MIGRATE_CPP_CPP_REFACTORING_VAR_DECL_H_