2013-01-05 02:25:18 +08:00
|
|
|
//===-- LoopConvert/LoopConvert.h - C++11 for-loop migration ----*- 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 provides the definition of the LoopConvertTransform
|
2013-07-08 20:17:37 +08:00
|
|
|
/// class which is the main interface to the loop-convert transform that tries
|
|
|
|
/// to make use of range-based for loops where possible.
|
2013-01-05 02:25:18 +08:00
|
|
|
///
|
|
|
|
//===----------------------------------------------------------------------===//
|
2013-07-08 20:17:37 +08:00
|
|
|
|
2013-09-05 03:13:50 +08:00
|
|
|
#ifndef CLANG_MODERNIZE_LOOP_CONVERT_H
|
|
|
|
#define CLANG_MODERNIZE_LOOP_CONVERT_H
|
2013-01-05 02:25:18 +08:00
|
|
|
|
2013-04-05 04:19:58 +08:00
|
|
|
#include "Core/Transform.h"
|
2013-01-17 05:11:50 +08:00
|
|
|
#include "llvm/Support/Compiler.h" // For LLVM_OVERRIDE
|
2013-01-05 02:25:18 +08:00
|
|
|
|
2013-01-17 05:11:50 +08:00
|
|
|
/// \brief Subclass of Transform that transforms for-loops into range-based
|
|
|
|
/// for-loops where possible.
|
2013-01-05 02:25:18 +08:00
|
|
|
class LoopConvertTransform : public Transform {
|
|
|
|
public:
|
2013-06-07 04:31:52 +08:00
|
|
|
LoopConvertTransform(const TransformOptions &Options)
|
|
|
|
: Transform("LoopConvert", Options) {}
|
2013-01-05 02:25:18 +08:00
|
|
|
|
2013-01-17 06:10:09 +08:00
|
|
|
/// \see Transform::run().
|
2013-09-03 21:16:02 +08:00
|
|
|
virtual int apply(const FileOverrides &InputStates,
|
2013-01-05 02:25:18 +08:00
|
|
|
const clang::tooling::CompilationDatabase &Database,
|
2013-06-18 23:31:01 +08:00
|
|
|
const std::vector<std::string> &SourcePaths) LLVM_OVERRIDE;
|
2013-01-05 02:25:18 +08:00
|
|
|
};
|
|
|
|
|
2013-09-05 03:13:50 +08:00
|
|
|
#endif // CLANG_MODERNIZE_LOOP_CONVERT_H
|