Edwin Vane | 44c3145 | 2013-01-22 18:31:49 +0000 | [diff] [blame] | 1 | //===-- LoopConvert/LoopConvert.h - C++11 for-loop migration ----*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | /// |
| 10 | /// \file |
| 11 | /// \brief This file provides the definition of the UseNullptrTransform |
| 12 | /// class which is the main interface to the use-nullptr transform |
| 13 | /// that tries to make use of nullptr where possible. |
| 14 | /// |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | #ifndef LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_NULLPTR_H |
| 17 | #define LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_NULLPTR_H |
| 18 | |
| 19 | #include "Transform.h" |
| 20 | #include "llvm/Support/Compiler.h" // For LLVM_OVERRIDE |
| 21 | |
| 22 | /// \brief Subclass of Transform that transforms null pointer constants into |
| 23 | /// C++11's nullptr keyword where possible. |
| 24 | class UseNullptrTransform : public Transform { |
| 25 | public: |
| 26 | /// \see Transform::run(). |
| 27 | virtual int apply(const FileContentsByPath &InputStates, |
| 28 | RiskLevel MaxRiskLEvel, |
| 29 | const clang::tooling::CompilationDatabase &Database, |
| 30 | const std::vector<std::string> &SourcePaths, |
| 31 | FileContentsByPath &ResultStates) LLVM_OVERRIDE; |
| 32 | }; |
| 33 | |
| 34 | #endif // LLVM_TOOLS_CLANG_TOOLS_EXTRA_CPP11_MIGRATE_USE_NULLPTR_H |