[PATCH] D44778: [clang-format] Wildcard expansion on Windows.
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 23 07:25:03 PDT 2018
alexfh updated this revision to Diff 139593.
alexfh added a comment.
- Use llvm::sys::Process::GetArgumentVector.
Repository:
rC Clang
https://reviews.llvm.org/D44778
Files:
tools/clang-format/ClangFormat.cpp
Index: tools/clang-format/ClangFormat.cpp
===================================================================
--- tools/clang-format/ClangFormat.cpp
+++ tools/clang-format/ClangFormat.cpp
@@ -22,6 +22,7 @@
#include "clang/Rewrite/Core/Rewriter.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
using namespace llvm;
@@ -339,11 +340,19 @@
int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
+ SmallVector<const char *, 256> Args;
+ llvm::SpecificBumpPtrAllocator<char> ArgAllocator;
+ std::error_code EC = llvm::sys::Process::GetArgumentVector(
+ Args, llvm::makeArrayRef(argv, argc), ArgAllocator);
+ if (EC) {
+ llvm::errs() << "error: couldn'g get arguments: " << EC.message() << '\n';
+ }
+
cl::HideUnrelatedOptions(ClangFormatCategory);
cl::SetVersionPrinter(PrintVersion);
cl::ParseCommandLineOptions(
- argc, argv,
+ Args.size(), &Args[0],
"A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.\n\n"
"If no arguments are specified, it formats the code from standard input\n"
"and writes the result to the standard output.\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44778.139593.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180323/b4ec5ea3/attachment-0001.bin>
More information about the cfe-commits
mailing list