Lines Matching defs:mb
74 static ELFKind getELFKind(Ctx &ctx, MemoryBufferRef mb, StringRef archiveName) {
77 std::tie(size, endian) = getElfArchType(mb.getBuffer());
80 StringRef filename = mb.getBufferIdentifier();
87 if (!mb.getBuffer().starts_with(ElfMagic))
94 size_t bufSize = mb.getBuffer().size();
211 : ctx(ctx), mb(m), groupId(ctx.driver.nextGroupId), fileKind(k) {
468 ELFFileBase::ELFFileBase(Ctx &ctx, Kind k, ELFKind ekind, MemoryBufferRef mb)
469 : InputFile(ctx, k, mb) {
1303 static bool isBitcodeNonCommonDef(MemoryBufferRef mb, StringRef symName,
1305 IRSymtabFile symtabFile = check(readIRSymtab(mb));
1315 static bool isNonCommonDef(Ctx &ctx, ELFKind ekind, MemoryBufferRef mb,
1317 ObjFile<ELFT> *obj = make<ObjFile<ELFT>>(ctx, ekind, mb, archiveName);
1330 static bool isNonCommonDef(Ctx &ctx, MemoryBufferRef mb, StringRef symName,
1332 switch (getELFKind(ctx, mb, archiveName)) {
1334 return isNonCommonDef<ELF32LE>(ctx, ELF32LEKind, mb, symName, archiveName);
1336 return isNonCommonDef<ELF32BE>(ctx, ELF32BEKind, mb, symName, archiveName);
1338 return isNonCommonDef<ELF64LE>(ctx, ELF64LEKind, mb, symName, archiveName);
1340 return isNonCommonDef<ELF64BE>(ctx, ELF64BEKind, mb, symName, archiveName);
1698 BitcodeFile::BitcodeFile(Ctx &ctx, MemoryBufferRef mb, StringRef archiveName,
1700 : InputFile(ctx, BitcodeKind, mb) {
1704 std::string path = mb.getBufferIdentifier().str();
1706 path = replaceThinLTOSuffix(ctx, mb.getBufferIdentifier());
1719 MemoryBufferRef mbref(mb.getBuffer(), name);
1725 emachine = getBitcodeMachineKind(ctx, mb.getBufferIdentifier(), t);
1838 ArrayRef<uint8_t> data = arrayRefFromStringRef(mb.getBuffer());
1848 std::string s = "_binary_" + mb.getBufferIdentifier().str();
1874 std::unique_ptr<ELFFileBase> elf::createObjFile(Ctx &ctx, MemoryBufferRef mb,
1878 switch (getELFKind(ctx, mb, archiveName)) {
1880 f = std::make_unique<ObjFile<ELF32LE>>(ctx, ELF32LEKind, mb, archiveName);
1883 f = std::make_unique<ObjFile<ELF32BE>>(ctx, ELF32BEKind, mb, archiveName);
1886 f = std::make_unique<ObjFile<ELF64LE>>(ctx, ELF64LEKind, mb, archiveName);
1889 f = std::make_unique<ObjFile<ELF64BE>>(ctx, ELF64BEKind, mb, archiveName);
1920 return isBitcodeNonCommonDef(mb, name, archiveName);
1922 return isNonCommonDef(ctx, mb, name, archiveName);