var_decl.h 894 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_MIGRATE_CPP_CPP_REFACTORING_VAR_DECL_H_
  5. #define CARBON_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. void AddMatcher(
  19. clang::ast_matchers::MatchFinder* finder,
  20. clang::ast_matchers::MatchFinder::MatchCallback* callback) override;
  21. };
  22. } // namespace Carbon
  23. #endif // CARBON_MIGRATE_CPP_CPP_REFACTORING_VAR_DECL_H_