1239313Sdim//===--- ArgumentsAdjusters.h - Command line arguments adjuster -*- C++ -*-===//
2239313Sdim//
3239313Sdim//                     The LLVM Compiler Infrastructure
4239313Sdim//
5239313Sdim// This file is distributed under the University of Illinois Open Source
6239313Sdim// License. See LICENSE.TXT for details.
7239313Sdim//
8239313Sdim//===----------------------------------------------------------------------===//
9239313Sdim//
10239313Sdim// This file declares base abstract class ArgumentsAdjuster and its descendants.
11239313Sdim// These classes are intended to modify command line arguments obtained from
12239313Sdim// a compilation database before they are used to run a frontend action.
13239313Sdim//
14239313Sdim//===----------------------------------------------------------------------===//
15239313Sdim
16239313Sdim#ifndef LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H
17239313Sdim#define LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H
18239313Sdim
19239313Sdim#include <string>
20239313Sdim#include <vector>
21239313Sdim
22239313Sdimnamespace clang {
23239313Sdim
24239313Sdimnamespace tooling {
25239313Sdim
26239313Sdim/// \brief A sequence of command line arguments.
27239313Sdimtypedef std::vector<std::string> CommandLineArguments;
28239313Sdim
29239313Sdim/// \brief Abstract interface for a command line adjusters.
30239313Sdim///
31239313Sdim/// This abstract interface describes a command line argument adjuster,
32239313Sdim/// which is responsible for command line arguments modification before
33239313Sdim/// the arguments are used to run a frontend action.
34239313Sdimclass ArgumentsAdjuster {
35239313Sdim  virtual void anchor();
36239313Sdimpublic:
37239313Sdim  /// \brief Returns adjusted command line arguments.
38239313Sdim  ///
39239313Sdim  /// \param Args Input sequence of command line arguments.
40239313Sdim  ///
41239313Sdim  /// \returns Modified sequence of command line arguments.
42239313Sdim  virtual CommandLineArguments Adjust(const CommandLineArguments &Args) = 0;
43239313Sdim  virtual ~ArgumentsAdjuster() {
44239313Sdim  }
45239313Sdim};
46239313Sdim
47239313Sdim/// \brief Syntax check only command line adjuster.
48239313Sdim///
49239313Sdim/// This class implements ArgumentsAdjuster interface and converts input
50239313Sdim/// command line arguments to the "syntax check only" variant.
51239313Sdimclass ClangSyntaxOnlyAdjuster : public ArgumentsAdjuster {
52239313Sdim  virtual CommandLineArguments Adjust(const CommandLineArguments &Args);
53239313Sdim};
54239313Sdim
55239313Sdim} // end namespace tooling
56239313Sdim} // end namespace clang
57239313Sdim
58239313Sdim#endif // LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H
59239313Sdim
60