@@ -1945,7 +1945,7 @@ static void ProcessMachO(StringRef Name, MachOObjectFile *MachOOF,
1945
1945
// the error message.
1946
1946
if (Disassemble || IndirectSymbols || !FilterSections.empty() || UnwindInfo)
1947
1947
if (Error Err = MachOOF->checkSymbolTable())
1948
- reportError(std::move(Err), ArchiveName, FileName , ArchitectureName);
1948
+ reportError(std::move(Err), FileName, ArchiveName , ArchitectureName);
1949
1949
1950
1950
if (DisassembleAll) {
1951
1951
for (const SectionRef &Section : MachOOF->sections()) {
@@ -2219,9 +2219,8 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
2219
2219
if (print_offset)
2220
2220
outs() << C.getChildOffset() << "\t";
2221
2221
sys::fs::perms Mode =
2222
- unwrapOrError(C.getAccessMode(), Filename,
2223
- getFileNameForError(C, ChildIndex),
2224
- ArchitectureName);
2222
+ unwrapOrError(C.getAccessMode(), getFileNameForError(C, ChildIndex),
2223
+ Filename, ArchitectureName);
2225
2224
if (verbose) {
2226
2225
// FIXME: this first dash, "-", is for (Mode & S_IFMT) == S_IFREG.
2227
2226
// But there is nothing in sys::fs::perms for S_IFMT or S_IFREG.
@@ -2239,14 +2238,14 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
2239
2238
outs() << format("0%o ", Mode);
2240
2239
}
2241
2240
2242
- outs() << format(
2243
- "%3d/%-3d %5" PRId64 " " ,
2244
- unwrapOrError(C.getUID(), Filename, getFileNameForError(C, ChildIndex ),
2245
- ArchitectureName ),
2246
- unwrapOrError(C.getGID(), Filename, getFileNameForError(C, ChildIndex ),
2247
- ArchitectureName ),
2248
- unwrapOrError(C.getRawSize( ), Filename,
2249
- getFileNameForError(C, ChildIndex), ArchitectureName));
2241
+ outs() << format("%3d/%-3d %5" PRId64 " ",
2242
+ unwrapOrError(C.getUID(), getFileNameForError(C, ChildIndex) ,
2243
+ Filename, ArchitectureName ),
2244
+ unwrapOrError(C.getGID(), getFileNameForError(C, ChildIndex ),
2245
+ Filename, ArchitectureName ),
2246
+ unwrapOrError(C.getRawSize( ),
2247
+ getFileNameForError(C, ChildIndex ), Filename,
2248
+ ArchitectureName));
2250
2249
2251
2250
StringRef RawLastModified = C.getRawLastModified();
2252
2251
if (verbose) {
@@ -2269,18 +2268,17 @@ static void printArchiveChild(StringRef Filename, const Archive::Child &C,
2269
2268
Expected<StringRef> NameOrErr = C.getName();
2270
2269
if (!NameOrErr) {
2271
2270
consumeError(NameOrErr.takeError());
2272
- outs() << unwrapOrError(C.getRawName(), Filename,
2273
- getFileNameForError(C, ChildIndex),
2271
+ outs() << unwrapOrError(C.getRawName(),
2272
+ getFileNameForError(C, ChildIndex), Filename,
2274
2273
ArchitectureName)
2275
2274
<< "\n";
2276
2275
} else {
2277
2276
StringRef Name = NameOrErr.get();
2278
2277
outs() << Name << "\n";
2279
2278
}
2280
2279
} else {
2281
- outs() << unwrapOrError(C.getRawName(), Filename,
2282
- getFileNameForError(C, ChildIndex),
2283
- ArchitectureName)
2280
+ outs() << unwrapOrError(C.getRawName(), getFileNameForError(C, ChildIndex),
2281
+ Filename, ArchitectureName)
2284
2282
<< "\n";
2285
2283
}
2286
2284
}
@@ -2295,7 +2293,7 @@ static void printArchiveHeaders(StringRef Filename, Archive *A, bool verbose,
2295
2293
ArchitectureName);
2296
2294
2297
2295
if (Err)
2298
- reportError(std::move(Err), StringRef(), Filename , ArchitectureName);
2296
+ reportError(std::move(Err), Filename, "" , ArchitectureName);
2299
2297
}
2300
2298
2301
2299
static bool ValidateArchFlags() {
@@ -2346,7 +2344,7 @@ void parseInputMachO(StringRef Filename) {
2346
2344
Expected<std::unique_ptr<Binary>> ChildOrErr = C.getAsBinary();
2347
2345
if (!ChildOrErr) {
2348
2346
if (Error E = isNotObjectErrorInvalidFileType(ChildOrErr.takeError()))
2349
- reportError(std::move(E), Filename, getFileNameForError(C, I));
2347
+ reportError(std::move(E), getFileNameForError(C, I), Filename );
2350
2348
continue;
2351
2349
}
2352
2350
if (MachOObjectFile *O = dyn_cast<MachOObjectFile>(&*ChildOrErr.get())) {
@@ -2408,7 +2406,7 @@ void parseInputMachO(MachOUniversalBinary *UB) {
2408
2406
ProcessMachO(Filename, MachOOF, "", ArchitectureName);
2409
2407
} else if (Error E = isNotObjectErrorInvalidFileType(
2410
2408
ObjOrErr.takeError())) {
2411
- reportError(std::move(E), Filename, StringRef() , ArchitectureName);
2409
+ reportError(std::move(E), "", Filename , ArchitectureName);
2412
2410
continue;
2413
2411
} else if (Expected<std::unique_ptr<Archive>> AOrErr =
2414
2412
I->getAsArchive()) {
@@ -2428,7 +2426,7 @@ void parseInputMachO(MachOUniversalBinary *UB) {
2428
2426
if (!ChildOrErr) {
2429
2427
if (Error E =
2430
2428
isNotObjectErrorInvalidFileType(ChildOrErr.takeError()))
2431
- reportError(std::move(E), Filename, getFileNameForError(C, I),
2429
+ reportError(std::move(E), getFileNameForError(C, I), Filename ,
2432
2430
ArchitectureName);
2433
2431
continue;
2434
2432
}
@@ -2489,7 +2487,7 @@ void parseInputMachO(MachOUniversalBinary *UB) {
2489
2487
if (!ChildOrErr) {
2490
2488
if (Error E =
2491
2489
isNotObjectErrorInvalidFileType(ChildOrErr.takeError()))
2492
- reportError(std::move(E), Filename, getFileNameForError(C, I));
2490
+ reportError(std::move(E), getFileNameForError(C, I), Filename );
2493
2491
continue;
2494
2492
}
2495
2493
if (MachOObjectFile *O =
@@ -2524,7 +2522,7 @@ void parseInputMachO(MachOUniversalBinary *UB) {
2524
2522
ProcessMachO(Filename, MachOOF, "", ArchitectureName);
2525
2523
} else if (Error E =
2526
2524
isNotObjectErrorInvalidFileType(ObjOrErr.takeError())) {
2527
- reportError(std::move(E), StringRef(), Filename , ArchitectureName);
2525
+ reportError(std::move(E), Filename, "" , ArchitectureName);
2528
2526
} else if (Expected<std::unique_ptr<Archive>> AOrErr = I->getAsArchive()) {
2529
2527
std::unique_ptr<Archive> &A = *AOrErr;
2530
2528
outs() << "Archive : " << Filename;
@@ -2541,7 +2539,7 @@ void parseInputMachO(MachOUniversalBinary *UB) {
2541
2539
Expected<std::unique_ptr<Binary>> ChildOrErr = C.getAsBinary();
2542
2540
if (!ChildOrErr) {
2543
2541
if (Error E = isNotObjectErrorInvalidFileType(ChildOrErr.takeError()))
2544
- reportError(std::move(E), Filename, getFileNameForError(C, I),
2542
+ reportError(std::move(E), getFileNameForError(C, I), Filename ,
2545
2543
ArchitectureName);
2546
2544
continue;
2547
2545
}
0 commit comments