1 //===--- ArgumentsAdjusters.h - Command line arguments adjuster -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares base abstract class ArgumentsAdjuster and its descendants.
11 // These classes are intended to modify command line arguments obtained from
12 // a compilation database before they are used to run a frontend action.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H
17 #define LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H
26 /// \brief A sequence of command line arguments.
27 typedef std::vector<std::string> CommandLineArguments;
29 /// \brief Abstract interface for a command line adjusters.
31 /// This abstract interface describes a command line argument adjuster,
32 /// which is responsible for command line arguments modification before
33 /// the arguments are used to run a frontend action.
34 class ArgumentsAdjuster {
35 virtual void anchor();
37 /// \brief Returns adjusted command line arguments.
39 /// \param Args Input sequence of command line arguments.
41 /// \returns Modified sequence of command line arguments.
42 virtual CommandLineArguments Adjust(const CommandLineArguments &Args) = 0;
43 virtual ~ArgumentsAdjuster() {
47 /// \brief Syntax check only command line adjuster.
49 /// This class implements ArgumentsAdjuster interface and converts input
50 /// command line arguments to the "syntax check only" variant.
51 class ClangSyntaxOnlyAdjuster : public ArgumentsAdjuster {
52 virtual CommandLineArguments Adjust(const CommandLineArguments &Args);
55 /// \brief An argument adjuster which removes output-related command line
57 class ClangStripOutputAdjuster : public ArgumentsAdjuster {
58 virtual CommandLineArguments Adjust(const CommandLineArguments &Args);
61 } // end namespace tooling
62 } // end namespace clang
64 #endif // LLVM_CLANG_TOOLING_ARGUMENTSADJUSTERS_H