This commit include the following changes:
- SourceOverrides is now a class
- it simplifies the usage for the Transform class, since now the
replacements can be applied directly to the file overrides with
SourceOverrides::applyReplacements().
- it contains a method applyRewrites() which was previously named
collectResults() in Transform.cpp. The method has been "optimized"
a bit to re-use the allocated buffer (std::string::clear() is called).
- since the class has some logic it's now unit tested
- Now FileOverrides is a class (not a std::map typedef) and store pointers
to the SourceOverrides. The reason is that the SourceOverrides can't be
copied anymore (which was already something to avoid since it's can be a
quite large object).
Author: Guillaume Papin <guillaume.papin@epitech.eu>
Differential Revision: http://llvm-reviews.chandlerc.com/D1122
llvm-svn: 186161
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
//===-- Core/SyntaxCheck.h --------------------------------------*- 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 exposes functionaliy for doing a syntax-only check on
|
|
/// files with overridden contents.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef CPP11_MIGRATE_SYNTAX_CHECK_H
|
|
#define CPP11_MIGRATE_SYNTAX_CHECK_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
// Forward Declarations
|
|
namespace clang {
|
|
namespace tooling {
|
|
class CompilationDatabase;
|
|
} // namespace tooling
|
|
} // namespace clang
|
|
|
|
class FileOverrides;
|
|
|
|
/// \brief Perform a syntax-only check over all files in \c SourcePaths using
|
|
/// options provided by \c Database using file contents from \c Overrides if
|
|
/// available.
|
|
extern bool doSyntaxCheck(const clang::tooling::CompilationDatabase &Database,
|
|
const std::vector<std::string> &SourcePaths,
|
|
const FileOverrides &Overrides);
|
|
|
|
#endif // CPP11_MIGRATE_SYNTAX_CHECK_H
|