r181591 - Minor clarifications in help messages and a comment.
Alexander Kornienko
alexfh at google.com
Fri May 10 06:04:20 PDT 2013
Author: alexfh
Date: Fri May 10 08:04:20 2013
New Revision: 181591
URL: http://llvm.org/viewvc/llvm-project?rev=181591&view=rev
Log:
Minor clarifications in help messages and a comment.
Modified:
cfe/trunk/tools/clang-format/ClangFormat.cpp
Modified: cfe/trunk/tools/clang-format/ClangFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format/ClangFormat.cpp?rev=181591&r1=181590&r2=181591&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format/ClangFormat.cpp (original)
+++ cfe/trunk/tools/clang-format/ClangFormat.cpp Fri May 10 08:04:20 2013
@@ -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
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;
More information about the cfe-commits
mailing list