Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/MC/MCContext.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai, | MCContext::MCContext(const Triple &TheTriple, const MCAsmInfo *mai, | ||||
const MCRegisterInfo *mri, const MCSubtargetInfo *msti, | const MCRegisterInfo *mri, const MCSubtargetInfo *msti, | ||||
const SourceMgr *mgr, MCTargetOptions const *TargetOpts, | const SourceMgr *mgr, MCTargetOptions const *TargetOpts, | ||||
bool DoAutoReset, StringRef Swift5ReflSegmentName) | bool DoAutoReset, StringRef Swift5ReflSegmentName) | ||||
: Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple), | : Swift5ReflectionSegmentName(Swift5ReflSegmentName), TT(TheTriple), | ||||
SrcMgr(mgr), InlineSrcMgr(nullptr), DiagHandler(defaultDiagHandler), | SrcMgr(mgr), InlineSrcMgr(nullptr), DiagHandler(defaultDiagHandler), | ||||
MAI(mai), MRI(mri), MSTI(msti), Symbols(Allocator), UsedNames(Allocator), | MAI(mai), MRI(mri), MSTI(msti), Symbols(Allocator), UsedNames(Allocator), | ||||
InlineAsmUsedLabelNames(Allocator), | |||||
CurrentDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0), | CurrentDwarfLoc(0, 0, 0, DWARF2_FLAG_IS_STMT, 0, 0), | ||||
AutoReset(DoAutoReset), TargetOptions(TargetOpts) { | AutoReset(DoAutoReset), TargetOptions(TargetOpts) { | ||||
SecureLogFile = AsSecureLogFileName; | SecureLogFile = AsSecureLogFileName; | ||||
if (SrcMgr && SrcMgr->getNumBuffers()) | if (SrcMgr && SrcMgr->getNumBuffers()) | ||||
MainFileName = std::string(SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID()) | MainFileName = std::string(SrcMgr->getMemoryBuffer(SrcMgr->getMainFileID()) | ||||
->getBufferIdentifier()); | ->getBufferIdentifier()); | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | void MCContext::reset() { | ||||
GOFFAllocator.DestroyAll(); | GOFFAllocator.DestroyAll(); | ||||
MachOAllocator.DestroyAll(); | MachOAllocator.DestroyAll(); | ||||
WasmAllocator.DestroyAll(); | WasmAllocator.DestroyAll(); | ||||
XCOFFAllocator.DestroyAll(); | XCOFFAllocator.DestroyAll(); | ||||
MCInstAllocator.DestroyAll(); | MCInstAllocator.DestroyAll(); | ||||
SPIRVAllocator.DestroyAll(); | SPIRVAllocator.DestroyAll(); | ||||
MCSubtargetAllocator.DestroyAll(); | MCSubtargetAllocator.DestroyAll(); | ||||
InlineAsmUsedLabelNames.clear(); | |||||
UsedNames.clear(); | UsedNames.clear(); | ||||
Symbols.clear(); | Symbols.clear(); | ||||
Allocator.Reset(); | Allocator.Reset(); | ||||
Instances.clear(); | Instances.clear(); | ||||
CompilationDir.clear(); | CompilationDir.clear(); | ||||
MainFileName.clear(); | MainFileName.clear(); | ||||
MCDwarfLineTablesCUMap.clear(); | MCDwarfLineTablesCUMap.clear(); | ||||
SectionsForRanges.clear(); | SectionsForRanges.clear(); | ||||
▲ Show 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | |||||
void MCContext::setSymbolValue(MCStreamer &Streamer, | void MCContext::setSymbolValue(MCStreamer &Streamer, | ||||
StringRef Sym, | StringRef Sym, | ||||
uint64_t Val) { | uint64_t Val) { | ||||
auto Symbol = getOrCreateSymbol(Sym); | auto Symbol = getOrCreateSymbol(Sym); | ||||
Streamer.emitAssignment(Symbol, MCConstantExpr::create(Val, *this)); | Streamer.emitAssignment(Symbol, MCConstantExpr::create(Val, *this)); | ||||
} | } | ||||
void MCContext::registerInlineAsmLabel(MCSymbol *Sym) { | |||||
InlineAsmUsedLabelNames[Sym->getName()] = Sym; | |||||
} | |||||
MCSymbolXCOFF * | MCSymbolXCOFF * | ||||
MCContext::createXCOFFSymbolImpl(const StringMapEntry<bool> *Name, | MCContext::createXCOFFSymbolImpl(const StringMapEntry<bool> *Name, | ||||
bool IsTemporary) { | bool IsTemporary) { | ||||
if (!Name) | if (!Name) | ||||
return new (nullptr, *this) MCSymbolXCOFF(nullptr, IsTemporary); | return new (nullptr, *this) MCSymbolXCOFF(nullptr, IsTemporary); | ||||
StringRef OriginalName = Name->first(); | StringRef OriginalName = Name->first(); | ||||
if (OriginalName.startswith("._Renamed..") || | if (OriginalName.startswith("._Renamed..") || | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |