2013-01-05 02:25:18 +08:00
|
|
|
//===-- LoopConvert/LoopMatchers.h - Matchers for for loops -----*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
///
|
|
|
|
/// \file
|
|
|
|
/// \brief This file contains declarations of the matchers for use in migrating
|
|
|
|
/// C++ for loops. The matchers are responsible for checking the general shape
|
|
|
|
/// of the for loop, namely the init, condition, and increment portions.
|
|
|
|
/// Further analysis will be needed to confirm that the loop is in fact
|
|
|
|
/// convertible in the matcher callback.
|
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
2013-07-08 20:17:37 +08:00
|
|
|
|
2013-09-05 03:13:50 +08:00
|
|
|
#ifndef CLANG_MODERNIZE_LOOP_MATCHERS_H
|
|
|
|
#define CLANG_MODERNIZE_LOOP_MATCHERS_H
|
2013-01-05 02:25:18 +08:00
|
|
|
|
|
|
|
#include "clang/ASTMatchers/ASTMatchers.h"
|
|
|
|
|
|
|
|
// Constants used for matcher name bindings
|
|
|
|
extern const char LoopName[];
|
|
|
|
extern const char ConditionBoundName[];
|
|
|
|
extern const char ConditionVarName[];
|
|
|
|
extern const char ConditionEndVarName[];
|
|
|
|
extern const char IncrementVarName[];
|
|
|
|
extern const char InitVarName[];
|
2013-05-10 01:46:20 +08:00
|
|
|
extern const char BeginCallName[];
|
2013-01-05 02:25:18 +08:00
|
|
|
extern const char EndExprName[];
|
|
|
|
extern const char EndCallName[];
|
|
|
|
extern const char EndVarName[];
|
2013-03-08 00:22:05 +08:00
|
|
|
extern const char DerefByValueResultName[];
|
2013-05-10 01:46:20 +08:00
|
|
|
extern const char DerefByRefResultName[];
|
2013-01-05 02:25:18 +08:00
|
|
|
|
|
|
|
clang::ast_matchers::StatementMatcher makeArrayLoopMatcher();
|
|
|
|
clang::ast_matchers::StatementMatcher makeIteratorLoopMatcher();
|
|
|
|
clang::ast_matchers::StatementMatcher makePseudoArrayLoopMatcher();
|
|
|
|
|
2013-09-05 03:13:50 +08:00
|
|
|
#endif // CLANG_MODERNIZE_LOOP_MATCHERS_H
|