@@ -2099,7 +2099,7 @@ ArrayRef<uint8_t> getSegmentContents(const MachOObjectFile &Obj,
2099
2099
}
2100
2100
auto &Segment = SegmentOrErr.get ();
2101
2101
return arrayRefFromStringRef (
2102
- Obj.getData ().slice (Segment.fileoff , Segment. fileoff + Segment.filesize ));
2102
+ Obj.getData ().substr (Segment.fileoff , Segment.filesize ));
2103
2103
}
2104
2104
} // namespace
2105
2105
@@ -2454,9 +2454,8 @@ StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2454
2454
Idx = 0 ;
2455
2455
else
2456
2456
Idx = b+1 ;
2457
- F = Name.slice (Idx, Idx + Foo.size ());
2458
- DotFramework = Name.slice (Idx + Foo.size (),
2459
- Idx + Foo.size () + sizeof (" .framework/" )-1 );
2457
+ F = Name.substr (Idx, Foo.size ());
2458
+ DotFramework = Name.substr (Idx + Foo.size (), sizeof (" .framework/" ) - 1 );
2460
2459
if (F == Foo && DotFramework == " .framework/" ) {
2461
2460
isFramework = true ;
2462
2461
return Foo;
@@ -2476,9 +2475,8 @@ StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2476
2475
Idx = 0 ;
2477
2476
else
2478
2477
Idx = d+1 ;
2479
- F = Name.slice (Idx, Idx + Foo.size ());
2480
- DotFramework = Name.slice (Idx + Foo.size (),
2481
- Idx + Foo.size () + sizeof (" .framework/" )-1 );
2478
+ F = Name.substr (Idx, Foo.size ());
2479
+ DotFramework = Name.substr (Idx + Foo.size (), sizeof (" .framework/" ) - 1 );
2482
2480
if (F == Foo && DotFramework == " .framework/" ) {
2483
2481
isFramework = true ;
2484
2482
return Foo;
@@ -2495,7 +2493,7 @@ StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2495
2493
2496
2494
// First pull off the version letter for the form Foo.A.dylib if any.
2497
2495
if (a >= 3 ) {
2498
- Dot = Name.slice (a- 2 , a- 1 );
2496
+ Dot = Name.substr (a - 2 , 1 );
2499
2497
if (Dot == " ." )
2500
2498
a = a - 2 ;
2501
2499
}
@@ -2520,7 +2518,7 @@ StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2520
2518
// There are incorrect library names of the form:
2521
2519
// libATS.A_profile.dylib so check for these.
2522
2520
if (Lib.size () >= 3 ) {
2523
- Dot = Lib.slice (Lib.size ()- 2 , Lib. size ()- 1 );
2521
+ Dot = Lib.substr (Lib.size () - 2 , 1 );
2524
2522
if (Dot == " ." )
2525
2523
Lib = Lib.slice (0 , Lib.size ()-2 );
2526
2524
}
@@ -2537,7 +2535,7 @@ StringRef MachOObjectFile::guessLibraryShortName(StringRef Name,
2537
2535
Lib = Name.slice (b+1 , a);
2538
2536
// There are library names of the form: QT.A.qtx so check for these.
2539
2537
if (Lib.size () >= 3 ) {
2540
- Dot = Lib.slice (Lib.size ()- 2 , Lib. size ()- 1 );
2538
+ Dot = Lib.substr (Lib.size () - 2 , 1 );
2541
2539
if (Dot == " ." )
2542
2540
Lib = Lib.slice (0 , Lib.size ()-2 );
2543
2541
}
0 commit comments