diff options
author | Daniel Jasper <djasper@google.com> | 2012-07-11 15:05:24 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-07-11 15:05:24 +0000 |
commit | d217a66ef5091e7f42ac6c39507bd8e99125aa9b (patch) | |
tree | febf20820cc0564498a365e57b07ca32bcf19d0f /tools/clang-check | |
parent | a7f2c5670cda623ae3ecb402b39ae95ec004d9a2 (diff) | |
download | clang-d217a66ef5091e7f42ac6c39507bd8e99125aa9b.tar.gz clang-d217a66ef5091e7f42ac6c39507bd8e99125aa9b.tar.bz2 clang-d217a66ef5091e7f42ac6c39507bd8e99125aa9b.tar.xz |
Fix usage instructions for clang-check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-check')
-rw-r--r-- | tools/clang-check/ClangCheck.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/clang-check/ClangCheck.cpp b/tools/clang-check/ClangCheck.cpp index d51d90e906..8fcb26a4a4 100644 --- a/tools/clang-check/ClangCheck.cpp +++ b/tools/clang-check/ClangCheck.cpp @@ -11,13 +11,14 @@ // clang::SyntaxOnlyAction over a number of translation units. // // Usage: -// clang-check <cmake-output-dir> <file1> <file2> ... +// clang-check [-p <cmake-output-dir>] <file1> <file2> ... // // Where <cmake-output-dir> is a CMake build directory in which a file named // compile_commands.json exists (enable -DCMAKE_EXPORT_COMPILE_COMMANDS in -// CMake to get this output). +// CMake to get this output). If not provided, clang-check will search for this +// file in all of <file1>'s parent directories. // -// <file1> ... specify the paths of files in the CMake source tree. This path +// <file1> ... specify the paths of files in the CMake source tree. This path // is looked up in the compile command database. If the path of a file is // absolute, it needs to point into CMake's source tree. If the path is // relative, the current working directory needs to be in the CMake source @@ -29,7 +30,7 @@ // For example, to use clang-check on all files in a subtree of the source // tree, use: // -// /path/in/subtree $ find . -name '*.cpp'| xargs clang-check /path/to/source +// /path/in/subtree $ find . -name '*.cpp'| xargs clang-check // //===----------------------------------------------------------------------===// @@ -60,7 +61,6 @@ int main(int argc, const char **argv) { if (!BuildPath.empty()) { Compilations.reset( CompilationDatabase::autoDetectFromDirectory(BuildPath, ErrorMessage)); - } else { Compilations.reset(CompilationDatabase::autoDetectFromSource( SourcePaths[0], ErrorMessage)); |