diff options
author | Simon Atanasyan <satanasyan@mips.com> | 2012-05-09 16:18:30 +0000 |
---|---|---|
committer | Simon Atanasyan <satanasyan@mips.com> | 2012-05-09 16:18:30 +0000 |
commit | a01ddc787b5c8b1cf11e975d3586908d3629954c (patch) | |
tree | 5358de2a3762116e1e2e6887a43bcd2993859778 /lib/Tooling/ArgumentsAdjusters.cpp | |
parent | 4c4cc16dbb4ab44909ea3cbb43609ef5ea19b9d2 (diff) | |
download | clang-a01ddc787b5c8b1cf11e975d3586908d3629954c.tar.gz |
Declare abstract class ArgumentsAdjuster. This abstract interface describes
a command line argument adjuster, which is responsible for command line
arguments modification before the arguments are used to run a frontend action.
Define class ClangSyntaxOnlyAdjuster implements ArgumentsAdjuster interface.
This class converts input command line arguments to the "syntax check only"
variant.
Reviewed by Manuel Klimek.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156478 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/ArgumentsAdjusters.cpp')
-rw-r--r-- | lib/Tooling/ArgumentsAdjusters.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/Tooling/ArgumentsAdjusters.cpp b/lib/Tooling/ArgumentsAdjusters.cpp new file mode 100644 index 0000000000..73ad39816b --- /dev/null +++ b/lib/Tooling/ArgumentsAdjusters.cpp @@ -0,0 +1,31 @@ +//===--- ArgumentsAdjusters.cpp - Command line arguments adjuster ---------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains definitions of classes which implement ArgumentsAdjuster +// interface. +// +//===----------------------------------------------------------------------===// + +#include "clang/Tooling/ArgumentsAdjusters.h" + +namespace clang { +namespace tooling { + +/// Add -fsyntax-only option to the commnand line arguments. +CommandLineArguments +ClangSyntaxOnlyAdjuster::Adjust(const CommandLineArguments &Args) { + CommandLineArguments AdjustedArgs = Args; + // FIXME: Remove options that generate output. + AdjustedArgs.push_back("-fsyntax-only"); + return AdjustedArgs; +} + +} // end namespace tooling +} // end namespace clang + |