for_range.h 879 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 MIGRATE_CPP_CPP_REFACTORING_FOR_RANGE_H_
  5. #define MIGRATE_CPP_CPP_REFACTORING_FOR_RANGE_H_
  6. #include "migrate_cpp/cpp_refactoring/matcher.h"
  7. namespace Carbon {
  8. // Updates variable declarations for `var name: Type`.
  9. class ForRange : 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 ForRangeFactory : public MatcherFactoryBase<ForRange> {
  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 // MIGRATE_CPP_CPP_REFACTORING_FOR_RANGE_H_