mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-24 04:32:09 +00:00
On Windows expansion of regex file name patterns is the responsibility of each
tool. Fix ar to do that. Differential Revision: https://reviews.llvm.org/D43987 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
17efee5afa
commit
bf9c7d5f95
7
test/tools/llvm-ar/regex-cmd.test
Normal file
7
test/tools/llvm-ar/regex-cmd.test
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
RUN: yaml2obj %S/Inputs/elf.yaml -o %t.o
|
||||||
|
|
||||||
|
RUN: rm -f %t.ar
|
||||||
|
RUN: llvm-ar crs %t.ar %t.*
|
||||||
|
RUN: llvm-ar tv %t.ar | FileCheck %s
|
||||||
|
|
||||||
|
CHECK: regex-cmd.test{{.*}}.o
|
@ -31,6 +31,7 @@
|
|||||||
#include "llvm/Support/MemoryBuffer.h"
|
#include "llvm/Support/MemoryBuffer.h"
|
||||||
#include "llvm/Support/Path.h"
|
#include "llvm/Support/Path.h"
|
||||||
#include "llvm/Support/PrettyStackTrace.h"
|
#include "llvm/Support/PrettyStackTrace.h"
|
||||||
|
#include "llvm/Support/Process.h"
|
||||||
#include "llvm/Support/Signals.h"
|
#include "llvm/Support/Signals.h"
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Support/ToolOutputFile.h"
|
#include "llvm/Support/ToolOutputFile.h"
|
||||||
@ -869,7 +870,12 @@ int main(int argc, char **argv) {
|
|||||||
Stem.find("lib") != StringRef::npos)
|
Stem.find("lib") != StringRef::npos)
|
||||||
return libDriverMain(makeArrayRef(argv, argc));
|
return libDriverMain(makeArrayRef(argv, argc));
|
||||||
|
|
||||||
for (int i = 1; i < argc; i++) {
|
SmallVector<const char *, 256> Argv;
|
||||||
|
SpecificBumpPtrAllocator<char> ArgAllocator;
|
||||||
|
failIfError(errorCodeToError(sys::Process::GetArgumentVector(
|
||||||
|
Argv, makeArrayRef(argv, argc), ArgAllocator)));
|
||||||
|
|
||||||
|
for (unsigned i = 1; i < Argv.size(); i++) {
|
||||||
// If an argument starts with a dash and only contains chars
|
// If an argument starts with a dash and only contains chars
|
||||||
// that belong to the options chars set, remove the dash.
|
// that belong to the options chars set, remove the dash.
|
||||||
// We can't handle it after the command line options parsing
|
// We can't handle it after the command line options parsing
|
||||||
@ -877,10 +883,10 @@ int main(int argc, char **argv) {
|
|||||||
// starting with a dash.
|
// starting with a dash.
|
||||||
// Make sure this doesn't match the actual llvm-ar specific options
|
// Make sure this doesn't match the actual llvm-ar specific options
|
||||||
// that start with a dash.
|
// that start with a dash.
|
||||||
StringRef S = argv[i];
|
StringRef S = Argv[i];
|
||||||
if (S.startswith("-") &&
|
if (S.startswith("-") &&
|
||||||
S.find_first_not_of(OptionChars, 1) == StringRef::npos) {
|
S.find_first_not_of(OptionChars, 1) == StringRef::npos) {
|
||||||
argv[i]++;
|
Argv[i]++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (S == "--")
|
if (S == "--")
|
||||||
@ -889,7 +895,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
// Have the command line options parsed and handle things
|
// Have the command line options parsed and handle things
|
||||||
// like --help and --version.
|
// like --help and --version.
|
||||||
cl::ParseCommandLineOptions(argc, argv,
|
cl::ParseCommandLineOptions(Argv.size(), Argv.data(),
|
||||||
"LLVM Archiver (llvm-ar)\n\n"
|
"LLVM Archiver (llvm-ar)\n\n"
|
||||||
" This program archives bitcode files into single libraries\n"
|
" This program archives bitcode files into single libraries\n"
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user