@@ -263,7 +263,7 @@ static std::vector<ArchiveMember> getArchiveMembers(MemoryBufferRef mb) {
263
263
264
264
static InputFile *addFile (StringRef path, bool forceLoadArchive,
265
265
bool isBundleLoader = false ) {
266
- Optional<MemoryBufferRef> buffer = readLinkableFile (path);
266
+ Optional<MemoryBufferRef> buffer = readFile (path);
267
267
if (!buffer)
268
268
return nullptr ;
269
269
MemoryBufferRef mbref = *buffer;
@@ -279,7 +279,7 @@ static InputFile *addFile(StringRef path, bool forceLoadArchive,
279
279
error (path + " : archive has no index; run ranlib to add one" );
280
280
281
281
if (config->allLoad || forceLoadArchive) {
282
- if (Optional<MemoryBufferRef> buffer = readLinkableFile (path)) {
282
+ if (Optional<MemoryBufferRef> buffer = readFile (path)) {
283
283
for (const ArchiveMember &member : getArchiveMembers (*buffer)) {
284
284
if (Optional<InputFile *> file = loadArchiveMember (
285
285
member.mbref , member.modTime , path, /* objCOnly=*/ false )) {
@@ -300,7 +300,7 @@ static InputFile *addFile(StringRef path, bool forceLoadArchive,
300
300
// we already found that it contains an ObjC symbol. We should also
301
301
// consider creating a LazyObjFile class in order to avoid double-loading
302
302
// these files here and below (as part of the ArchiveFile).
303
- if (Optional<MemoryBufferRef> buffer = readLinkableFile (path)) {
303
+ if (Optional<MemoryBufferRef> buffer = readFile (path)) {
304
304
for (const ArchiveMember &member : getArchiveMembers (*buffer)) {
305
305
if (Optional<InputFile *> file = loadArchiveMember (
306
306
member.mbref , member.modTime , path, /* objCOnly=*/ true )) {
@@ -403,7 +403,7 @@ void macho::parseLCLinkerOption(InputFile* f, unsigned argc, StringRef data) {
403
403
}
404
404
405
405
static void addFileList (StringRef path) {
406
- Optional<MemoryBufferRef> buffer = readRawFile (path);
406
+ Optional<MemoryBufferRef> buffer = readFile (path);
407
407
if (!buffer)
408
408
return ;
409
409
MemoryBufferRef mbref = *buffer;
@@ -426,7 +426,7 @@ static void addFileList(StringRef path) {
426
426
//
427
427
// The file can also have line comments that start with '#'.
428
428
static void parseOrderFile (StringRef path) {
429
- Optional<MemoryBufferRef> buffer = readRawFile (path);
429
+ Optional<MemoryBufferRef> buffer = readFile (path);
430
430
if (!buffer) {
431
431
error (" Could not read order file at " + path);
432
432
return ;
@@ -940,7 +940,7 @@ bool macho::link(ArrayRef<const char *> argsArr, bool canExitEarly,
940
940
StringRef segName = arg->getValue (0 );
941
941
StringRef sectName = arg->getValue (1 );
942
942
StringRef fileName = arg->getValue (2 );
943
- Optional<MemoryBufferRef> buffer = readRawFile (fileName);
943
+ Optional<MemoryBufferRef> buffer = readFile (fileName);
944
944
if (buffer)
945
945
inputFiles.insert (make<OpaqueFile>(*buffer, segName, sectName));
946
946
}
0 commit comments