[PATCH] D44778: [clang-format] Wildcard expansion on Windows.
Alexander Kornienko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 26 06:59:41 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rC328495: [clang-format] Wildcard expansion on Windows. (authored by alexfh, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D44778?vs=139593&id=139784#toc
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't 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.139784.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180326/fe0ae45c/attachment-0001.bin>
More information about the cfe-commits
mailing list