summaryrefslogtreecommitdiff
path: root/tools/clang-format/ClangFormat.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2013-05-10 13:04:20 +0000
committerAlexander Kornienko <alexfh@google.com>2013-05-10 13:04:20 +0000
commit0ca318bbad87b599e69f27a5297eb18b2f10b715 (patch)
tree5771680c7983089d4302efe112cf264c9676ae25 /tools/clang-format/ClangFormat.cpp
parent89b3a7f76ffe333aa61ab63826834883236caf96 (diff)
downloadclang-0ca318bbad87b599e69f27a5297eb18b2f10b715.tar.gz
clang-0ca318bbad87b599e69f27a5297eb18b2f10b715.tar.bz2
clang-0ca318bbad87b599e69f27a5297eb18b2f10b715.tar.xz
Minor clarifications in help messages and a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181591 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-format/ClangFormat.cpp')
-rw-r--r--tools/clang-format/ClangFormat.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/clang-format/ClangFormat.cpp b/tools/clang-format/ClangFormat.cpp
index 5ae95781fb..ea9482ea12 100644
--- a/tools/clang-format/ClangFormat.cpp
+++ b/tools/clang-format/ClangFormat.cpp
@@ -29,10 +29,10 @@ using namespace llvm;
static cl::opt<bool> Help("h", cl::desc("Alias for -help"), cl::Hidden);
static cl::list<unsigned>
-Offsets("offset", cl::desc("Format a range starting at this file offset. Can "
+Offsets("offset", cl::desc("Format a range starting at this byte offset. Can "
"only be used with one input file."));
static cl::list<unsigned>
-Lengths("length", cl::desc("Format a range of this length. "
+Lengths("length", cl::desc("Format a range of this length (in bytes). "
"When it's not specified, end of file is used. "
"Can only be used with one input file."));
static cl::opt<std::string> Style(
@@ -80,6 +80,8 @@ FormatStyle getStyle(StringRef StyleName, StringRef FileName) {
llvm::sys::path::append(ConfigFile, ".clang-format");
DEBUG(llvm::dbgs() << "Trying " << ConfigFile << "...\n");
bool IsFile = false;
+ // Ignore errors from is_regular_file: we only need to know if we can read
+ // the file or not.
llvm::sys::fs::is_regular_file(Twine(ConfigFile), IsFile);
if (IsFile) {
OwningPtr<MemoryBuffer> Text;