Lines Matching +full:sys +full:- +full:mgr

1 //===- lib/MC/MCContext.cpp - Machine Code Context ------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
69 const SourceMgr *mgr, MCTargetOptions const *TargetOpts, in MCContext() argument
72 SrcMgr(mgr), InlineSrcMgr(nullptr), DiagHandler(defaultDiagHandler), in MCContext()
77 SaveTempLabels = TargetOptions && TargetOptions->MCSaveTempLabels; in MCContext()
78 SecureLogFile = TargetOptions ? TargetOptions->AsSecureLogFile : ""; in MCContext()
80 if (SrcMgr && SrcMgr->getNumBuffers()) in MCContext()
81 MainFileName = std::string(SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID()) in MCContext()
82 ->getBufferIdentifier()); in MCContext()
91 "Cannot initialize MC for non-Windows COFF object files."); in MCContext()
132 //===----------------------------------------------------------------------===//
134 //===----------------------------------------------------------------------===//
191 //===----------------------------------------------------------------------===//
193 //===----------------------------------------------------------------------===//
201 assert(!Sec.curFragList()->Head); in allocInitialFragment()
203 F->setParent(&Sec); in allocInitialFragment()
204 Sec.curFragList()->Head = F; in allocInitialFragment()
205 Sec.curFragList()->Tail = F; in allocInitialFragment()
209 //===----------------------------------------------------------------------===//
211 //===----------------------------------------------------------------------===//
221 bool IsRenamable = NameRef.starts_with(MAI->getPrivateGlobalPrefix()); in getOrCreateSymbol()
227 assert(IsRenamable && "cannot rename non-private symbol"); in getOrCreateSymbol()
238 return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + FuncName + in getOrCreateFrameAllocSymbol()
243 return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + FuncName + in getOrCreateParentFrameOffsetSymbol()
248 return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + "__ehtable$" + in getOrCreateLSDASymbol()
301 while (AlwaysAddSuffix || EntryPtr->second.Used) { in createRenamableSymbol()
309 EntryPtr->second.Used = true; in createRenamableSymbol()
316 return createRenamableSymbol(MAI->getPrivateGlobalPrefix() + Name, in createTempSymbol()
321 return createRenamableSymbol(MAI->getPrivateGlobalPrefix() + Name, true, in createNamedTempSymbol()
327 return getOrCreateSymbol(MAI->getPrivateLabelPrefix() + Name); in createBlockSymbol()
332 return createRenamableSymbol(MAI->getPrivateLabelPrefix() + Name, in createBlockSymbol()
341 return createRenamableSymbol(MAI->getLinkerPrivateGlobalPrefix() + Name, in createLinkerPrivateSymbol()
361 return Label->incInstance(); in NextInstance()
368 return Label->getInstance(); in GetInstance()
399 if (Sym && Sym->isDefined() && in getOrCreateSectionSymbol()
400 (!Sym->isInSection() || Sym->getSection().getBeginSymbol() != Sym)) in getOrCreateSectionSymbol()
402 if (Sym && Sym->isUndefined()) { in getOrCreateSectionSymbol()
426 InlineAsmUsedLabelNames[Sym->getName()] = Sym; in registerInlineAsmLabel()
438 StringRef OriginalName = Name->first(); in createXCOFFSymbolImpl()
443 if (MAI->isValidUnquotedName(OriginalName)) in createXCOFFSymbolImpl()
461 if (!MAI->isAcceptableChar(InvalidName[I]) || InvalidName[I] == '_') { in createXCOFFSymbolImpl()
470 ValidName.append(InvalidName.substr(1, InvalidName.size() - 1)); in createXCOFFSymbolImpl()
481 XSym->setSymbolTableName(MCSymbolXCOFF::getUnqualifiedName(OriginalName)); in createXCOFFSymbolImpl()
485 //===----------------------------------------------------------------------===//
487 //===----------------------------------------------------------------------===//
505 return R.first->second; in getMachOSection()
512 StringRef Name = R.first->first(); in getMachOSection()
514 MCSectionMachO(Segment, Name.substr(Name.size() - Section.size()), in getMachOSection()
516 R.first->second = Ret; in getMachOSection()
528 R->setBinding(ELF::STB_LOCAL); in createELFSectionImpl()
529 R->setType(ELF::STT_SECTION); in createELFSectionImpl()
535 R->setFragment(F); in createELFSectionImpl()
548 I->getKey(), Type, Flags, EntrySize, Group, true, true, in createELFRelSection()
549 cast<MCSymbolELF>(RelInfoSection->getBeginSymbol())); in createELFRelSection()
580 Group = GroupSym->getName(); in getELFSection()
581 assert(!(LinkedToSym && LinkedToSym->getName().empty())); in getELFSection()
585 // combined into one section. As an optimization, non-unique sections without in getELFSection()
586 // group or linked-to symbol have a shorter unique-ing key. in getELFSection()
596 Buffer.append(GroupSym->getName()); in getELFSection()
599 Buffer.append(LinkedToSym->getName()); in getELFSection()
615 return EntryNewPair.first->second; in getELFSection()
617 StringRef CachedName = EntryNewPair.first->getKey().take_front(SectionLen); in getELFSection()
622 EntryNewPair.first->second = Result; in getELFSection()
624 recordELFMergeableSectionInfo(Result->getName(), Result->getFlags(), in getELFSection()
625 Result->getUniqueID(), Result->getEntrySize()); in getELFSection()
647 // For mergeable sections or non-mergeable sections with a generic mergeable in recordELFMergeableSectionInfo()
671 return (I != ELFEntrySizeMap.end()) ? std::optional<unsigned>(I->second) in getELFUniqueIDForEntsize()
683 return Iter->second; in getGOFFSection()
685 StringRef CachedName = Iter->first; in getGOFFSection()
688 Iter->second = GOFFSection; in getGOFFSection()
700 COMDATSymName = COMDATSymbol->getName(); in getCOFFSection()
701 // A non-associative COMDAT is considered to define the COMDAT symbol. Check in getCOFFSection()
704 COMDATSymbol->isDefined() && in getCOFFSection()
705 (!COMDATSymbol->isInSection() || in getCOFFSection()
706 cast<MCSectionCOFF>(COMDATSymbol->getSection()).getCOMDATSymbol() != in getCOFFSection()
716 return Iter->second; in getCOFFSection()
718 StringRef CachedName = Iter->first.SectionName; in getCOFFSection()
722 Iter->second = Result; in getCOFFSection()
724 Begin->setFragment(F); in getCOFFSection()
742 unsigned Characteristics = Sec->getCharacteristics(); in getAssociativeCOFFSection()
745 return getCOFFSection(Sec->getName(), Characteristics, KeySym->getName(), in getAssociativeCOFFSection()
749 return getCOFFSection(Sec->getName(), Characteristics, "", 0, UniqueID); in getAssociativeCOFFSection()
758 GroupSym->setComdat(true); in getWasmSection()
770 Group = GroupSym->getName(); in getWasmSection()
782 getSymbolTableEntry(Begin->getName()).second.Symbol = Begin; in getWasmSection()
783 cast<MCSymbolWasm>(Begin)->setType(wasm::WASM_SYMBOL_TYPE_SECTION); in getWasmSection()
790 Begin->setFragment(F); in getWasmSection()
810 : XCOFFSectionKey(Section.str(), CsectProp->MappingClass), in getXCOFFSection()
815 if (ExistedEntry->isMultiSymbolsAllowed() != MultiSymbolsAllowed) in getXCOFFSection()
830 XCOFF::getMappingClassString(CsectProp->MappingClass) + "]")); in getXCOFFSection()
832 // QualName->getUnqualifiedName() and CachedName are the same except when in getXCOFFSection()
837 QualName->getUnqualifiedName(), Kind, QualName, in getXCOFFSection()
841 MCSectionXCOFF(QualName->getUnqualifiedName(), CsectProp->MappingClass, in getXCOFFSection()
842 CsectProp->Type, Kind, QualName, nullptr, CachedName, in getXCOFFSection()
854 if (IsDwarfSec || CsectProp->MappingClass == XCOFF::XMC_PR) in getXCOFFSection()
855 QualName->setFragment(F); in getXCOFFSection()
872 return ItInsertedPair.first->second; in getDXContainerSection()
878 StringRef Name = MapIt->first(); in getDXContainerSection()
879 MapIt->second = in getDXContainerSection()
883 allocInitialFragment(*MapIt->second); in getDXContainerSection()
884 return MapIt->second; in getDXContainerSection()
898 if (llvm::sys::path::replace_path_prefix(Path, From, To)) in remapDebugPath()
903 const auto &DebugPrefixMap = this->DebugPrefixMap; in RemapDebugPaths()
927 //===----------------------------------------------------------------------===//
929 //===----------------------------------------------------------------------===//
934 return TargetOptions->EmitDwarfUnwind; in emitDwarfUnwindInfo()
939 return TargetOptions->EmitCompactUnwindNonCanonical; in emitCompactUnwindNonCanonical()
959 // Or, MainFileName might have been overridden by a -main-file-name option, in setGenDwarfRootFile()
964 if (FileNameBuf.empty() || FileNameBuf == "-") in setGenDwarfRootFile()
967 llvm::sys::path::remove_filename(FileNameBuf); in setGenDwarfRootFile()
968 llvm::sys::path::append(FileNameBuf, getMainFileName()); in setGenDwarfRootFile()
972 if (llvm::sys::path::is_separator(FileName.front())) in setGenDwarfRootFile()
979 /// getDwarfFile - takes a file name and number to place in the dwarf file and
993 /// isValidDwarfFileNumber - takes a dwarf file number and returns true if it
1018 //===----------------------------------------------------------------------===//
1020 //===----------------------------------------------------------------------===//
1049 // For MC-only execution, only SrcMgr is used; in reportCommon()
1050 // For non MC-only execution, InlineSrcMgr is only ctor'd if there is in reportCommon()
1070 D = SMP->GetMessage(Loc, SourceMgr::DK_Error, Msg); in reportError()
1075 if (TargetOptions && TargetOptions->MCNoWarn) in reportWarning()
1077 if (TargetOptions && TargetOptions->MCFatalWarnings) { in reportWarning()
1081 D = SMP->GetMessage(Loc, SourceMgr::DK_Warning, Msg); in reportWarning()