MC: Clean up method names in MCContext.

The naming was a mish-mash of old and new style. Update to be consistent
with the new. NFC.

llvm-svn: 237594
This commit is contained in:
Jim Grosbach 2015-05-18 18:43:14 +00:00
parent f8a0db50b2
commit 6f482000e9
76 changed files with 297 additions and 296 deletions

View File

@ -241,27 +241,27 @@ namespace llvm {
/// Create and return a new linker temporary symbol with a unique but /// Create and return a new linker temporary symbol with a unique but
/// unspecified name. /// unspecified name.
MCSymbol *CreateLinkerPrivateTempSymbol(); MCSymbol *createLinkerPrivateTempSymbol();
/// Create and return a new assembler temporary symbol with a unique but /// Create and return a new assembler temporary symbol with a unique but
/// unspecified name. /// unspecified name.
MCSymbol *CreateTempSymbol(); MCSymbol *createTempSymbol();
MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix); MCSymbol *createTempSymbol(const Twine &Name, bool AlwaysAddSuffix);
/// Create the definition of a directional local symbol for numbered label /// Create the definition of a directional local symbol for numbered label
/// (used for "1:" definitions). /// (used for "1:" definitions).
MCSymbol *CreateDirectionalLocalSymbol(unsigned LocalLabelVal); MCSymbol *createDirectionalLocalSymbol(unsigned LocalLabelVal);
/// Create and return a directional local symbol for numbered label (used /// Create and return a directional local symbol for numbered label (used
/// for "1b" or 1f" references). /// for "1b" or 1f" references).
MCSymbol *GetDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before); MCSymbol *getDirectionalLocalSymbol(unsigned LocalLabelVal, bool Before);
/// Lookup the symbol inside with the specified \p Name. If it exists, /// Lookup the symbol inside with the specified \p Name. If it exists,
/// return it. If not, create a forward reference and return it. /// return it. If not, create a forward reference and return it.
/// ///
/// \param Name - The symbol name, which must be unique across all symbols. /// \param Name - The symbol name, which must be unique across all symbols.
MCSymbol *GetOrCreateSymbol(const Twine &Name); MCSymbol *getOrCreateSymbol(const Twine &Name);
MCSymbol *getOrCreateSectionSymbol(const MCSectionELF &Section); MCSymbol *getOrCreateSectionSymbol(const MCSectionELF &Section);
@ -274,7 +274,7 @@ namespace llvm {
MCSymbol *getOrCreateParentFrameOffsetSymbol(StringRef FuncName); MCSymbol *getOrCreateParentFrameOffsetSymbol(StringRef FuncName);
/// Get the symbol for \p Name, or null. /// Get the symbol for \p Name, or null.
MCSymbol *LookupSymbol(const Twine &Name) const; MCSymbol *lookupSymbol(const Twine &Name) const;
/// getSymbols - Get a reference for the symbol table for clients that /// getSymbols - Get a reference for the symbol table for clients that
/// want to, for example, iterate over all symbols. 'const' because we /// want to, for example, iterate over all symbols. 'const' because we
@ -401,7 +401,7 @@ namespace llvm {
void setMainFileName(StringRef S) { MainFileName = S; } void setMainFileName(StringRef S) { MainFileName = S; }
/// Creates an entry in the dwarf file and directory tables. /// Creates an entry in the dwarf file and directory tables.
unsigned GetDwarfFile(StringRef Directory, StringRef FileName, unsigned getDwarfFile(StringRef Directory, StringRef FileName,
unsigned FileNumber, unsigned CUID); unsigned FileNumber, unsigned CUID);
bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID = 0); bool isValidDwarfFileNumber(unsigned FileNumber, unsigned CUID = 0);
@ -458,7 +458,7 @@ namespace llvm {
CurrentDwarfLoc.setDiscriminator(Discriminator); CurrentDwarfLoc.setDiscriminator(Discriminator);
DwarfLocSeen = true; DwarfLocSeen = true;
} }
void ClearDwarfLocSeen() { DwarfLocSeen = false; } void clearDwarfLocSeen() { DwarfLocSeen = false; }
bool getDwarfLocSeen() { return DwarfLocSeen; } bool getDwarfLocSeen() { return DwarfLocSeen; }
const MCDwarfLoc &getCurrentDwarfLoc() { return CurrentDwarfLoc; } const MCDwarfLoc &getCurrentDwarfLoc() { return CurrentDwarfLoc; }
@ -509,16 +509,17 @@ namespace llvm {
SecureLogUsed = Value; SecureLogUsed = Value;
} }
void *Allocate(unsigned Size, unsigned Align = 8) { void *allocate(unsigned Size, unsigned Align = 8) {
return Allocator.Allocate(Size, Align); return Allocator.Allocate(Size, Align);
} }
void Deallocate(void *Ptr) { void deallocate(void *Ptr) {
} }
// Unrecoverable error has occurred. Display the best diagnostic we can // Unrecoverable error has occurred. Display the best diagnostic we can
// and bail via exit(1). For now, most MC backend errors are unrecoverable. // and bail via exit(1). For now, most MC backend errors are unrecoverable.
// FIXME: We should really do something about that. // FIXME: We should really do something about that.
LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg) const; LLVM_ATTRIBUTE_NORETURN void reportFatalError(SMLoc L,
const Twine &Msg) const;
}; };
} // end namespace llvm } // end namespace llvm
@ -549,7 +550,7 @@ namespace llvm {
/// \return The allocated memory. Could be NULL. /// \return The allocated memory. Could be NULL.
inline void *operator new(size_t Bytes, llvm::MCContext &C, inline void *operator new(size_t Bytes, llvm::MCContext &C,
size_t Alignment = 8) throw() { size_t Alignment = 8) throw() {
return C.Allocate(Bytes, Alignment); return C.allocate(Bytes, Alignment);
} }
/// \brief Placement delete companion to the new above. /// \brief Placement delete companion to the new above.
/// ///
@ -559,7 +560,7 @@ inline void *operator new(size_t Bytes, llvm::MCContext &C,
/// the MCContext throws in the object constructor. /// the MCContext throws in the object constructor.
inline void operator delete(void *Ptr, llvm::MCContext &C, size_t) inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
throw () { throw () {
C.Deallocate(Ptr); C.deallocate(Ptr);
} }
/// This placement form of operator new[] uses the MCContext's allocator for /// This placement form of operator new[] uses the MCContext's allocator for
@ -583,7 +584,7 @@ inline void operator delete(void *Ptr, llvm::MCContext &C, size_t)
/// \return The allocated memory. Could be NULL. /// \return The allocated memory. Could be NULL.
inline void *operator new[](size_t Bytes, llvm::MCContext& C, inline void *operator new[](size_t Bytes, llvm::MCContext& C,
size_t Alignment = 8) throw() { size_t Alignment = 8) throw() {
return C.Allocate(Bytes, Alignment); return C.allocate(Bytes, Alignment);
} }
/// \brief Placement delete[] companion to the new[] above. /// \brief Placement delete[] companion to the new[] above.
@ -593,7 +594,7 @@ inline void *operator new[](size_t Bytes, llvm::MCContext& C,
/// is called implicitly by the compiler if a placement new[] expression using /// is called implicitly by the compiler if a placement new[] expression using
/// the MCContext throws in the object constructor. /// the MCContext throws in the object constructor.
inline void operator delete[](void *Ptr, llvm::MCContext &C) throw () { inline void operator delete[](void *Ptr, llvm::MCContext &C) throw () {
C.Deallocate(Ptr); C.deallocate(Ptr);
} }
#endif #endif

View File

@ -462,7 +462,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
if (GVKind.isThreadLocal() && MAI->hasMachoTBSSDirective()) { if (GVKind.isThreadLocal() && MAI->hasMachoTBSSDirective()) {
// Emit the .tbss symbol // Emit the .tbss symbol
MCSymbol *MangSym = MCSymbol *MangSym =
OutContext.GetOrCreateSymbol(GVSym->getName() + Twine("$tlv$init")); OutContext.getOrCreateSymbol(GVSym->getName() + Twine("$tlv$init"));
if (GVKind.isThreadBSS()) { if (GVKind.isThreadBSS()) {
TheSection = getObjFileLowering().getTLSBSSSection(); TheSection = getObjFileLowering().getTLSBSSSection();
@ -563,7 +563,7 @@ void AsmPrinter::EmitFunctionHeader() {
if (CurrentFnBegin) { if (CurrentFnBegin) {
if (MAI->useAssignmentForEHBegin()) { if (MAI->useAssignmentForEHBegin()) {
MCSymbol *CurPos = OutContext.CreateTempSymbol(); MCSymbol *CurPos = OutContext.createTempSymbol();
OutStreamer->EmitLabel(CurPos); OutStreamer->EmitLabel(CurPos);
OutStreamer->EmitAssignment(CurrentFnBegin, OutStreamer->EmitAssignment(CurrentFnBegin,
MCSymbolRefExpr::Create(CurPos, OutContext)); MCSymbolRefExpr::Create(CurPos, OutContext));
@ -1128,7 +1128,7 @@ bool AsmPrinter::doFinalization(Module &M) {
OutStreamer->SwitchSection(ReadOnlySection); OutStreamer->SwitchSection(ReadOnlySection);
MCSymbol *AddrSymbol = MCSymbol *AddrSymbol =
OutContext.GetOrCreateSymbol(StringRef("__morestack_addr")); OutContext.getOrCreateSymbol(StringRef("__morestack_addr"));
OutStreamer->EmitLabel(AddrSymbol); OutStreamer->EmitLabel(AddrSymbol);
unsigned PtrSize = TM.getDataLayout()->getPointerSize(0); unsigned PtrSize = TM.getDataLayout()->getPointerSize(0);
@ -1443,7 +1443,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
if (TM.getRelocationModel() == Reloc::Static && if (TM.getRelocationModel() == Reloc::Static &&
MAI->hasStaticCtorDtorReferenceInStaticMode()) { MAI->hasStaticCtorDtorReferenceInStaticMode()) {
StringRef Sym(".constructors_used"); StringRef Sym(".constructors_used");
OutStreamer->EmitSymbolAttribute(OutContext.GetOrCreateSymbol(Sym), OutStreamer->EmitSymbolAttribute(OutContext.getOrCreateSymbol(Sym),
MCSA_Reference); MCSA_Reference);
} }
return true; return true;
@ -1455,7 +1455,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
if (TM.getRelocationModel() == Reloc::Static && if (TM.getRelocationModel() == Reloc::Static &&
MAI->hasStaticCtorDtorReferenceInStaticMode()) { MAI->hasStaticCtorDtorReferenceInStaticMode()) {
StringRef Sym(".destructors_used"); StringRef Sym(".destructors_used");
OutStreamer->EmitSymbolAttribute(OutContext.GetOrCreateSymbol(Sym), OutStreamer->EmitSymbolAttribute(OutContext.getOrCreateSymbol(Sym),
MCSA_Reference); MCSA_Reference);
} }
return true; return true;
@ -2293,7 +2293,7 @@ MCSymbol *AsmPrinter::GetBlockAddressSymbol(const BasicBlock *BB) const {
/// GetCPISymbol - Return the symbol for the specified constant pool entry. /// GetCPISymbol - Return the symbol for the specified constant pool entry.
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const { MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
const DataLayout *DL = TM.getDataLayout(); const DataLayout *DL = TM.getDataLayout();
return OutContext.GetOrCreateSymbol return OutContext.getOrCreateSymbol
(Twine(DL->getPrivateGlobalPrefix()) + "CPI" + Twine(getFunctionNumber()) (Twine(DL->getPrivateGlobalPrefix()) + "CPI" + Twine(getFunctionNumber())
+ "_" + Twine(CPID)); + "_" + Twine(CPID));
} }
@ -2307,7 +2307,7 @@ MCSymbol *AsmPrinter::GetJTISymbol(unsigned JTID, bool isLinkerPrivate) const {
/// FIXME: privatize to AsmPrinter. /// FIXME: privatize to AsmPrinter.
MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const { MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const {
const DataLayout *DL = TM.getDataLayout(); const DataLayout *DL = TM.getDataLayout();
return OutContext.GetOrCreateSymbol return OutContext.getOrCreateSymbol
(Twine(DL->getPrivateGlobalPrefix()) + Twine(getFunctionNumber()) + "_" + (Twine(DL->getPrivateGlobalPrefix()) + Twine(getFunctionNumber()) + "_" +
Twine(UID) + "_set_" + Twine(MBBID)); Twine(UID) + "_set_" + Twine(MBBID));
} }
@ -2323,7 +2323,7 @@ MCSymbol *AsmPrinter::getSymbolWithGlobalValueBase(const GlobalValue *GV,
MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const { MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const {
SmallString<60> NameStr; SmallString<60> NameStr;
Mang->getNameWithPrefix(NameStr, Sym); Mang->getNameWithPrefix(NameStr, Sym);
return OutContext.GetOrCreateSymbol(NameStr); return OutContext.getOrCreateSymbol(NameStr);
} }

View File

@ -997,7 +997,7 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
return; return;
if (!PrevLabel) { if (!PrevLabel) {
PrevLabel = MMI->getContext().CreateTempSymbol(); PrevLabel = MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(PrevLabel); Asm->OutStreamer->EmitLabel(PrevLabel);
} }
I->second = PrevLabel; I->second = PrevLabel;
@ -1025,7 +1025,7 @@ void DwarfDebug::endInstruction() {
// We need a label after this instruction. // We need a label after this instruction.
if (!PrevLabel) { if (!PrevLabel) {
PrevLabel = MMI->getContext().CreateTempSymbol(); PrevLabel = MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(PrevLabel); Asm->OutStreamer->EmitLabel(PrevLabel);
} }
I->second = PrevLabel; I->second = PrevLabel;

View File

@ -439,7 +439,7 @@ void EHStreamer::emitExceptionTable() {
// Emit the LSDA. // Emit the LSDA.
MCSymbol *GCCETSym = MCSymbol *GCCETSym =
Asm->OutContext.GetOrCreateSymbol(Twine("GCC_except_table")+ Asm->OutContext.getOrCreateSymbol(Twine("GCC_except_table")+
Twine(Asm->getFunctionNumber())); Twine(Asm->getFunctionNumber()));
Asm->OutStreamer->EmitLabel(GCCETSym); Asm->OutStreamer->EmitLabel(GCCETSym);
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym()); Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());

View File

@ -60,7 +60,7 @@ static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id) {
SmallString<128> TmpStr; SmallString<128> TmpStr;
AP.Mang->getNameWithPrefix(TmpStr, SymName); AP.Mang->getNameWithPrefix(TmpStr, SymName);
MCSymbol *Sym = AP.OutContext.GetOrCreateSymbol(TmpStr); MCSymbol *Sym = AP.OutContext.getOrCreateSymbol(TmpStr);
AP.OutStreamer->EmitSymbolAttribute(Sym, MCSA_Global); AP.OutStreamer->EmitSymbolAttribute(Sym, MCSA_Global);
AP.OutStreamer->EmitLabel(Sym); AP.OutStreamer->EmitLabel(Sym);

View File

@ -274,7 +274,7 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
GlobalValue::getRealLinkageName(ParentF->getName()); GlobalValue::getRealLinkageName(ParentF->getName());
MCSymbol *FuncInfoXData = MCSymbol *FuncInfoXData =
Asm->OutContext.GetOrCreateSymbol(Twine("$cppxdata$", ParentLinkageName)); Asm->OutContext.getOrCreateSymbol(Twine("$cppxdata$", ParentLinkageName));
OS.EmitValue(createImageRel32(FuncInfoXData), 4); OS.EmitValue(createImageRel32(FuncInfoXData), 4);
// The Itanium LSDA table sorts similar landing pads together to simplify the // The Itanium LSDA table sorts similar landing pads together to simplify the
@ -362,13 +362,13 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
MCSymbol *TryBlockMapXData = nullptr; MCSymbol *TryBlockMapXData = nullptr;
MCSymbol *IPToStateXData = nullptr; MCSymbol *IPToStateXData = nullptr;
if (!FuncInfo.UnwindMap.empty()) if (!FuncInfo.UnwindMap.empty())
UnwindMapXData = Asm->OutContext.GetOrCreateSymbol( UnwindMapXData = Asm->OutContext.getOrCreateSymbol(
Twine("$stateUnwindMap$", ParentLinkageName)); Twine("$stateUnwindMap$", ParentLinkageName));
if (!FuncInfo.TryBlockMap.empty()) if (!FuncInfo.TryBlockMap.empty())
TryBlockMapXData = Asm->OutContext.GetOrCreateSymbol( TryBlockMapXData = Asm->OutContext.getOrCreateSymbol(
Twine("$tryMap$", ParentLinkageName)); Twine("$tryMap$", ParentLinkageName));
if (!FuncInfo.IPToStateList.empty()) if (!FuncInfo.IPToStateList.empty())
IPToStateXData = Asm->OutContext.GetOrCreateSymbol( IPToStateXData = Asm->OutContext.getOrCreateSymbol(
Twine("$ip2state$", ParentLinkageName)); Twine("$ip2state$", ParentLinkageName));
// FuncInfo { // FuncInfo {
@ -426,7 +426,7 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
if (!TBME.HandlerArray.empty()) if (!TBME.HandlerArray.empty())
HandlerMapXData = HandlerMapXData =
Asm->OutContext.GetOrCreateSymbol(Twine("$handlerMap$") Asm->OutContext.getOrCreateSymbol(Twine("$handlerMap$")
.concat(Twine(I)) .concat(Twine(I))
.concat("$") .concat("$")
.concat(ParentLinkageName)); .concat(ParentLinkageName));

View File

@ -94,7 +94,7 @@ void WinCodeViewLineTables::maybeRecordLocation(DebugLoc DL,
} }
FileNameRegistry.add(Filename); FileNameRegistry.add(Filename);
MCSymbol *MCL = Asm->MMI->getContext().CreateTempSymbol(); MCSymbol *MCL = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(MCL); Asm->OutStreamer->EmitLabel(MCL);
CurFn->Instrs.push_back(MCL); CurFn->Instrs.push_back(MCL);
InstrInfo[MCL] = InstrInfoTy(Filename, DL.getLine()); InstrInfo[MCL] = InstrInfoTy(Filename, DL.getLine());
@ -201,15 +201,15 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
if (GVName.startswith("\01?")) if (GVName.startswith("\01?"))
FuncName = GVName.substr(1); FuncName = GVName.substr(1);
// Emit a symbol subsection, required by VS2012+ to find function boundaries. // Emit a symbol subsection, required by VS2012+ to find function boundaries.
MCSymbol *SymbolsBegin = Asm->MMI->getContext().CreateTempSymbol(), MCSymbol *SymbolsBegin = Asm->MMI->getContext().createTempSymbol(),
*SymbolsEnd = Asm->MMI->getContext().CreateTempSymbol(); *SymbolsEnd = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->AddComment("Symbol subsection for " + Twine(FuncName)); Asm->OutStreamer->AddComment("Symbol subsection for " + Twine(FuncName));
Asm->EmitInt32(COFF::DEBUG_SYMBOL_SUBSECTION); Asm->EmitInt32(COFF::DEBUG_SYMBOL_SUBSECTION);
EmitLabelDiff(*Asm->OutStreamer, SymbolsBegin, SymbolsEnd); EmitLabelDiff(*Asm->OutStreamer, SymbolsBegin, SymbolsEnd);
Asm->OutStreamer->EmitLabel(SymbolsBegin); Asm->OutStreamer->EmitLabel(SymbolsBegin);
{ {
MCSymbol *ProcSegmentBegin = Asm->MMI->getContext().CreateTempSymbol(), MCSymbol *ProcSegmentBegin = Asm->MMI->getContext().createTempSymbol(),
*ProcSegmentEnd = Asm->MMI->getContext().CreateTempSymbol(); *ProcSegmentEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, ProcSegmentBegin, ProcSegmentEnd, 2); EmitLabelDiff(*Asm->OutStreamer, ProcSegmentBegin, ProcSegmentEnd, 2);
Asm->OutStreamer->EmitLabel(ProcSegmentBegin); Asm->OutStreamer->EmitLabel(ProcSegmentBegin);
@ -256,8 +256,8 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
// Emit a line table subsection, requred to do PC-to-file:line lookup. // Emit a line table subsection, requred to do PC-to-file:line lookup.
Asm->OutStreamer->AddComment("Line table subsection for " + Twine(FuncName)); Asm->OutStreamer->AddComment("Line table subsection for " + Twine(FuncName));
Asm->EmitInt32(COFF::DEBUG_LINE_TABLE_SUBSECTION); Asm->EmitInt32(COFF::DEBUG_LINE_TABLE_SUBSECTION);
MCSymbol *LineTableBegin = Asm->MMI->getContext().CreateTempSymbol(), MCSymbol *LineTableBegin = Asm->MMI->getContext().createTempSymbol(),
*LineTableEnd = Asm->MMI->getContext().CreateTempSymbol(); *LineTableEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, LineTableBegin, LineTableEnd); EmitLabelDiff(*Asm->OutStreamer, LineTableBegin, LineTableEnd);
Asm->OutStreamer->EmitLabel(LineTableBegin); Asm->OutStreamer->EmitLabel(LineTableBegin);
@ -288,7 +288,7 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
// in the string table. // in the string table.
Asm->OutStreamer->AddComment( Asm->OutStreamer->AddComment(
"Segment for file '" + Twine(CurFilename) + "' begins"); "Segment for file '" + Twine(CurFilename) + "' begins");
MCSymbol *FileSegmentBegin = Asm->MMI->getContext().CreateTempSymbol(); MCSymbol *FileSegmentBegin = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(FileSegmentBegin); Asm->OutStreamer->EmitLabel(FileSegmentBegin);
Asm->EmitInt32(8 * IndexInStringTable); Asm->EmitInt32(8 * IndexInStringTable);
@ -298,7 +298,7 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
// Full size of the segment for this filename, including the prev two // Full size of the segment for this filename, including the prev two
// records. // records.
FileSegmentEnd = Asm->MMI->getContext().CreateTempSymbol(); FileSegmentEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, FileSegmentBegin, FileSegmentEnd); EmitLabelDiff(*Asm->OutStreamer, FileSegmentBegin, FileSegmentEnd);
} }

View File

@ -272,7 +272,7 @@ void GCMachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
MCSymbol *GCMachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB, MCSymbol *GCMachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
DebugLoc DL) const { DebugLoc DL) const {
MCSymbol *Label = MBB.getParent()->getContext().CreateTempSymbol(); MCSymbol *Label = MBB.getParent()->getContext().createTempSymbol();
BuildMI(MBB, MI, DL, TII->get(TargetOpcode::GC_LABEL)).addSym(Label); BuildMI(MBB, MI, DL, TII->get(TargetOpcode::GC_LABEL)).addSym(Label);
return Label; return Label;
} }

View File

@ -53,7 +53,7 @@ MCSymbol *MachineBasicBlock::getSymbol() const {
const MachineFunction *MF = getParent(); const MachineFunction *MF = getParent();
MCContext &Ctx = MF->getContext(); MCContext &Ctx = MF->getContext();
const char *Prefix = Ctx.getAsmInfo()->getPrivateLabelPrefix(); const char *Prefix = Ctx.getAsmInfo()->getPrivateLabelPrefix();
CachedMCSymbol = Ctx.GetOrCreateSymbol(Twine(Prefix) + "BB" + CachedMCSymbol = Ctx.getOrCreateSymbol(Twine(Prefix) + "BB" +
Twine(MF->getFunctionNumber()) + Twine(MF->getFunctionNumber()) +
"_" + Twine(getNumber())); "_" + Twine(getNumber()));
} }

View File

@ -468,14 +468,14 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
SmallString<60> Name; SmallString<60> Name;
raw_svector_ostream(Name) raw_svector_ostream(Name)
<< Prefix << "JTI" << getFunctionNumber() << '_' << JTI; << Prefix << "JTI" << getFunctionNumber() << '_' << JTI;
return Ctx.GetOrCreateSymbol(Name); return Ctx.getOrCreateSymbol(Name);
} }
/// getPICBaseSymbol - Return a function-local symbol to represent the PIC /// getPICBaseSymbol - Return a function-local symbol to represent the PIC
/// base. /// base.
MCSymbol *MachineFunction::getPICBaseSymbol() const { MCSymbol *MachineFunction::getPICBaseSymbol() const {
const DataLayout *DL = getTarget().getDataLayout(); const DataLayout *DL = getTarget().getDataLayout();
return Ctx.GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+ return Ctx.getOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
Twine(getFunctionNumber())+"$pb"); Twine(getFunctionNumber())+"$pb");
} }

View File

@ -118,7 +118,7 @@ MCSymbol *MMIAddrLabelMap::getAddrLabelSymbol(BasicBlock *BB) {
BBCallbacks.back().setMap(this); BBCallbacks.back().setMap(this);
Entry.Index = BBCallbacks.size()-1; Entry.Index = BBCallbacks.size()-1;
Entry.Fn = BB->getParent(); Entry.Fn = BB->getParent();
MCSymbol *Result = Context.CreateTempSymbol(); MCSymbol *Result = Context.createTempSymbol();
Entry.Symbols = Result; Entry.Symbols = Result;
return Result; return Result;
} }
@ -401,7 +401,7 @@ void MachineModuleInfo::addInvoke(MachineBasicBlock *LandingPad,
/// addLandingPad - Provide the label of a try LandingPad block. /// addLandingPad - Provide the label of a try LandingPad block.
/// ///
MCSymbol *MachineModuleInfo::addLandingPad(MachineBasicBlock *LandingPad) { MCSymbol *MachineModuleInfo::addLandingPad(MachineBasicBlock *LandingPad) {
MCSymbol *LandingPadLabel = Context.CreateTempSymbol(); MCSymbol *LandingPadLabel = Context.createTempSymbol();
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad); LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
LP.LandingPadLabel = LandingPadLabel; LP.LandingPadLabel = LandingPadLabel;
return LandingPadLabel; return LandingPadLabel;

View File

@ -4979,7 +4979,7 @@ SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfo &CLI,
if (LandingPad) { if (LandingPad) {
// Insert a label before the invoke call to mark the try range. This can be // Insert a label before the invoke call to mark the try range. This can be
// used to detect deletion of the invoke via the MachineModuleInfo. // used to detect deletion of the invoke via the MachineModuleInfo.
BeginLabel = MMI.getContext().CreateTempSymbol(); BeginLabel = MMI.getContext().createTempSymbol();
// For SjLj, keep track of which landing pads go with which invokes // For SjLj, keep track of which landing pads go with which invokes
// so as to maintain the ordering of pads in the LSDA. // so as to maintain the ordering of pads in the LSDA.
@ -5022,7 +5022,7 @@ SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfo &CLI,
if (LandingPad) { if (LandingPad) {
// Insert a label at the end of the invoke call to mark the try range. This // Insert a label at the end of the invoke call to mark the try range. This
// can be used to detect deletion of the invoke via the MachineModuleInfo. // can be used to detect deletion of the invoke via the MachineModuleInfo.
MCSymbol *EndLabel = MMI.getContext().CreateTempSymbol(); MCSymbol *EndLabel = MMI.getContext().createTempSymbol();
DAG.setRoot(DAG.getEHLabel(getCurSDLoc(), getRoot(), EndLabel)); DAG.setRoot(DAG.getEHLabel(getCurSDLoc(), getRoot(), EndLabel));
// Inform MachineModuleInfo of range. // Inform MachineModuleInfo of range.

View File

@ -274,7 +274,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
bool recordResult) { bool recordResult) {
MCContext &OutContext = AP.OutStreamer->getContext(); MCContext &OutContext = AP.OutStreamer->getContext();
MCSymbol *MILabel = OutContext.CreateTempSymbol(); MCSymbol *MILabel = OutContext.createTempSymbol();
AP.OutStreamer->EmitLabel(MILabel); AP.OutStreamer->EmitLabel(MILabel);
LocationVec Locations; LocationVec Locations;
@ -529,7 +529,7 @@ void StackMaps::serializeToStackMapSection() {
OS.SwitchSection(StackMapSection); OS.SwitchSection(StackMapSection);
// Emit a dummy symbol to force section inclusion. // Emit a dummy symbol to force section inclusion.
OS.EmitLabel(OutContext.GetOrCreateSymbol(Twine("__LLVM_StackMaps"))); OS.EmitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
// Serialize data. // Serialize data.
DEBUG(dbgs() << "********** Stack Map Output **********\n"); DEBUG(dbgs() << "********** Stack Map Output **********\n");

View File

@ -51,7 +51,7 @@ MCSymbol *TargetLoweringObjectFileELF::getCFIPersonalitySymbol(
MachineModuleInfo *MMI) const { MachineModuleInfo *MMI) const {
unsigned Encoding = getPersonalityEncoding(); unsigned Encoding = getPersonalityEncoding();
if ((Encoding & 0x80) == dwarf::DW_EH_PE_indirect) if ((Encoding & 0x80) == dwarf::DW_EH_PE_indirect)
return getContext().GetOrCreateSymbol(StringRef("DW.ref.") + return getContext().getOrCreateSymbol(StringRef("DW.ref.") +
TM.getSymbol(GV, Mang)->getName()); TM.getSymbol(GV, Mang)->getName());
if ((Encoding & 0x70) == dwarf::DW_EH_PE_absptr) if ((Encoding & 0x70) == dwarf::DW_EH_PE_absptr)
return TM.getSymbol(GV, Mang); return TM.getSymbol(GV, Mang);
@ -63,7 +63,7 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(MCStreamer &Streamer,
const MCSymbol *Sym) const { const MCSymbol *Sym) const {
SmallString<64> NameData("DW.ref."); SmallString<64> NameData("DW.ref.");
NameData += Sym->getName(); NameData += Sym->getName();
MCSymbol *Label = getContext().GetOrCreateSymbol(NameData); MCSymbol *Label = getContext().getOrCreateSymbol(NameData);
Streamer.EmitSymbolAttribute(Label, MCSA_Hidden); Streamer.EmitSymbolAttribute(Label, MCSA_Hidden);
Streamer.EmitSymbolAttribute(Label, MCSA_Weak); Streamer.EmitSymbolAttribute(Label, MCSA_Weak);
StringRef Prefix = ".data."; StringRef Prefix = ".data.";
@ -525,7 +525,7 @@ emitModuleFlags(MCStreamer &Streamer,
SectionKind::getDataNoRel()); SectionKind::getDataNoRel());
Streamer.SwitchSection(S); Streamer.SwitchSection(S);
Streamer.EmitLabel(getContext(). Streamer.EmitLabel(getContext().
GetOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO"))); getOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO")));
Streamer.EmitIntValue(VersionVal, 4); Streamer.EmitIntValue(VersionVal, 4);
Streamer.EmitIntValue(ImageInfoFlags, 4); Streamer.EmitIntValue(ImageInfoFlags, 4);
Streamer.AddBlankLine(); Streamer.AddBlankLine();
@ -758,7 +758,7 @@ const MCExpr *TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(
Name += DL->getPrivateGlobalPrefix(); Name += DL->getPrivateGlobalPrefix();
Name += Sym->getName(); Name += Sym->getName();
Name += Suffix; Name += Suffix;
MCSymbol *Stub = Ctx.GetOrCreateSymbol(Name); MCSymbol *Stub = Ctx.getOrCreateSymbol(Name);
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(Stub); MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(Stub);
if (!StubSym.getPointer()) if (!StubSym.getPointer())

View File

@ -37,7 +37,7 @@ void ConstantPool::emitEntries(MCStreamer &Streamer) {
const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context, const MCExpr *ConstantPool::addEntry(const MCExpr *Value, MCContext &Context,
unsigned Size) { unsigned Size) {
MCSymbol *CPEntryLabel = Context.CreateTempSymbol(); MCSymbol *CPEntryLabel = Context.createTempSymbol();
Entries.push_back(ConstantPoolEntry(CPEntryLabel, Value, Size)); Entries.push_back(ConstantPoolEntry(CPEntryLabel, Value, Size));
return MCSymbolRefExpr::Create(CPEntryLabel, Context); return MCSymbolRefExpr::Create(CPEntryLabel, Context);

View File

@ -782,14 +782,14 @@ void ELFObjectWriter::RecordRelocation(MCAssembler &Asm,
// or (A + C - R). If B = R + K and the relocation is not pcrel, we can // or (A + C - R). If B = R + K and the relocation is not pcrel, we can
// replace B to implement it: (A - R - K + C) // replace B to implement it: (A - R - K + C)
if (IsPCRel) if (IsPCRel)
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
"No relocation available to represent this relative expression"); "No relocation available to represent this relative expression");
const MCSymbol &SymB = RefB->getSymbol(); const MCSymbol &SymB = RefB->getSymbol();
if (SymB.isUndefined()) if (SymB.isUndefined())
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
Twine("symbol '") + SymB.getName() + Twine("symbol '") + SymB.getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
@ -797,12 +797,12 @@ void ELFObjectWriter::RecordRelocation(MCAssembler &Asm,
assert(!SymB.isAbsolute() && "Should have been folded"); assert(!SymB.isAbsolute() && "Should have been folded");
const MCSection &SecB = SymB.getSection(); const MCSection &SecB = SymB.getSection();
if (&SecB != &FixupSection) if (&SecB != &FixupSection)
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), "Cannot represent a difference across sections"); Fixup.getLoc(), "Cannot represent a difference across sections");
const MCSymbolData &SymBD = Asm.getSymbolData(SymB); const MCSymbolData &SymBD = Asm.getSymbolData(SymB);
if (::isWeak(SymBD)) if (::isWeak(SymBD))
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), "Cannot represent a subtraction with a weak symbol"); Fixup.getLoc(), "Cannot represent a subtraction with a weak symbol");
uint64_t SymBOffset = Layout.getSymbolOffset(&SymBD); uint64_t SymBOffset = Layout.getSymbolOffset(&SymBD);
@ -928,7 +928,7 @@ void ELFObjectWriter::computeSymbolTable(
// FIXME: Why is an undefined reference to _GLOBAL_OFFSET_TABLE_ needed? // FIXME: Why is an undefined reference to _GLOBAL_OFFSET_TABLE_ needed?
if (NeedsGOT) { if (NeedsGOT) {
StringRef Name = "_GLOBAL_OFFSET_TABLE_"; StringRef Name = "_GLOBAL_OFFSET_TABLE_";
MCSymbol *Sym = Asm.getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = Asm.getContext().getOrCreateSymbol(Name);
MCSymbolData &Data = Asm.getOrCreateSymbolData(*Sym); MCSymbolData &Data = Asm.getOrCreateSymbolData(*Sym);
Data.setExternal(true); Data.setExternal(true);
MCELF::SetBinding(Data, ELF::STB_GLOBAL); MCELF::SetBinding(Data, ELF::STB_GLOBAL);

View File

@ -132,7 +132,7 @@ MCAsmInfo::getExprForFDESymbol(const MCSymbol *Sym,
MCContext &Context = Streamer.getContext(); MCContext &Context = Streamer.getContext();
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, Context); const MCExpr *Res = MCSymbolRefExpr::Create(Sym, Context);
MCSymbol *PCSym = Context.CreateTempSymbol(); MCSymbol *PCSym = Context.createTempSymbol();
Streamer.EmitLabel(PCSym); Streamer.EmitLabel(PCSym);
const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, Context); const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, Context);
return MCBinaryExpr::CreateSub(Res, PC, Context); return MCBinaryExpr::CreateSub(Res, PC, Context);

View File

@ -193,7 +193,7 @@ const MCSymbol *MCAsmLayout::getBaseSymbol(const MCSymbol &Symbol) const {
const MCSymbolRefExpr *RefB = Value.getSymB(); const MCSymbolRefExpr *RefB = Value.getSymB();
if (RefB) if (RefB)
Assembler.getContext().FatalError( Assembler.getContext().reportFatalError(
SMLoc(), Twine("symbol '") + RefB->getSymbol().getName() + SMLoc(), Twine("symbol '") + RefB->getSymbol().getName() +
"' could not be evaluated in a subtraction expression"); "' could not be evaluated in a subtraction expression");
@ -206,7 +206,7 @@ const MCSymbol *MCAsmLayout::getBaseSymbol(const MCSymbol &Symbol) const {
const MCSymbolData &ASD = Asm.getSymbolData(ASym); const MCSymbolData &ASD = Asm.getSymbolData(ASym);
if (ASD.isCommon()) { if (ASD.isCommon()) {
// FIXME: we should probably add a SMLoc to MCExpr. // FIXME: we should probably add a SMLoc to MCExpr.
Asm.getContext().FatalError(SMLoc(), Asm.getContext().reportFatalError(SMLoc(),
"Common symbol " + ASym.getName() + "Common symbol " + ASym.getName() +
" cannot be used in assignment expr"); " cannot be used in assignment expr");
} }
@ -489,7 +489,7 @@ bool MCAssembler::evaluateFixup(const MCAsmLayout &Layout,
// fixup and records a relocation if one is needed. // fixup and records a relocation if one is needed.
const MCExpr *Expr = Fixup.getValue(); const MCExpr *Expr = Fixup.getValue();
if (!Expr->EvaluateAsRelocatable(Target, &Layout, &Fixup)) if (!Expr->EvaluateAsRelocatable(Target, &Layout, &Fixup))
getContext().FatalError(Fixup.getLoc(), "expected relocatable expression"); getContext().reportFatalError(Fixup.getLoc(), "expected relocatable expression");
bool IsPCRel = Backend.getFixupKindInfo( bool IsPCRel = Backend.getFixupKindInfo(
Fixup.getKind()).Flags & MCFixupKindInfo::FKF_IsPCRel; Fixup.getKind()).Flags & MCFixupKindInfo::FKF_IsPCRel;

View File

@ -98,7 +98,7 @@ void MCContext::reset() {
// Symbol Manipulation // Symbol Manipulation
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) { MCSymbol *MCContext::getOrCreateSymbol(const Twine &Name) {
SmallString<128> NameSV; SmallString<128> NameSV;
StringRef NameRef = Name.toStringRef(NameSV); StringRef NameRef = Name.toStringRef(NameSV);
@ -135,12 +135,12 @@ MCSymbol *MCContext::getOrCreateSectionSymbol(const MCSectionELF &Section) {
MCSymbol *MCContext::getOrCreateFrameAllocSymbol(StringRef FuncName, MCSymbol *MCContext::getOrCreateFrameAllocSymbol(StringRef FuncName,
unsigned Idx) { unsigned Idx) {
return GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName + return getOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName +
"$frame_escape_" + Twine(Idx)); "$frame_escape_" + Twine(Idx));
} }
MCSymbol *MCContext::getOrCreateParentFrameOffsetSymbol(StringRef FuncName) { MCSymbol *MCContext::getOrCreateParentFrameOffsetSymbol(StringRef FuncName) {
return GetOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName + return getOrCreateSymbol(Twine(MAI->getPrivateGlobalPrefix()) + FuncName +
"$parent_frame_offset"); "$parent_frame_offset");
} }
@ -181,13 +181,13 @@ MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix) {
return CreateSymbol(NameSV, AlwaysAddSuffix); return CreateSymbol(NameSV, AlwaysAddSuffix);
} }
MCSymbol *MCContext::CreateLinkerPrivateTempSymbol() { MCSymbol *MCContext::createLinkerPrivateTempSymbol() {
SmallString<128> NameSV; SmallString<128> NameSV;
raw_svector_ostream(NameSV) << MAI->getLinkerPrivateGlobalPrefix() << "tmp"; raw_svector_ostream(NameSV) << MAI->getLinkerPrivateGlobalPrefix() << "tmp";
return CreateSymbol(NameSV, true); return CreateSymbol(NameSV, true);
} }
MCSymbol *MCContext::CreateTempSymbol() { MCSymbol *MCContext::createTempSymbol() {
return createTempSymbol("tmp", true); return createTempSymbol("tmp", true);
} }
@ -209,16 +209,16 @@ MCSymbol *MCContext::getOrCreateDirectionalLocalSymbol(unsigned LocalLabelVal,
unsigned Instance) { unsigned Instance) {
MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)]; MCSymbol *&Sym = LocalSymbols[std::make_pair(LocalLabelVal, Instance)];
if (!Sym) if (!Sym)
Sym = CreateTempSymbol(); Sym = createTempSymbol();
return Sym; return Sym;
} }
MCSymbol *MCContext::CreateDirectionalLocalSymbol(unsigned LocalLabelVal) { MCSymbol *MCContext::createDirectionalLocalSymbol(unsigned LocalLabelVal) {
unsigned Instance = NextInstance(LocalLabelVal); unsigned Instance = NextInstance(LocalLabelVal);
return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance); return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
} }
MCSymbol *MCContext::GetDirectionalLocalSymbol(unsigned LocalLabelVal, MCSymbol *MCContext::getDirectionalLocalSymbol(unsigned LocalLabelVal,
bool Before) { bool Before) {
unsigned Instance = GetInstance(LocalLabelVal); unsigned Instance = GetInstance(LocalLabelVal);
if (!Before) if (!Before)
@ -226,7 +226,7 @@ MCSymbol *MCContext::GetDirectionalLocalSymbol(unsigned LocalLabelVal,
return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance); return getOrCreateDirectionalLocalSymbol(LocalLabelVal, Instance);
} }
MCSymbol *MCContext::LookupSymbol(const Twine &Name) const { MCSymbol *MCContext::lookupSymbol(const Twine &Name) const {
SmallString<128> NameSV; SmallString<128> NameSV;
StringRef NameRef = Name.toStringRef(NameSV); StringRef NameRef = Name.toStringRef(NameSV);
return Symbols.lookup(NameRef); return Symbols.lookup(NameRef);
@ -299,7 +299,7 @@ const MCSectionELF *MCContext::getELFSection(StringRef Section, unsigned Type,
const char *BeginSymName) { const char *BeginSymName) {
MCSymbol *GroupSym = nullptr; MCSymbol *GroupSym = nullptr;
if (!Group.empty()) if (!Group.empty())
GroupSym = GetOrCreateSymbol(Group); GroupSym = getOrCreateSymbol(Group);
return getELFSection(Section, Type, Flags, EntrySize, GroupSym, UniqueID, return getELFSection(Section, Type, Flags, EntrySize, GroupSym, UniqueID,
BeginSymName, nullptr); BeginSymName, nullptr);
@ -353,7 +353,7 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics,
int Selection, const char *BeginSymName) { int Selection, const char *BeginSymName) {
MCSymbol *COMDATSymbol = nullptr; MCSymbol *COMDATSymbol = nullptr;
if (!COMDATSymName.empty()) { if (!COMDATSymName.empty()) {
COMDATSymbol = GetOrCreateSymbol(COMDATSymName); COMDATSymbol = getOrCreateSymbol(COMDATSymName);
COMDATSymName = COMDATSymbol->getName(); COMDATSymName = COMDATSymbol->getName();
} }
@ -411,11 +411,11 @@ MCContext::getAssociativeCOFFSection(const MCSectionCOFF *Sec,
// Dwarf Management // Dwarf Management
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// GetDwarfFile - takes a file name an number to place in the dwarf file and /// getDwarfFile - takes a file name an number to place in the dwarf file and
/// directory tables. If the file number has already been allocated it is an /// directory tables. If the file number has already been allocated it is an
/// error and zero is returned and the client reports the error, else the /// error and zero is returned and the client reports the error, else the
/// allocated file number is returned. The file numbers may be in any order. /// allocated file number is returned. The file numbers may be in any order.
unsigned MCContext::GetDwarfFile(StringRef Directory, StringRef FileName, unsigned MCContext::getDwarfFile(StringRef Directory, StringRef FileName,
unsigned FileNumber, unsigned CUID) { unsigned FileNumber, unsigned CUID) {
MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID]; MCDwarfLineTable &Table = MCDwarfLineTablesCUMap[CUID];
return Table.getFile(Directory, FileName, FileNumber); return Table.getFile(Directory, FileName, FileNumber);
@ -442,7 +442,7 @@ void MCContext::finalizeDwarfSections(MCStreamer &MCOS) {
assert(sec->second.first && "Start symbol must be set by now"); assert(sec->second.first && "Start symbol must be set by now");
MCOS.SwitchSection(sec->first); MCOS.SwitchSection(sec->first);
if (MCOS.mayHaveInstructions()) { if (MCOS.mayHaveInstructions()) {
MCSymbol *SectionEndSym = context.CreateTempSymbol(); MCSymbol *SectionEndSym = context.createTempSymbol();
MCOS.EmitLabel(SectionEndSym); MCOS.EmitLabel(SectionEndSym);
sec->second.second = SectionEndSym; sec->second.second = SectionEndSym;
++sec; ++sec;
@ -454,7 +454,7 @@ void MCContext::finalizeDwarfSections(MCStreamer &MCOS) {
} }
} }
void MCContext::FatalError(SMLoc Loc, const Twine &Msg) const { void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) const {
// If we have a source manager and a location, use it. Otherwise just // If we have a source manager and a location, use it. Otherwise just
// use the generic report_fatal_error(). // use the generic report_fatal_error().
if (!SrcMgr || Loc == SMLoc()) if (!SrcMgr || Loc == SMLoc())

View File

@ -87,7 +87,7 @@ bool MCExternalSymbolizer::tryAddingSymbolicOperand(MCInst &MI,
if (SymbolicOp.AddSymbol.Present) { if (SymbolicOp.AddSymbol.Present) {
if (SymbolicOp.AddSymbol.Name) { if (SymbolicOp.AddSymbol.Name) {
StringRef Name(SymbolicOp.AddSymbol.Name); StringRef Name(SymbolicOp.AddSymbol.Name);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
Add = MCSymbolRefExpr::Create(Sym, Ctx); Add = MCSymbolRefExpr::Create(Sym, Ctx);
} else { } else {
Add = MCConstantExpr::Create((int)SymbolicOp.AddSymbol.Value, Ctx); Add = MCConstantExpr::Create((int)SymbolicOp.AddSymbol.Value, Ctx);
@ -98,7 +98,7 @@ bool MCExternalSymbolizer::tryAddingSymbolicOperand(MCInst &MI,
if (SymbolicOp.SubtractSymbol.Present) { if (SymbolicOp.SubtractSymbol.Present) {
if (SymbolicOp.SubtractSymbol.Name) { if (SymbolicOp.SubtractSymbol.Name) {
StringRef Name(SymbolicOp.SubtractSymbol.Name); StringRef Name(SymbolicOp.SubtractSymbol.Name);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
Sub = MCSymbolRefExpr::Create(Sym, Ctx); Sub = MCSymbolRefExpr::Create(Sym, Ctx);
} else { } else {
Sub = MCConstantExpr::Create((int)SymbolicOp.SubtractSymbol.Value, Ctx); Sub = MCConstantExpr::Create((int)SymbolicOp.SubtractSymbol.Value, Ctx);

View File

@ -69,7 +69,7 @@ void MCLineEntry::Make(MCObjectStreamer *MCOS, const MCSection *Section) {
return; return;
// Create a symbol at in the current section for use in the line entry. // Create a symbol at in the current section for use in the line entry.
MCSymbol *LineSym = MCOS->getContext().CreateTempSymbol(); MCSymbol *LineSym = MCOS->getContext().createTempSymbol();
// Set the value of the symbol to use for the MCLineEntry. // Set the value of the symbol to use for the MCLineEntry.
MCOS->EmitLabel(LineSym); MCOS->EmitLabel(LineSym);
@ -80,7 +80,7 @@ void MCLineEntry::Make(MCObjectStreamer *MCOS, const MCSection *Section) {
MCLineEntry LineEntry(LineSym, DwarfLoc); MCLineEntry LineEntry(LineSym, DwarfLoc);
// clear DwarfLocSeen saying the current .loc info is now used. // clear DwarfLocSeen saying the current .loc info is now used.
MCOS->getContext().ClearDwarfLocSeen(); MCOS->getContext().clearDwarfLocSeen();
// Add the line entry to this section's entries. // Add the line entry to this section's entries.
MCOS->getContext() MCOS->getContext()
@ -245,7 +245,7 @@ static const MCExpr *forceExpAbs(MCStreamer &OS, const MCExpr* Expr) {
if (Context.getAsmInfo()->hasAggressiveSymbolFolding()) if (Context.getAsmInfo()->hasAggressiveSymbolFolding())
return Expr; return Expr;
MCSymbol *ABS = Context.CreateTempSymbol(); MCSymbol *ABS = Context.createTempSymbol();
OS.EmitAssignment(ABS, Expr); OS.EmitAssignment(ABS, Expr);
return MCSymbolRefExpr::Create(ABS, Context); return MCSymbolRefExpr::Create(ABS, Context);
} }
@ -264,12 +264,12 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS,
// Create a symbol at the beginning of the line table. // Create a symbol at the beginning of the line table.
MCSymbol *LineStartSym = Label; MCSymbol *LineStartSym = Label;
if (!LineStartSym) if (!LineStartSym)
LineStartSym = context.CreateTempSymbol(); LineStartSym = context.createTempSymbol();
// Set the value of the symbol, as we are at the start of the line table. // Set the value of the symbol, as we are at the start of the line table.
MCOS->EmitLabel(LineStartSym); MCOS->EmitLabel(LineStartSym);
// Create a symbol for the end of the section (to be set when we get there). // Create a symbol for the end of the section (to be set when we get there).
MCSymbol *LineEndSym = context.CreateTempSymbol(); MCSymbol *LineEndSym = context.createTempSymbol();
// The first 4 bytes is the total length of the information for this // The first 4 bytes is the total length of the information for this
// compilation unit (not including these 4 bytes for the length). // compilation unit (not including these 4 bytes for the length).
@ -280,7 +280,7 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS,
MCOS->EmitIntValue(2, 2); MCOS->EmitIntValue(2, 2);
// Create a symbol for the end of the prologue (to be set when we get there). // Create a symbol for the end of the prologue (to be set when we get there).
MCSymbol *ProEndSym = context.CreateTempSymbol(); // Lprologue_end MCSymbol *ProEndSym = context.createTempSymbol(); // Lprologue_end
// Length of the prologue, is the next 4 bytes. Which is the start of the // Length of the prologue, is the next 4 bytes. Which is the start of the
// section to the end of the prologue. Not including the 4 bytes for the // section to the end of the prologue. Not including the 4 bytes for the
@ -640,9 +640,9 @@ static void EmitGenDwarfInfo(MCStreamer *MCOS,
// Create a symbol at the start and end of this section used in here for the // Create a symbol at the start and end of this section used in here for the
// expression to calculate the length in the header. // expression to calculate the length in the header.
MCSymbol *InfoStart = context.CreateTempSymbol(); MCSymbol *InfoStart = context.createTempSymbol();
MCOS->EmitLabel(InfoStart); MCOS->EmitLabel(InfoStart);
MCSymbol *InfoEnd = context.CreateTempSymbol(); MCSymbol *InfoEnd = context.createTempSymbol();
// First part: the header. // First part: the header.
@ -863,18 +863,18 @@ void MCGenDwarfInfo::Emit(MCStreamer *MCOS) {
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection()); MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfInfoSection());
if (CreateDwarfSectionSymbols) { if (CreateDwarfSectionSymbols) {
InfoSectionSymbol = context.CreateTempSymbol(); InfoSectionSymbol = context.createTempSymbol();
MCOS->EmitLabel(InfoSectionSymbol); MCOS->EmitLabel(InfoSectionSymbol);
} }
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection()); MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfAbbrevSection());
if (CreateDwarfSectionSymbols) { if (CreateDwarfSectionSymbols) {
AbbrevSectionSymbol = context.CreateTempSymbol(); AbbrevSectionSymbol = context.createTempSymbol();
MCOS->EmitLabel(AbbrevSectionSymbol); MCOS->EmitLabel(AbbrevSectionSymbol);
} }
if (UseRangesSection) { if (UseRangesSection) {
MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection()); MCOS->SwitchSection(context.getObjectFileInfo()->getDwarfRangesSection());
if (CreateDwarfSectionSymbols) { if (CreateDwarfSectionSymbols) {
RangesSectionSymbol = context.CreateTempSymbol(); RangesSectionSymbol = context.createTempSymbol();
MCOS->EmitLabel(RangesSectionSymbol); MCOS->EmitLabel(RangesSectionSymbol);
} }
} }
@ -932,7 +932,7 @@ void MCGenDwarfLabelEntry::Make(MCSymbol *Symbol, MCStreamer *MCOS,
// values so that they don't have things like an ARM thumb bit from the // values so that they don't have things like an ARM thumb bit from the
// original symbol. So when used they won't get a low bit set after // original symbol. So when used they won't get a low bit set after
// relocation. // relocation.
MCSymbol *Label = context.CreateTempSymbol(); MCSymbol *Label = context.createTempSymbol();
MCOS->EmitLabel(Label); MCOS->EmitLabel(Label);
// Create and entry for the info and add it to the other entries. // Create and entry for the info and add it to the other entries.
@ -1269,10 +1269,10 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCObjectStreamer &streamer,
const MCRegisterInfo *MRI = context.getRegisterInfo(); const MCRegisterInfo *MRI = context.getRegisterInfo();
const MCObjectFileInfo *MOFI = context.getObjectFileInfo(); const MCObjectFileInfo *MOFI = context.getObjectFileInfo();
MCSymbol *sectionStart = context.CreateTempSymbol(); MCSymbol *sectionStart = context.createTempSymbol();
streamer.EmitLabel(sectionStart); streamer.EmitLabel(sectionStart);
MCSymbol *sectionEnd = context.CreateTempSymbol(); MCSymbol *sectionEnd = context.createTempSymbol();
// Length // Length
const MCExpr *Length = MakeStartMinusEndExpr(streamer, *sectionStart, const MCExpr *Length = MakeStartMinusEndExpr(streamer, *sectionStart,
@ -1380,8 +1380,8 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCObjectStreamer &streamer,
const MCSymbol &cieStart, const MCSymbol &cieStart,
const MCDwarfFrameInfo &frame) { const MCDwarfFrameInfo &frame) {
MCContext &context = streamer.getContext(); MCContext &context = streamer.getContext();
MCSymbol *fdeStart = context.CreateTempSymbol(); MCSymbol *fdeStart = context.createTempSymbol();
MCSymbol *fdeEnd = context.CreateTempSymbol(); MCSymbol *fdeEnd = context.createTempSymbol();
const MCObjectFileInfo *MOFI = context.getObjectFileInfo(); const MCObjectFileInfo *MOFI = context.getObjectFileInfo();
CFAOffset = InitialCFAOffset; CFAOffset = InitialCFAOffset;
@ -1524,7 +1524,7 @@ void MCDwarfFrameEmitter::Emit(MCObjectStreamer &Streamer, MCAsmBackend *MAB,
*MOFI->getDwarfFrameSection(); *MOFI->getDwarfFrameSection();
Streamer.SwitchSection(&Section); Streamer.SwitchSection(&Section);
MCSymbol *SectionStart = Context.CreateTempSymbol(); MCSymbol *SectionStart = Context.createTempSymbol();
Streamer.EmitLabel(SectionStart); Streamer.EmitLabel(SectionStart);
Emitter.setSectionStart(SectionStart); Emitter.setSectionStart(SectionStart);

View File

@ -164,7 +164,7 @@ const MCSymbolRefExpr *MCSymbolRefExpr::Create(const MCSymbol *Sym,
const MCSymbolRefExpr *MCSymbolRefExpr::Create(StringRef Name, VariantKind Kind, const MCSymbolRefExpr *MCSymbolRefExpr::Create(StringRef Name, VariantKind Kind,
MCContext &Ctx) { MCContext &Ctx) {
return Create(Ctx.GetOrCreateSymbol(Name), Kind, Ctx); return Create(Ctx.getOrCreateSymbol(Name), Kind, Ctx);
} }
StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) { StringRef MCSymbolRefExpr::getVariantKindName(VariantKind Kind) {

View File

@ -163,7 +163,7 @@ void MCMachOStreamer::ChangeSection(const MCSection *Section,
// Output a linker-local symbol so we don't need section-relative local // Output a linker-local symbol so we don't need section-relative local
// relocations. The linker hates us when we do that. // relocations. The linker hates us when we do that.
if (LabelSections && !HasSectionLabel[Section]) { if (LabelSections && !HasSectionLabel[Section]) {
MCSymbol *Label = getContext().CreateLinkerPrivateTempSymbol(); MCSymbol *Label = getContext().createLinkerPrivateTempSymbol();
EmitLabel(Label); EmitLabel(Label);
HasSectionLabel[Section] = true; HasSectionLabel[Section] = true;
} }
@ -208,7 +208,7 @@ void MCMachOStreamer::EmitDataRegion(DataRegionData::KindTy Kind) {
if (!getAssembler().getBackend().hasDataInCodeSupport()) if (!getAssembler().getBackend().hasDataInCodeSupport())
return; return;
// Create a temporary label to mark the start of the data region. // Create a temporary label to mark the start of the data region.
MCSymbol *Start = getContext().CreateTempSymbol(); MCSymbol *Start = getContext().createTempSymbol();
EmitLabel(Start); EmitLabel(Start);
// Record the region for the object writer to use. // Record the region for the object writer to use.
DataRegionData Data = { Kind, Start, nullptr }; DataRegionData Data = { Kind, Start, nullptr };
@ -224,7 +224,7 @@ void MCMachOStreamer::EmitDataRegionEnd() {
DataRegionData &Data = Regions.back(); DataRegionData &Data = Regions.back();
assert(!Data.End && "Mismatched .end_data_region!"); assert(!Data.End && "Mismatched .end_data_region!");
// Create a temporary label to mark the end of the data region. // Create a temporary label to mark the end of the data region.
Data.End = getContext().CreateTempSymbol(); Data.End = getContext().createTempSymbol();
EmitLabel(Data.End); EmitLabel(Data.End);
} }

View File

@ -127,12 +127,12 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) { void MCObjectStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
// We need to create a local symbol to avoid relocations. // We need to create a local symbol to avoid relocations.
Frame.Begin = getContext().CreateTempSymbol(); Frame.Begin = getContext().createTempSymbol();
EmitLabel(Frame.Begin); EmitLabel(Frame.Begin);
} }
void MCObjectStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { void MCObjectStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
Frame.End = getContext().CreateTempSymbol(); Frame.End = getContext().createTempSymbol();
EmitLabel(Frame.End); EmitLabel(Frame.End);
} }
@ -375,7 +375,7 @@ bool MCObjectStreamer::EmitValueToOffset(const MCExpr *Offset,
return false; return false;
} }
MCSymbol *CurrentPos = getContext().CreateTempSymbol(); MCSymbol *CurrentPos = getContext().createTempSymbol();
EmitLabel(CurrentPos); EmitLabel(CurrentPos);
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None; MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
const MCExpr *Ref = const MCExpr *Ref =

View File

@ -630,7 +630,7 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
// If we are generating dwarf for assembly source files save the initial text // If we are generating dwarf for assembly source files save the initial text
// section and generate a .file directive. // section and generate a .file directive.
if (getContext().getGenDwarfForAssembly()) { if (getContext().getGenDwarfForAssembly()) {
MCSymbol *SectionStartSym = getContext().CreateTempSymbol(); MCSymbol *SectionStartSym = getContext().createTempSymbol();
getStreamer().EmitLabel(SectionStartSym); getStreamer().EmitLabel(SectionStartSym);
auto InsertResult = getContext().addGenDwarfSection( auto InsertResult = getContext().addGenDwarfSection(
getStreamer().getCurrentSection().first); getStreamer().getCurrentSection().first);
@ -798,7 +798,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
if (Lexer.getMAI().getDollarIsPC()) { if (Lexer.getMAI().getDollarIsPC()) {
// This is a '$' reference, which references the current PC. Emit a // This is a '$' reference, which references the current PC. Emit a
// temporary label to the streamer and refer to it. // temporary label to the streamer and refer to it.
MCSymbol *Sym = Ctx.CreateTempSymbol(); MCSymbol *Sym = Ctx.createTempSymbol();
Out.EmitLabel(Sym); Out.EmitLabel(Sym);
Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None,
getContext()); getContext());
@ -855,7 +855,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
} }
} }
MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName); MCSymbol *Sym = getContext().getOrCreateSymbol(SymbolName);
// If this is an absolute variable reference, substitute it now to preserve // If this is an absolute variable reference, substitute it now to preserve
// semantics in the face of reassignment. // semantics in the face of reassignment.
@ -893,7 +893,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
} }
if (IDVal == "f" || IDVal == "b") { if (IDVal == "f" || IDVal == "b") {
MCSymbol *Sym = MCSymbol *Sym =
Ctx.GetDirectionalLocalSymbol(IntVal, IDVal == "b"); Ctx.getDirectionalLocalSymbol(IntVal, IDVal == "b");
Res = MCSymbolRefExpr::Create(Sym, Variant, getContext()); Res = MCSymbolRefExpr::Create(Sym, Variant, getContext());
if (IDVal == "b" && Sym->isUndefined()) if (IDVal == "b" && Sym->isUndefined())
return Error(Loc, "invalid reference to undefined symbol"); return Error(Loc, "invalid reference to undefined symbol");
@ -914,7 +914,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
case AsmToken::Dot: { case AsmToken::Dot: {
// This is a '.' reference, which references the current PC. Emit a // This is a '.' reference, which references the current PC. Emit a
// temporary label to the streamer and refer to it. // temporary label to the streamer and refer to it.
MCSymbol *Sym = Ctx.CreateTempSymbol(); MCSymbol *Sym = Ctx.createTempSymbol();
Out.EmitLabel(Sym); Out.EmitLabel(Sym);
Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, getContext()); Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, getContext());
EndLoc = Lexer.getTok().getEndLoc(); EndLoc = Lexer.getTok().getEndLoc();
@ -1309,9 +1309,9 @@ bool AsmParser::parseStatement(ParseStatementInfo &Info,
IDVal.size(), RewrittenLabel)); IDVal.size(), RewrittenLabel));
IDVal = RewrittenLabel; IDVal = RewrittenLabel;
} }
Sym = getContext().GetOrCreateSymbol(IDVal); Sym = getContext().getOrCreateSymbol(IDVal);
} else } else
Sym = Ctx.CreateDirectionalLocalSymbol(LocalLabelVal); Sym = Ctx.createDirectionalLocalSymbol(LocalLabelVal);
Sym->redefineIfPossible(); Sym->redefineIfPossible();
@ -2217,7 +2217,7 @@ bool AsmParser::parseAssignment(StringRef Name, bool allow_redef,
// Validate that the LHS is allowed to be a variable (either it has not been // Validate that the LHS is allowed to be a variable (either it has not been
// used as a symbol, or it is an absolute symbol). // used as a symbol, or it is an absolute symbol).
MCSymbol *Sym = getContext().LookupSymbol(Name); MCSymbol *Sym = getContext().lookupSymbol(Name);
if (Sym) { if (Sym) {
// Diagnose assignment to a label. // Diagnose assignment to a label.
// //
@ -2246,7 +2246,7 @@ bool AsmParser::parseAssignment(StringRef Name, bool allow_redef,
} }
return false; return false;
} else } else
Sym = getContext().GetOrCreateSymbol(Name); Sym = getContext().getOrCreateSymbol(Name);
Sym->setRedefinable(allow_redef); Sym->setRedefinable(allow_redef);
@ -3186,7 +3186,7 @@ bool AsmParser::parseDirectiveCFIPersonalityOrLsda(bool IsPersonality) {
if (parseIdentifier(Name)) if (parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (IsPersonality) if (IsPersonality)
getStreamer().EmitCFIPersonality(Sym, Encoding); getStreamer().EmitCFIPersonality(Sym, Encoding);
@ -3700,7 +3700,7 @@ bool AsmParser::parseDirectiveSymbolAttribute(MCSymbolAttr Attr) {
if (parseIdentifier(Name)) if (parseIdentifier(Name))
return Error(Loc, "expected identifier in directive"); return Error(Loc, "expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
// Assembler local symbols don't make any sense here. Complain loudly. // Assembler local symbols don't make any sense here. Complain loudly.
if (Sym->isTemporary()) if (Sym->isTemporary())
@ -3733,7 +3733,7 @@ bool AsmParser::parseDirectiveComm(bool IsLocal) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// Handle the identifier as the key symbol. // Handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
@ -4030,7 +4030,7 @@ bool AsmParser::parseDirectiveIfdef(SMLoc DirectiveLoc, bool expect_defined) {
Lex(); Lex();
MCSymbol *Sym = getContext().LookupSymbol(Name); MCSymbol *Sym = getContext().lookupSymbol(Name);
if (expect_defined) if (expect_defined)
TheCondState.CondMet = (Sym && !Sym->isUndefined()); TheCondState.CondMet = (Sym && !Sym->isUndefined());

View File

@ -272,7 +272,7 @@ bool COFFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().EmitSymbolAttribute(Sym, Attr); getStreamer().EmitSymbolAttribute(Sym, Attr);
@ -398,7 +398,7 @@ bool COFFAsmParser::ParseDirectiveDef(StringRef, SMLoc) {
if (getParser().parseIdentifier(SymbolName)) if (getParser().parseIdentifier(SymbolName))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName); MCSymbol *Sym = getContext().getOrCreateSymbol(SymbolName);
getStreamer().BeginCOFFSymbolDef(Sym); getStreamer().BeginCOFFSymbolDef(Sym);
@ -446,7 +446,7 @@ bool COFFAsmParser::ParseDirectiveSecRel32(StringRef, SMLoc) {
if (getLexer().isNot(AsmToken::EndOfStatement)) if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID); MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex(); Lex();
getStreamer().EmitCOFFSecRel32(Symbol); getStreamer().EmitCOFFSecRel32(Symbol);
@ -461,7 +461,7 @@ bool COFFAsmParser::ParseDirectiveSecIdx(StringRef, SMLoc) {
if (getLexer().isNot(AsmToken::EndOfStatement)) if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID); MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex(); Lex();
getStreamer().EmitCOFFSectionIndex(Symbol); getStreamer().EmitCOFFSectionIndex(Symbol);
@ -524,7 +524,7 @@ bool COFFAsmParser::ParseSEHDirectiveStartProc(StringRef, SMLoc) {
if (getLexer().isNot(AsmToken::EndOfStatement)) if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID); MCSymbol *Symbol = getContext().getOrCreateSymbol(SymbolID);
Lex(); Lex();
getStreamer().EmitWinCFIStartProc(Symbol); getStreamer().EmitWinCFIStartProc(Symbol);
@ -568,7 +568,7 @@ bool COFFAsmParser::ParseSEHDirectiveHandler(StringRef, SMLoc) {
if (getLexer().isNot(AsmToken::EndOfStatement)) if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
MCSymbol *handler = getContext().GetOrCreateSymbol(SymbolID); MCSymbol *handler = getContext().getOrCreateSymbol(SymbolID);
Lex(); Lex();
getStreamer().EmitWinEHHandler(handler, unwind, except); getStreamer().EmitWinEHHandler(handler, unwind, except);

View File

@ -407,7 +407,7 @@ bool DarwinAsmParser::parseDirectiveDesc(StringRef, SMLoc) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// Handle the identifier as the key symbol. // Handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in '.desc' directive"); return TokError("unexpected token in '.desc' directive");
@ -444,7 +444,7 @@ bool DarwinAsmParser::parseDirectiveIndirectSymbol(StringRef, SMLoc Loc) {
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in .indirect_symbol directive"); return TokError("expected identifier in .indirect_symbol directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
// Assembler local symbols don't make any sense here. Complain loudly. // Assembler local symbols don't make any sense here. Complain loudly.
if (Sym->isTemporary()) if (Sym->isTemporary())
@ -519,7 +519,7 @@ bool DarwinAsmParser::parseDirectiveLsym(StringRef, SMLoc) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// Handle the identifier as the key symbol. // Handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in '.lsym' directive"); return TokError("unexpected token in '.lsym' directive");
@ -695,7 +695,7 @@ bool DarwinAsmParser::parseDirectiveTBSS(StringRef, SMLoc) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// Handle the identifier as the key symbol. // Handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
@ -778,7 +778,7 @@ bool DarwinAsmParser::parseDirectiveZerofill(StringRef, SMLoc) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// handle the identifier as the key symbol. // handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(IDStr); MCSymbol *Sym = getContext().getOrCreateSymbol(IDStr);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");

View File

@ -174,7 +174,7 @@ bool ELFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) {
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().EmitSymbolAttribute(Sym, Attr); getStreamer().EmitSymbolAttribute(Sym, Attr);
@ -209,7 +209,7 @@ bool ELFAsmParser::ParseDirectiveSize(StringRef, SMLoc) {
StringRef Name; StringRef Name;
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) if (getLexer().isNot(AsmToken::Comma))
return TokError("unexpected token in directive"); return TokError("unexpected token in directive");
@ -539,7 +539,7 @@ EndStmt:
if (getContext().getDwarfVersion() <= 2) if (getContext().getDwarfVersion() <= 2)
Warning(loc, "DWARF2 only supports one section per compilation unit"); Warning(loc, "DWARF2 only supports one section per compilation unit");
MCSymbol *SectionStartSymbol = getContext().CreateTempSymbol(); MCSymbol *SectionStartSymbol = getContext().createTempSymbol();
getStreamer().EmitLabel(SectionStartSymbol); getStreamer().EmitLabel(SectionStartSymbol);
InsertResult.first->second.first = SectionStartSymbol; InsertResult.first->second.first = SectionStartSymbol;
} }
@ -582,7 +582,7 @@ bool ELFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
// Handle the identifier as the key symbol. // Handle the identifier as the key symbol.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
// NOTE the comma is optional in all cases. It is only documented as being // NOTE the comma is optional in all cases. It is only documented as being
// optional in the first case, however, GAS will silently treat the comma as // optional in the first case, however, GAS will silently treat the comma as
@ -661,8 +661,8 @@ bool ELFAsmParser::ParseDirectiveSymver(StringRef, SMLoc) {
if (AliasName.find('@') == StringRef::npos) if (AliasName.find('@') == StringRef::npos)
return TokError("expected a '@' in the name"); return TokError("expected a '@' in the name");
MCSymbol *Alias = getContext().GetOrCreateSymbol(AliasName); MCSymbol *Alias = getContext().getOrCreateSymbol(AliasName);
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
const MCExpr *Value = MCSymbolRefExpr::Create(Sym, getContext()); const MCExpr *Value = MCSymbolRefExpr::Create(Sym, getContext());
getStreamer().EmitAssignment(Alias, Value); getStreamer().EmitAssignment(Alias, Value);
@ -711,9 +711,9 @@ bool ELFAsmParser::ParseDirectiveWeakref(StringRef, SMLoc) {
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
MCSymbol *Alias = getContext().GetOrCreateSymbol(AliasName); MCSymbol *Alias = getContext().getOrCreateSymbol(AliasName);
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
getStreamer().EmitWeakReference(Alias, Sym); getStreamer().EmitWeakReference(Alias, Sym);
return false; return false;

View File

@ -146,7 +146,7 @@ void MCStreamer::EmitZeros(uint64_t NumBytes) {
unsigned MCStreamer::EmitDwarfFileDirective(unsigned FileNo, unsigned MCStreamer::EmitDwarfFileDirective(unsigned FileNo,
StringRef Directory, StringRef Directory,
StringRef Filename, unsigned CUID) { StringRef Filename, unsigned CUID) {
return getContext().GetDwarfFile(Directory, Filename, FileNo, CUID); return getContext().getDwarfFile(Directory, Filename, FileNo, CUID);
} }
void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line, void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
@ -163,7 +163,7 @@ MCSymbol *MCStreamer::getDwarfLineTableSymbol(unsigned CUID) {
if (!Table.getLabel()) { if (!Table.getLabel()) {
StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix(); StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
Table.setLabel( Table.setLabel(
Context.GetOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID))); Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
} }
return Table.getLabel(); return Table.getLabel();
} }
@ -252,7 +252,7 @@ void MCStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
MCSymbol *MCStreamer::EmitCFICommon() { MCSymbol *MCStreamer::EmitCFICommon() {
EnsureValidDwarfFrame(); EnsureValidDwarfFrame();
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
return Label; return Label;
} }
@ -399,7 +399,7 @@ void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol) {
if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End) if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
report_fatal_error("Starting a function before ending the previous one!"); report_fatal_error("Starting a function before ending the previous one!");
MCSymbol *StartProc = getContext().CreateTempSymbol(); MCSymbol *StartProc = getContext().createTempSymbol();
EmitLabel(StartProc); EmitLabel(StartProc);
WinFrameInfos.push_back(new WinEH::FrameInfo(Symbol, StartProc)); WinFrameInfos.push_back(new WinEH::FrameInfo(Symbol, StartProc));
@ -411,7 +411,7 @@ void MCStreamer::EmitWinCFIEndProc() {
if (CurrentWinFrameInfo->ChainedParent) if (CurrentWinFrameInfo->ChainedParent)
report_fatal_error("Not all chained regions terminated!"); report_fatal_error("Not all chained regions terminated!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
CurrentWinFrameInfo->End = Label; CurrentWinFrameInfo->End = Label;
} }
@ -419,7 +419,7 @@ void MCStreamer::EmitWinCFIEndProc() {
void MCStreamer::EmitWinCFIStartChained() { void MCStreamer::EmitWinCFIStartChained() {
EnsureValidWinFrameInfo(); EnsureValidWinFrameInfo();
MCSymbol *StartProc = getContext().CreateTempSymbol(); MCSymbol *StartProc = getContext().createTempSymbol();
EmitLabel(StartProc); EmitLabel(StartProc);
WinFrameInfos.push_back(new WinEH::FrameInfo(CurrentWinFrameInfo->Function, WinFrameInfos.push_back(new WinEH::FrameInfo(CurrentWinFrameInfo->Function,
@ -432,7 +432,7 @@ void MCStreamer::EmitWinCFIEndChained() {
if (!CurrentWinFrameInfo->ChainedParent) if (!CurrentWinFrameInfo->ChainedParent)
report_fatal_error("End of a chained region outside a chained region!"); report_fatal_error("End of a chained region outside a chained region!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
CurrentWinFrameInfo->End = Label; CurrentWinFrameInfo->End = Label;
@ -463,7 +463,7 @@ void MCStreamer::EmitWinEHHandlerData() {
void MCStreamer::EmitWinCFIPushReg(unsigned Register) { void MCStreamer::EmitWinCFIPushReg(unsigned Register) {
EnsureValidWinFrameInfo(); EnsureValidWinFrameInfo();
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = Win64EH::Instruction::PushNonVol(Label, Register); WinEH::Instruction Inst = Win64EH::Instruction::PushNonVol(Label, Register);
@ -479,7 +479,7 @@ void MCStreamer::EmitWinCFISetFrame(unsigned Register, unsigned Offset) {
if (Offset > 240) if (Offset > 240)
report_fatal_error("Frame offset must be less than or equal to 240!"); report_fatal_error("Frame offset must be less than or equal to 240!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = WinEH::Instruction Inst =
@ -495,7 +495,7 @@ void MCStreamer::EmitWinCFIAllocStack(unsigned Size) {
if (Size & 7) if (Size & 7)
report_fatal_error("Misaligned stack allocation!"); report_fatal_error("Misaligned stack allocation!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = Win64EH::Instruction::Alloc(Label, Size); WinEH::Instruction Inst = Win64EH::Instruction::Alloc(Label, Size);
@ -507,7 +507,7 @@ void MCStreamer::EmitWinCFISaveReg(unsigned Register, unsigned Offset) {
if (Offset & 7) if (Offset & 7)
report_fatal_error("Misaligned saved register offset!"); report_fatal_error("Misaligned saved register offset!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = WinEH::Instruction Inst =
@ -520,7 +520,7 @@ void MCStreamer::EmitWinCFISaveXMM(unsigned Register, unsigned Offset) {
if (Offset & 0x0F) if (Offset & 0x0F)
report_fatal_error("Misaligned saved vector register offset!"); report_fatal_error("Misaligned saved vector register offset!");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = WinEH::Instruction Inst =
@ -533,7 +533,7 @@ void MCStreamer::EmitWinCFIPushFrame(bool Code) {
if (CurrentWinFrameInfo->Instructions.size() > 0) if (CurrentWinFrameInfo->Instructions.size() > 0)
report_fatal_error("If present, PushMachFrame must be the first UOP"); report_fatal_error("If present, PushMachFrame must be the first UOP");
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
WinEH::Instruction Inst = Win64EH::Instruction::PushMachFrame(Label, Code); WinEH::Instruction Inst = Win64EH::Instruction::PushMachFrame(Label, Code);
@ -543,7 +543,7 @@ void MCStreamer::EmitWinCFIPushFrame(bool Code) {
void MCStreamer::EmitWinCFIEndProlog() { void MCStreamer::EmitWinCFIEndProlog() {
EnsureValidWinFrameInfo(); EnsureValidWinFrameInfo();
MCSymbol *Label = getContext().CreateTempSymbol(); MCSymbol *Label = getContext().createTempSymbol();
EmitLabel(Label); EmitLabel(Label);
CurrentWinFrameInfo->PrologEnd = Label; CurrentWinFrameInfo->PrologEnd = Label;

View File

@ -153,7 +153,7 @@ static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
return; return;
MCContext &context = streamer.getContext(); MCContext &context = streamer.getContext();
MCSymbol *Label = context.CreateTempSymbol(); MCSymbol *Label = context.createTempSymbol();
streamer.EmitValueToAlignment(4); streamer.EmitValueToAlignment(4);
streamer.EmitLabel(Label); streamer.EmitLabel(Label);

View File

@ -687,7 +687,7 @@ void WinCOFFObjectWriter::RecordRelocation(
const MCSymbol &Symbol = Target.getSymA()->getSymbol(); const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &A = Symbol; const MCSymbol &A = Symbol;
if (!Asm.hasSymbolData(A)) if (!Asm.hasSymbolData(A))
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
Twine("symbol '") + A.getName() + "' can not be undefined"); Twine("symbol '") + A.getName() + "' can not be undefined");
@ -710,13 +710,13 @@ void WinCOFFObjectWriter::RecordRelocation(
const MCSymbol *B = &SymB->getSymbol(); const MCSymbol *B = &SymB->getSymbol();
const MCSymbolData &B_SD = Asm.getSymbolData(*B); const MCSymbolData &B_SD = Asm.getSymbolData(*B);
if (!B_SD.getFragment()) if (!B_SD.getFragment())
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
Twine("symbol '") + B->getName() + Twine("symbol '") + B->getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
if (!A_SD.getFragment()) if (!A_SD.getFragment())
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
Twine("symbol '") + Symbol.getName() + Twine("symbol '") + Symbol.getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");

View File

@ -269,7 +269,7 @@ void MCWinCOFFStreamer::FinishImpl() {
LLVM_ATTRIBUTE_NORETURN LLVM_ATTRIBUTE_NORETURN
void MCWinCOFFStreamer::FatalError(const Twine &Msg) const { void MCWinCOFFStreamer::FatalError(const Twine &Msg) const {
getContext().FatalError(SMLoc(), Msg); getContext().reportFatalError(SMLoc(), Msg);
} }
} }

View File

@ -172,11 +172,11 @@ MCSymbol *AArch64AsmPrinter::GetCPISymbol(unsigned CPID) const {
// avoid addends on the relocation?), ELF has no such concept and // avoid addends on the relocation?), ELF has no such concept and
// uses a normal private symbol. // uses a normal private symbol.
if (getDataLayout().getLinkerPrivateGlobalPrefix()[0]) if (getDataLayout().getLinkerPrivateGlobalPrefix()[0])
return OutContext.GetOrCreateSymbol( return OutContext.getOrCreateSymbol(
Twine(getDataLayout().getLinkerPrivateGlobalPrefix()) + "CPI" + Twine(getDataLayout().getLinkerPrivateGlobalPrefix()) + "CPI" +
Twine(getFunctionNumber()) + "_" + Twine(CPID)); Twine(getFunctionNumber()) + "_" + Twine(CPID));
return OutContext.GetOrCreateSymbol( return OutContext.getOrCreateSymbol(
Twine(getDataLayout().getPrivateGlobalPrefix()) + "CPI" + Twine(getDataLayout().getPrivateGlobalPrefix()) + "CPI" +
Twine(getFunctionNumber()) + "_" + Twine(CPID)); Twine(getFunctionNumber()) + "_" + Twine(CPID));
} }

View File

@ -302,7 +302,7 @@ void AArch64FrameLowering::emitPrologue(MachineFunction &MF,
AFI->setLocalStackSize(NumBytes); AFI->setLocalStackSize(NumBytes);
// Label used to tie together the PROLOG_LABEL and the MachineMoves. // Label used to tie together the PROLOG_LABEL and the MachineMoves.
MCSymbol *FrameLabel = MMI.getContext().CreateTempSymbol(); MCSymbol *FrameLabel = MMI.getContext().createTempSymbol();
// REDZONE: If the stack size is less than 128 bytes, we don't need // REDZONE: If the stack size is less than 128 bytes, we don't need
// to actually allocate. // to actually allocate.

View File

@ -41,7 +41,7 @@ const MCExpr *AArch64_MachoTargetObjectFile::getTTypeGlobalReference(
const MCSymbol *Sym = TM.getSymbol(GV, Mang); const MCSymbol *Sym = TM.getSymbol(GV, Mang);
const MCExpr *Res = const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, getContext()); MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
MCSymbol *PCSym = getContext().CreateTempSymbol(); MCSymbol *PCSym = getContext().createTempSymbol();
Streamer.EmitLabel(PCSym); Streamer.EmitLabel(PCSym);
const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext()); const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext());
return MCBinaryExpr::CreateSub(Res, PC, getContext()); return MCBinaryExpr::CreateSub(Res, PC, getContext());
@ -66,7 +66,7 @@ const MCExpr *AArch64_MachoTargetObjectFile::getIndirectSymViaGOTPCRel(
// is an indirect pc-relative reference. // is an indirect pc-relative reference.
const MCExpr *Res = const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, getContext()); MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, getContext());
MCSymbol *PCSym = getContext().CreateTempSymbol(); MCSymbol *PCSym = getContext().createTempSymbol();
Streamer.EmitLabel(PCSym); Streamer.EmitLabel(PCSym);
const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext()); const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext());
return MCBinaryExpr::CreateSub(Res, PC, getContext()); return MCBinaryExpr::CreateSub(Res, PC, getContext());

View File

@ -4104,7 +4104,7 @@ bool AArch64AsmParser::parseDirectiveTLSDescCall(SMLoc L) {
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return Error(L, "expected symbol after directive"); return Error(L, "expected symbol after directive");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
const MCExpr *Expr = MCSymbolRefExpr::Create(Sym, getContext()); const MCExpr *Expr = MCSymbolRefExpr::Create(Sym, getContext());
Expr = AArch64MCExpr::Create(Expr, AArch64MCExpr::VK_TLSDESC, getContext()); Expr = AArch64MCExpr::Create(Expr, AArch64MCExpr::VK_TLSDESC, getContext());
@ -4153,7 +4153,7 @@ bool AArch64AsmParser::parseDirectiveLOH(StringRef IDVal, SMLoc Loc) {
StringRef Name; StringRef Name;
if (getParser().parseIdentifier(Name)) if (getParser().parseIdentifier(Name))
return TokError("expected identifier in directive"); return TokError("expected identifier in directive");
Args.push_back(getContext().GetOrCreateSymbol(Name)); Args.push_back(getContext().getOrCreateSymbol(Name));
if (Idx + 1 == NbArgs) if (Idx + 1 == NbArgs)
break; break;

View File

@ -165,7 +165,7 @@ bool AArch64ExternalSymbolizer::tryAddingSymbolicOperand(
if (SymbolicOp.AddSymbol.Present) { if (SymbolicOp.AddSymbol.Present) {
if (SymbolicOp.AddSymbol.Name) { if (SymbolicOp.AddSymbol.Name) {
StringRef Name(SymbolicOp.AddSymbol.Name); StringRef Name(SymbolicOp.AddSymbol.Name);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
MCSymbolRefExpr::VariantKind Variant = getVariant(SymbolicOp.VariantKind); MCSymbolRefExpr::VariantKind Variant = getVariant(SymbolicOp.VariantKind);
if (Variant != MCSymbolRefExpr::VK_None) if (Variant != MCSymbolRefExpr::VK_None)
Add = MCSymbolRefExpr::Create(Sym, Variant, Ctx); Add = MCSymbolRefExpr::Create(Sym, Variant, Ctx);
@ -180,7 +180,7 @@ bool AArch64ExternalSymbolizer::tryAddingSymbolicOperand(
if (SymbolicOp.SubtractSymbol.Present) { if (SymbolicOp.SubtractSymbol.Present) {
if (SymbolicOp.SubtractSymbol.Name) { if (SymbolicOp.SubtractSymbol.Name) {
StringRef Name(SymbolicOp.SubtractSymbol.Name); StringRef Name(SymbolicOp.SubtractSymbol.Name);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
Sub = MCSymbolRefExpr::Create(Sym, Ctx); Sub = MCSymbolRefExpr::Create(Sym, Ctx);
} else { } else {
Sub = MCConstantExpr::Create(SymbolicOp.SubtractSymbol.Value, Ctx); Sub = MCConstantExpr::Create(SymbolicOp.SubtractSymbol.Value, Ctx);

View File

@ -167,10 +167,10 @@ private:
} }
void EmitMappingSymbol(StringRef Name) { void EmitMappingSymbol(StringRef Name) {
MCSymbol *Start = getContext().CreateTempSymbol(); MCSymbol *Start = getContext().createTempSymbol();
EmitLabel(Start); EmitLabel(Start);
MCSymbol *Symbol = getContext().GetOrCreateSymbol( MCSymbol *Symbol = getContext().getOrCreateSymbol(
Name + "." + Twine(MappingSymbolCounter++)); Name + "." + Twine(MappingSymbolCounter++));
MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);

View File

@ -63,7 +63,7 @@ const MCExpr *AArch64MCAsmInfoDarwin::getExprForPersonalitySymbol(
MCContext &Context = Streamer.getContext(); MCContext &Context = Streamer.getContext();
const MCExpr *Res = const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, Context); MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOT, Context);
MCSymbol *PCSym = Context.CreateTempSymbol(); MCSymbol *PCSym = Context.createTempSymbol();
Streamer.EmitLabel(PCSym); Streamer.EmitLabel(PCSym);
const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, Context); const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, Context);
return MCBinaryExpr::CreateSub(Res, PC, Context); return MCBinaryExpr::CreateSub(Res, PC, Context);

View File

@ -92,7 +92,7 @@ bool AArch64MachObjectWriter::getAArch64FixupKindMachOInfo(
// This encompasses the relocation for the whole 21-bit value. // This encompasses the relocation for the whole 21-bit value.
switch (Sym->getKind()) { switch (Sym->getKind()) {
default: default:
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"ADR/ADRP relocations must be GOT relative"); "ADR/ADRP relocations must be GOT relative");
case MCSymbolRefExpr::VK_PAGE: case MCSymbolRefExpr::VK_PAGE:
RelocType = unsigned(MachO::ARM64_RELOC_PAGE21); RelocType = unsigned(MachO::ARM64_RELOC_PAGE21);
@ -172,7 +172,7 @@ void AArch64MachObjectWriter::RecordRelocation(
// assembler local symbols. If we got here, that's not what we have, // assembler local symbols. If we got here, that's not what we have,
// so complain loudly. // so complain loudly.
if (Kind == AArch64::fixup_aarch64_pcrel_branch19) { if (Kind == AArch64::fixup_aarch64_pcrel_branch19) {
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"conditional branch requires assembler-local" "conditional branch requires assembler-local"
" label. '" + " label. '" +
Target.getSymA()->getSymbol().getName() + Target.getSymA()->getSymbol().getName() +
@ -183,14 +183,14 @@ void AArch64MachObjectWriter::RecordRelocation(
// 14-bit branch relocations should only target internal labels, and so // 14-bit branch relocations should only target internal labels, and so
// should never get here. // should never get here.
if (Kind == AArch64::fixup_aarch64_pcrel_branch14) { if (Kind == AArch64::fixup_aarch64_pcrel_branch14) {
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"Invalid relocation on conditional branch!"); "Invalid relocation on conditional branch!");
return; return;
} }
if (!getAArch64FixupKindMachOInfo(Fixup, Type, Target.getSymA(), Log2Size, if (!getAArch64FixupKindMachOInfo(Fixup, Type, Target.getSymA(), Log2Size,
Asm)) { Asm)) {
Asm.getContext().FatalError(Fixup.getLoc(), "unknown AArch64 fixup kind!"); Asm.getContext().reportFatalError(Fixup.getLoc(), "unknown AArch64 fixup kind!");
return; return;
} }
@ -202,7 +202,7 @@ void AArch64MachObjectWriter::RecordRelocation(
Type = MachO::ARM64_RELOC_UNSIGNED; Type = MachO::ARM64_RELOC_UNSIGNED;
if (IsPCRel) { if (IsPCRel) {
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"PC relative absolute relocation!"); "PC relative absolute relocation!");
// FIXME: x86_64 sets the type to a branch reloc here. Should we do // FIXME: x86_64 sets the type to a branch reloc here. Should we do
@ -235,12 +235,12 @@ void AArch64MachObjectWriter::RecordRelocation(
} else if (Target.getSymA()->getKind() != MCSymbolRefExpr::VK_None || } else if (Target.getSymA()->getKind() != MCSymbolRefExpr::VK_None ||
Target.getSymB()->getKind() != MCSymbolRefExpr::VK_None) Target.getSymB()->getKind() != MCSymbolRefExpr::VK_None)
// Otherwise, neither symbol can be modified. // Otherwise, neither symbol can be modified.
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported relocation of modified symbol"); "unsupported relocation of modified symbol");
// We don't support PCrel relocations of differences. // We don't support PCrel relocations of differences.
if (IsPCRel) if (IsPCRel)
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported pc-relative relocation of " "unsupported pc-relative relocation of "
"difference"); "difference");
@ -251,18 +251,18 @@ void AArch64MachObjectWriter::RecordRelocation(
// FIXME: We should probably just synthesize an external symbol and use // FIXME: We should probably just synthesize an external symbol and use
// that. // that.
if (!A_Base) if (!A_Base)
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
"unsupported relocation of local symbol '" + A->getName() + "unsupported relocation of local symbol '" + A->getName() +
"'. Must have non-local symbol earlier in section."); "'. Must have non-local symbol earlier in section.");
if (!B_Base) if (!B_Base)
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
"unsupported relocation of local symbol '" + B->getName() + "unsupported relocation of local symbol '" + B->getName() +
"'. Must have non-local symbol earlier in section."); "'. Must have non-local symbol earlier in section.");
if (A_Base == B_Base && A_Base) if (A_Base == B_Base && A_Base)
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported relocation with identical base"); "unsupported relocation with identical base");
Value += Value +=
@ -319,7 +319,7 @@ void AArch64MachObjectWriter::RecordRelocation(
// the FixedValue? // the FixedValue?
if (!Symbol->getVariableValue()->EvaluateAsRelocatable(Target, &Layout, if (!Symbol->getVariableValue()->EvaluateAsRelocatable(Target, &Layout,
&Fixup)) &Fixup))
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unable to resolve variable '" + "unable to resolve variable '" +
Symbol->getName() + "'"); Symbol->getName() + "'");
return RecordRelocation(Writer, Asm, Layout, Fragment, Fixup, Target, return RecordRelocation(Writer, Asm, Layout, Fragment, Fixup, Target,
@ -347,7 +347,7 @@ void AArch64MachObjectWriter::RecordRelocation(
Layout.getSymbolOffset(&Base->getData()); Layout.getSymbolOffset(&Base->getData());
} else if (Symbol->isInSection()) { } else if (Symbol->isInSection()) {
if (!CanUseLocalRelocation) if (!CanUseLocalRelocation)
Asm.getContext().FatalError( Asm.getContext().reportFatalError(
Fixup.getLoc(), Fixup.getLoc(),
"unsupported relocation of local symbol '" + Symbol->getName() + "unsupported relocation of local symbol '" + Symbol->getName() +
"'. Must have non-local symbol earlier in section."); "'. Must have non-local symbol earlier in section.");
@ -371,7 +371,7 @@ void AArch64MachObjectWriter::RecordRelocation(
return; return;
} }
} }
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported relocation of variable '" + "unsupported relocation of variable '" +
Symbol->getName() + "'"); Symbol->getName() + "'");
} }

View File

@ -202,7 +202,7 @@ GetARMJTIPICJumpTableLabel(unsigned uid) const {
SmallString<60> Name; SmallString<60> Name;
raw_svector_ostream(Name) << DL->getPrivateGlobalPrefix() << "JTI" raw_svector_ostream(Name) << DL->getPrivateGlobalPrefix() << "JTI"
<< getFunctionNumber() << '_' << uid; << getFunctionNumber() << '_' << uid;
return OutContext.GetOrCreateSymbol(Name); return OutContext.getOrCreateSymbol(Name);
} }
@ -211,7 +211,7 @@ MCSymbol *ARMAsmPrinter::GetARMSJLJEHLabel() const {
SmallString<60> Name; SmallString<60> Name;
raw_svector_ostream(Name) << DL->getPrivateGlobalPrefix() << "SJLJEH" raw_svector_ostream(Name) << DL->getPrivateGlobalPrefix() << "SJLJEH"
<< getFunctionNumber(); << getFunctionNumber();
return OutContext.GetOrCreateSymbol(Name); return OutContext.getOrCreateSymbol(Name);
} }
bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, bool ARMAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
@ -806,7 +806,7 @@ void ARMAsmPrinter::emitAttributes() {
static MCSymbol *getPICLabel(const char *Prefix, unsigned FunctionNumber, static MCSymbol *getPICLabel(const char *Prefix, unsigned FunctionNumber,
unsigned LabelId, MCContext &Ctx) { unsigned LabelId, MCContext &Ctx) {
MCSymbol *Label = Ctx.GetOrCreateSymbol(Twine(Prefix) MCSymbol *Label = Ctx.getOrCreateSymbol(Twine(Prefix)
+ "PC" + Twine(FunctionNumber) + "_" + Twine(LabelId)); + "PC" + Twine(FunctionNumber) + "_" + Twine(LabelId));
return Label; return Label;
} }
@ -856,7 +856,7 @@ MCSymbol *ARMAsmPrinter::GetARMGVSymbol(const GlobalValue *GV,
Name = "__imp_"; Name = "__imp_";
getNameWithPrefix(Name, GV); getNameWithPrefix(Name, GV);
return OutContext.GetOrCreateSymbol(Name); return OutContext.getOrCreateSymbol(Name);
} else if (Subtarget->isTargetELF()) { } else if (Subtarget->isTargetELF()) {
return getSymbol(GV); return getSymbol(GV);
} }
@ -912,7 +912,7 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
if (ACPV->mustAddCurrentAddress()) { if (ACPV->mustAddCurrentAddress()) {
// We want "(<expr> - .)", but MC doesn't have a concept of the '.' // We want "(<expr> - .)", but MC doesn't have a concept of the '.'
// label, so just emit a local label end reference that instead. // label, so just emit a local label end reference that instead.
MCSymbol *DotSym = OutContext.CreateTempSymbol(); MCSymbol *DotSym = OutContext.createTempSymbol();
OutStreamer->EmitLabel(DotSym); OutStreamer->EmitLabel(DotSym);
const MCExpr *DotExpr = MCSymbolRefExpr::Create(DotSym, OutContext); const MCExpr *DotExpr = MCSymbolRefExpr::Create(DotSym, OutContext);
PCRelExpr = MCBinaryExpr::CreateSub(PCRelExpr, DotExpr, OutContext); PCRelExpr = MCBinaryExpr::CreateSub(PCRelExpr, DotExpr, OutContext);
@ -1281,7 +1281,7 @@ void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
} }
if (!TRegSym) { if (!TRegSym) {
TRegSym = OutContext.CreateTempSymbol(); TRegSym = OutContext.createTempSymbol();
ThumbIndirectPads.push_back(std::make_pair(TReg, TRegSym)); ThumbIndirectPads.push_back(std::make_pair(TReg, TRegSym));
} }

View File

@ -6749,7 +6749,7 @@ bool ARMAsmParser::processInstruction(MCInst &Inst,
// Turn PC-relative expression into absolute expression. // Turn PC-relative expression into absolute expression.
// Reading PC provides the start of the current instruction + 8 and // Reading PC provides the start of the current instruction + 8 and
// the transform to adr is biased by that. // the transform to adr is biased by that.
MCSymbol *Dot = getContext().CreateTempSymbol(); MCSymbol *Dot = getContext().createTempSymbol();
Out.EmitLabel(Dot); Out.EmitLabel(Dot);
const MCExpr *OpExpr = Inst.getOperand(2).getExpr(); const MCExpr *OpExpr = Inst.getOperand(2).getExpr();
const MCExpr *InstPC = MCSymbolRefExpr::Create(Dot, const MCExpr *InstPC = MCSymbolRefExpr::Create(Dot,
@ -8896,7 +8896,7 @@ bool ARMAsmParser::parseDirectiveThumbFunc(SMLoc L) {
} }
MCSymbol *Func = MCSymbol *Func =
getParser().getContext().GetOrCreateSymbol(Tok.getIdentifier()); getParser().getContext().getOrCreateSymbol(Tok.getIdentifier());
getParser().getStreamer().EmitThumbFunc(Func); getParser().getStreamer().EmitThumbFunc(Func);
Parser.Lex(); // Consume the identifier token. Parser.Lex(); // Consume the identifier token.
return false; return false;
@ -9362,7 +9362,7 @@ bool ARMAsmParser::parseDirectivePersonality(SMLoc L) {
StringRef Name(Parser.getTok().getIdentifier()); StringRef Name(Parser.getTok().getIdentifier());
Parser.Lex(); Parser.Lex();
MCSymbol *PR = getParser().getContext().GetOrCreateSymbol(Name); MCSymbol *PR = getParser().getContext().getOrCreateSymbol(Name);
getTargetStreamer().emitPersonality(PR); getTargetStreamer().emitPersonality(PR);
return false; return false;
} }
@ -9963,7 +9963,7 @@ bool ARMAsmParser::parseDirectiveThumbSet(SMLoc L) {
} }
Lex(); Lex();
MCSymbol *Alias = getContext().GetOrCreateSymbol(Name); MCSymbol *Alias = getContext().getOrCreateSymbol(Name);
getTargetStreamer().emitThumbSet(Alias, Value); getTargetStreamer().emitThumbSet(Alias, Value);
return false; return false;
} }

View File

@ -373,7 +373,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
isAdd = false; isAdd = false;
} }
if (Ctx && Value >= 4096) if (Ctx && Value >= 4096)
Ctx->FatalError(Fixup.getLoc(), "out of range pc-relative fixup value"); Ctx->reportFatalError(Fixup.getLoc(), "out of range pc-relative fixup value");
Value |= isAdd << 23; Value |= isAdd << 23;
// Same addressing mode as fixup_arm_pcrel_10, // Same addressing mode as fixup_arm_pcrel_10,
@ -394,7 +394,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
opc = 2; // 0b0010 opc = 2; // 0b0010
} }
if (Ctx && ARM_AM::getSOImmVal(Value) == -1) if (Ctx && ARM_AM::getSOImmVal(Value) == -1)
Ctx->FatalError(Fixup.getLoc(), "out of range pc-relative fixup value"); Ctx->reportFatalError(Fixup.getLoc(), "out of range pc-relative fixup value");
// Encode the immediate and shift the opcode into place. // Encode the immediate and shift the opcode into place.
return ARM_AM::getSOImmVal(Value) | (opc << 21); return ARM_AM::getSOImmVal(Value) | (opc << 21);
} }
@ -543,7 +543,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
} }
// The value has the low 4 bits encoded in [3:0] and the high 4 in [11:8]. // The value has the low 4 bits encoded in [3:0] and the high 4 in [11:8].
if (Ctx && Value >= 256) if (Ctx && Value >= 256)
Ctx->FatalError(Fixup.getLoc(), "out of range pc-relative fixup value"); Ctx->reportFatalError(Fixup.getLoc(), "out of range pc-relative fixup value");
Value = (Value & 0xf) | ((Value & 0xf0) << 4); Value = (Value & 0xf) | ((Value & 0xf0) << 4);
return Value | (isAdd << 23); return Value | (isAdd << 23);
} }
@ -562,7 +562,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
// These values don't encode the low two bits since they're always zero. // These values don't encode the low two bits since they're always zero.
Value >>= 2; Value >>= 2;
if (Ctx && Value >= 256) if (Ctx && Value >= 256)
Ctx->FatalError(Fixup.getLoc(), "out of range pc-relative fixup value"); Ctx->reportFatalError(Fixup.getLoc(), "out of range pc-relative fixup value");
Value |= isAdd << 23; Value |= isAdd << 23;
// Same addressing mode as fixup_arm_pcrel_10, but with 16-bit halfwords // Same addressing mode as fixup_arm_pcrel_10, but with 16-bit halfwords

View File

@ -508,7 +508,7 @@ public:
const SMLoc &Loc) override { const SMLoc &Loc) override {
if (const MCSymbolRefExpr *SRE = dyn_cast_or_null<MCSymbolRefExpr>(Value)) if (const MCSymbolRefExpr *SRE = dyn_cast_or_null<MCSymbolRefExpr>(Value))
if (SRE->getKind() == MCSymbolRefExpr::VK_ARM_SBREL && !(Size == 4)) if (SRE->getKind() == MCSymbolRefExpr::VK_ARM_SBREL && !(Size == 4))
getContext().FatalError(Loc, "relocated expression must be 32-bit"); getContext().reportFatalError(Loc, "relocated expression must be 32-bit");
EmitDataMappingSymbol(); EmitDataMappingSymbol();
MCELFStreamer::EmitValueImpl(Value, Size); MCELFStreamer::EmitValueImpl(Value, Size);
@ -560,11 +560,11 @@ private:
} }
void EmitMappingSymbol(StringRef Name) { void EmitMappingSymbol(StringRef Name) {
MCSymbol *Start = getContext().CreateTempSymbol(); MCSymbol *Start = getContext().createTempSymbol();
EmitLabel(Start); EmitLabel(Start);
MCSymbol *Symbol = MCSymbol *Symbol =
getContext().GetOrCreateSymbol(Name + "." + getContext().getOrCreateSymbol(Name + "." +
Twine(MappingSymbolCounter++)); Twine(MappingSymbolCounter++));
MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol);
@ -1078,7 +1078,7 @@ void ARMELFStreamer::Reset() {
void ARMELFStreamer::emitFnStart() { void ARMELFStreamer::emitFnStart() {
assert(FnStart == nullptr); assert(FnStart == nullptr);
FnStart = getContext().CreateTempSymbol(); FnStart = getContext().createTempSymbol();
EmitLabel(FnStart); EmitLabel(FnStart);
} }
@ -1137,7 +1137,7 @@ void ARMELFStreamer::emitCantUnwind() { CantUnwind = true; }
// Add the R_ARM_NONE fixup at the same position // Add the R_ARM_NONE fixup at the same position
void ARMELFStreamer::EmitPersonalityFixup(StringRef Name) { void ARMELFStreamer::EmitPersonalityFixup(StringRef Name) {
const MCSymbol *PersonalitySym = getContext().GetOrCreateSymbol(Name); const MCSymbol *PersonalitySym = getContext().getOrCreateSymbol(Name);
const MCSymbolRefExpr *PersonalityRef = MCSymbolRefExpr::Create( const MCSymbolRefExpr *PersonalityRef = MCSymbolRefExpr::Create(
PersonalitySym, MCSymbolRefExpr::VK_ARM_NONE, getContext()); PersonalitySym, MCSymbolRefExpr::VK_ARM_NONE, getContext());
@ -1181,7 +1181,7 @@ void ARMELFStreamer::FlushUnwindOpcodes(bool NoHandlerData) {
// Create .ARM.extab label for offset in .ARM.exidx // Create .ARM.extab label for offset in .ARM.exidx
assert(!ExTab); assert(!ExTab);
ExTab = getContext().CreateTempSymbol(); ExTab = getContext().createTempSymbol();
EmitLabel(ExTab); EmitLabel(ExTab);
// Emit personality // Emit personality

View File

@ -155,7 +155,7 @@ RecordARMScatteredHalfRelocation(MachObjectWriter *Writer,
const MCSymbolData *A_SD = &Asm.getSymbolData(*A); const MCSymbolData *A_SD = &Asm.getSymbolData(*A);
if (!A_SD->getFragment()) if (!A_SD->getFragment())
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"symbol '" + A->getName() + "symbol '" + A->getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
@ -169,7 +169,7 @@ RecordARMScatteredHalfRelocation(MachObjectWriter *Writer,
const MCSymbolData *B_SD = &Asm.getSymbolData(B->getSymbol()); const MCSymbolData *B_SD = &Asm.getSymbolData(B->getSymbol());
if (!B_SD->getFragment()) if (!B_SD->getFragment())
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"symbol '" + B->getSymbol().getName() + "symbol '" + B->getSymbol().getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
@ -258,7 +258,7 @@ void ARMMachObjectWriter::RecordARMScatteredRelocation(MachObjectWriter *Writer,
const MCSymbolData *A_SD = &Asm.getSymbolData(*A); const MCSymbolData *A_SD = &Asm.getSymbolData(*A);
if (!A_SD->getFragment()) if (!A_SD->getFragment())
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"symbol '" + A->getName() + "symbol '" + A->getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
@ -272,7 +272,7 @@ void ARMMachObjectWriter::RecordARMScatteredRelocation(MachObjectWriter *Writer,
const MCSymbolData *B_SD = &Asm.getSymbolData(B->getSymbol()); const MCSymbolData *B_SD = &Asm.getSymbolData(B->getSymbol());
if (!B_SD->getFragment()) if (!B_SD->getFragment())
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"symbol '" + B->getSymbol().getName() + "symbol '" + B->getSymbol().getName() +
"' can not be undefined in a subtraction expression"); "' can not be undefined in a subtraction expression");
@ -359,7 +359,7 @@ void ARMMachObjectWriter::RecordRelocation(MachObjectWriter *Writer,
// relocation type for the fixup kind. This happens when it's a fixup that's // relocation type for the fixup kind. This happens when it's a fixup that's
// expected to always be resolvable at assembly time and not have any // expected to always be resolvable at assembly time and not have any
// relocations needed. // relocations needed.
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported relocation on symbol"); "unsupported relocation on symbol");
// If this is a difference or a defined symbol plus an offset, then we need a // If this is a difference or a defined symbol plus an offset, then we need a

View File

@ -472,7 +472,7 @@ void HexagonFrameLowering::insertPrologueInBlock(MachineBasicBlock &MBB) const {
if (needsFrameMoves) { if (needsFrameMoves) {
std::vector<MCCFIInstruction> Instructions = MMI.getFrameInstructions(); std::vector<MCCFIInstruction> Instructions = MMI.getFrameInstructions();
MCSymbol *FrameLabel = MMI.getContext().CreateTempSymbol(); MCSymbol *FrameLabel = MMI.getContext().createTempSymbol();
// Advance CFA. DW_CFA_def_cfa // Advance CFA. DW_CFA_def_cfa
unsigned DwFPReg = HRI.getDwarfRegNum(HRI.getFrameRegister(), true); unsigned DwFPReg = HRI.getDwarfRegNum(HRI.getFrameRegister(), true);

View File

@ -62,7 +62,7 @@ GetJumpTableSymbol(const MachineOperand &MO) const {
} }
// Create a symbol for the name. // Create a symbol for the name.
return Ctx.GetOrCreateSymbol(Name); return Ctx.getOrCreateSymbol(Name);
} }
MCSymbol *MSP430MCInstLower:: MCSymbol *MSP430MCInstLower::
@ -79,7 +79,7 @@ GetConstantPoolIndexSymbol(const MachineOperand &MO) const {
} }
// Create a symbol for the name. // Create a symbol for the name.
return Ctx.GetOrCreateSymbol(Name); return Ctx.getOrCreateSymbol(Name);
} }
MCSymbol *MSP430MCInstLower:: MCSymbol *MSP430MCInstLower::

View File

@ -2495,7 +2495,7 @@ bool MipsAsmParser::parseOperand(OperandVector &Operands, StringRef Mnemonic) {
return true; return true;
SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1); SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
MCSymbol *Sym = getContext().GetOrCreateSymbol("$" + Identifier); MCSymbol *Sym = getContext().getOrCreateSymbol("$" + Identifier);
// Otherwise create a symbol reference. // Otherwise create a symbol reference.
const MCExpr *Res = const MCExpr *Res =
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, getContext()); MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, getContext());
@ -2796,7 +2796,7 @@ MipsAsmParser::parseMemOperand(OperandVector &Operands) {
bool MipsAsmParser::searchSymbolAlias(OperandVector &Operands) { bool MipsAsmParser::searchSymbolAlias(OperandVector &Operands) {
MCAsmParser &Parser = getParser(); MCAsmParser &Parser = getParser();
MCSymbol *Sym = getContext().LookupSymbol(Parser.getTok().getIdentifier()); MCSymbol *Sym = getContext().lookupSymbol(Parser.getTok().getIdentifier());
if (Sym) { if (Sym) {
SMLoc S = Parser.getTok().getLoc(); SMLoc S = Parser.getTok().getLoc();
const MCExpr *Expr; const MCExpr *Expr;
@ -3629,7 +3629,7 @@ bool MipsAsmParser::parseSetAssignment() {
if (Parser.parseExpression(Value)) if (Parser.parseExpression(Value))
return reportParseError("expected valid expression after comma"); return reportParseError("expected valid expression after comma");
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
Sym->setVariableValue(Value); Sym->setVariableValue(Value);
return false; return false;
@ -4291,7 +4291,7 @@ bool MipsAsmParser::ParseDirective(AsmToken DirectiveID) {
return false; return false;
} }
MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName); MCSymbol *Sym = getContext().getOrCreateSymbol(SymbolName);
getTargetStreamer().emitDirectiveEnt(*Sym); getTargetStreamer().emitDirectiveEnt(*Sym);
CurrentFn = Sym; CurrentFn = Sym;

View File

@ -68,14 +68,14 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t)Value / 4; Value = (int64_t)Value / 4;
// We now check if Value can be encoded as a 16-bit signed immediate. // We now check if Value can be encoded as a 16-bit signed immediate.
if (!isIntN(16, Value) && Ctx) if (!isIntN(16, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC16 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC16 fixup");
break; break;
case Mips::fixup_MIPS_PC19_S2: case Mips::fixup_MIPS_PC19_S2:
// Forcing a signed division because Value can be negative. // Forcing a signed division because Value can be negative.
Value = (int64_t)Value / 4; Value = (int64_t)Value / 4;
// We now check if Value can be encoded as a 19-bit signed immediate. // We now check if Value can be encoded as a 19-bit signed immediate.
if (!isIntN(19, Value) && Ctx) if (!isIntN(19, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC19 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC19 fixup");
break; break;
case Mips::fixup_Mips_26: case Mips::fixup_Mips_26:
// So far we are only using this type for jumps. // So far we are only using this type for jumps.
@ -109,7 +109,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t) Value / 2; Value = (int64_t) Value / 2;
// We now check if Value can be encoded as a 7-bit signed immediate. // We now check if Value can be encoded as a 7-bit signed immediate.
if (!isIntN(7, Value) && Ctx) if (!isIntN(7, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC7 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC7 fixup");
break; break;
case Mips::fixup_MICROMIPS_PC10_S1: case Mips::fixup_MICROMIPS_PC10_S1:
Value -= 2; Value -= 2;
@ -117,7 +117,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t) Value / 2; Value = (int64_t) Value / 2;
// We now check if Value can be encoded as a 10-bit signed immediate. // We now check if Value can be encoded as a 10-bit signed immediate.
if (!isIntN(10, Value) && Ctx) if (!isIntN(10, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC10 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC10 fixup");
break; break;
case Mips::fixup_MICROMIPS_PC16_S1: case Mips::fixup_MICROMIPS_PC16_S1:
Value -= 4; Value -= 4;
@ -125,14 +125,14 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t)Value / 2; Value = (int64_t)Value / 2;
// We now check if Value can be encoded as a 16-bit signed immediate. // We now check if Value can be encoded as a 16-bit signed immediate.
if (!isIntN(16, Value) && Ctx) if (!isIntN(16, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC16 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC16 fixup");
break; break;
case Mips::fixup_MIPS_PC18_S3: case Mips::fixup_MIPS_PC18_S3:
// Forcing a signed division because Value can be negative. // Forcing a signed division because Value can be negative.
Value = (int64_t)Value / 8; Value = (int64_t)Value / 8;
// We now check if Value can be encoded as a 18-bit signed immediate. // We now check if Value can be encoded as a 18-bit signed immediate.
if (!isIntN(18, Value) && Ctx) if (!isIntN(18, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC18 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC18 fixup");
break; break;
case Mips::fixup_MIPS_PC21_S2: case Mips::fixup_MIPS_PC21_S2:
Value -= 4; Value -= 4;
@ -140,7 +140,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t) Value / 4; Value = (int64_t) Value / 4;
// We now check if Value can be encoded as a 21-bit signed immediate. // We now check if Value can be encoded as a 21-bit signed immediate.
if (!isIntN(21, Value) && Ctx) if (!isIntN(21, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC21 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC21 fixup");
break; break;
case Mips::fixup_MIPS_PC26_S2: case Mips::fixup_MIPS_PC26_S2:
Value -= 4; Value -= 4;
@ -148,7 +148,7 @@ static unsigned adjustFixupValue(const MCFixup &Fixup, uint64_t Value,
Value = (int64_t) Value / 4; Value = (int64_t) Value / 4;
// We now check if Value can be encoded as a 26-bit signed immediate. // We now check if Value can be encoded as a 26-bit signed immediate.
if (!isIntN(26, Value) && Ctx) if (!isIntN(26, Value) && Ctx)
Ctx->FatalError(Fixup.getLoc(), "out of range PC26 fixup"); Ctx->reportFatalError(Fixup.getLoc(), "out of range PC26 fixup");
break; break;
} }

View File

@ -692,7 +692,7 @@ void MipsTargetELFStreamer::emitDirectiveCpLoad(unsigned RegNo) {
StringRef SymName("_gp_disp"); StringRef SymName("_gp_disp");
MCAssembler &MCA = getStreamer().getAssembler(); MCAssembler &MCA = getStreamer().getAssembler();
MCSymbol *GP_Disp = MCA.getContext().GetOrCreateSymbol(SymName); MCSymbol *GP_Disp = MCA.getContext().getOrCreateSymbol(SymName);
MCA.getOrCreateSymbolData(*GP_Disp); MCA.getOrCreateSymbolData(*GP_Disp);
MCInst TmpInst; MCInst TmpInst;

View File

@ -893,7 +893,7 @@ void MipsAsmPrinter::EmitSwapFPIntRetval(
void MipsAsmPrinter::EmitFPCallStub( void MipsAsmPrinter::EmitFPCallStub(
const char *Symbol, const Mips16HardFloatInfo::FuncSignature *Signature) { const char *Symbol, const Mips16HardFloatInfo::FuncSignature *Signature) {
MCSymbol *MSymbol = OutContext.GetOrCreateSymbol(StringRef(Symbol)); MCSymbol *MSymbol = OutContext.getOrCreateSymbol(StringRef(Symbol));
using namespace Mips16HardFloatInfo; using namespace Mips16HardFloatInfo;
bool LE = getDataLayout().isLittleEndian(); bool LE = getDataLayout().isLittleEndian();
// Construct a local MCSubtargetInfo here. // Construct a local MCSubtargetInfo here.
@ -984,10 +984,10 @@ void MipsAsmPrinter::EmitFPCallStub(
// __call_stub_fp_xxxx: // __call_stub_fp_xxxx:
// //
std::string x = "__call_stub_fp_" + std::string(Symbol); std::string x = "__call_stub_fp_" + std::string(Symbol);
MCSymbol *Stub = OutContext.GetOrCreateSymbol(StringRef(x)); MCSymbol *Stub = OutContext.getOrCreateSymbol(StringRef(x));
TS.emitDirectiveEnt(*Stub); TS.emitDirectiveEnt(*Stub);
MCSymbol *MType = MCSymbol *MType =
OutContext.GetOrCreateSymbol("__call_stub_fp_" + Twine(Symbol)); OutContext.getOrCreateSymbol("__call_stub_fp_" + Twine(Symbol));
OutStreamer->EmitSymbolAttribute(MType, MCSA_ELF_TypeFunction); OutStreamer->EmitSymbolAttribute(MType, MCSA_ELF_TypeFunction);
OutStreamer->EmitLabel(Stub); OutStreamer->EmitLabel(Stub);
@ -1027,7 +1027,7 @@ void MipsAsmPrinter::EmitFPCallStub(
// else // else
EmitInstrReg(*STI, Mips::JR, Mips::S2); EmitInstrReg(*STI, Mips::JR, Mips::S2);
MCSymbol *Tmp = OutContext.CreateTempSymbol(); MCSymbol *Tmp = OutContext.createTempSymbol();
OutStreamer->EmitLabel(Tmp); OutStreamer->EmitLabel(Tmp);
const MCSymbolRefExpr *E = MCSymbolRefExpr::Create(Stub, OutContext); const MCSymbolRefExpr *E = MCSymbolRefExpr::Create(Stub, OutContext);
const MCSymbolRefExpr *T = MCSymbolRefExpr::Create(Tmp, OutContext); const MCSymbolRefExpr *T = MCSymbolRefExpr::Create(Tmp, OutContext);

View File

@ -225,7 +225,7 @@ void NVPTXAsmPrinter::lowerImageHandleSymbol(unsigned Index, MCOperand &MCOp) {
const char *Sym = MFI->getImageHandleSymbol(Index); const char *Sym = MFI->getImageHandleSymbol(Index);
std::string *SymNamePtr = std::string *SymNamePtr =
nvTM.getManagedStrPool()->getManagedString(Sym); nvTM.getManagedStrPool()->getManagedString(Sym);
MCOp = GetSymbolRef(OutContext.GetOrCreateSymbol( MCOp = GetSymbolRef(OutContext.getOrCreateSymbol(
StringRef(SymNamePtr->c_str()))); StringRef(SymNamePtr->c_str())));
} }
@ -235,7 +235,7 @@ void NVPTXAsmPrinter::lowerToMCInst(const MachineInstr *MI, MCInst &OutMI) {
if (MI->getOpcode() == NVPTX::CALL_PROTOTYPE) { if (MI->getOpcode() == NVPTX::CALL_PROTOTYPE) {
const MachineOperand &MO = MI->getOperand(0); const MachineOperand &MO = MI->getOperand(0);
OutMI.addOperand(GetSymbolRef( OutMI.addOperand(GetSymbolRef(
OutContext.GetOrCreateSymbol(Twine(MO.getSymbolName())))); OutContext.getOrCreateSymbol(Twine(MO.getSymbolName()))));
return; return;
} }

View File

@ -1861,7 +1861,7 @@ bool PPCAsmParser::ParseDirectiveLocalEntry(SMLoc L) {
Error(L, "expected identifier in directive"); Error(L, "expected identifier in directive");
return false; return false;
} }
MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); MCSymbol *Sym = getContext().getOrCreateSymbol(Name);
if (getLexer().isNot(AsmToken::Comma)) { if (getLexer().isNot(AsmToken::Comma)) {
Error(L, "unexpected token in directive"); Error(L, "unexpected token in directive");

View File

@ -244,7 +244,7 @@ bool PPCMachObjectWriter::RecordScatteredRelocation(
if (FixupOffset > 0xffffff) { if (FixupOffset > 0xffffff) {
char Buffer[32]; char Buffer[32];
format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer)); format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer));
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("Section too large, can't encode " Twine("Section too large, can't encode "
"r_address (") + "r_address (") +
Buffer + ") into 24 bits of scattered " Buffer + ") into 24 bits of scattered "

View File

@ -406,7 +406,7 @@ void PPCAsmPrinter::LowerPATCHPOINT(MCStreamer &OutStreamer, StackMaps &SM,
void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI, void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
MCSymbolRefExpr::VariantKind VK) { MCSymbolRefExpr::VariantKind VK) {
StringRef Name = "__tls_get_addr"; StringRef Name = "__tls_get_addr";
MCSymbol *TlsGetAddr = OutContext.GetOrCreateSymbol(Name); MCSymbol *TlsGetAddr = OutContext.getOrCreateSymbol(Name);
MCSymbolRefExpr::VariantKind Kind = MCSymbolRefExpr::VK_None; MCSymbolRefExpr::VariantKind Kind = MCSymbolRefExpr::VK_None;
assert(MI->getOperand(0).isReg() && assert(MI->getOperand(0).isReg() &&
@ -462,7 +462,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
// blrl // blrl
// This will return the pointer to _GLOBAL_OFFSET_TABLE_@local // This will return the pointer to _GLOBAL_OFFSET_TABLE_@local
MCSymbol *GOTSymbol = MCSymbol *GOTSymbol =
OutContext.GetOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_")); OutContext.getOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_"));
const MCExpr *OffsExpr = const MCExpr *OffsExpr =
MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(GOTSymbol, MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(GOTSymbol,
MCSymbolRefExpr::VK_PPC_LOCAL, MCSymbolRefExpr::VK_PPC_LOCAL,
@ -557,7 +557,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
MCSymbolRefExpr::Create(TOCEntry, MCSymbolRefExpr::VK_None, MCSymbolRefExpr::Create(TOCEntry, MCSymbolRefExpr::VK_None,
OutContext); OutContext);
const MCExpr *PB = const MCExpr *PB =
MCSymbolRefExpr::Create(OutContext.GetOrCreateSymbol(Twine(".LTOC")), MCSymbolRefExpr::Create(OutContext.getOrCreateSymbol(Twine(".LTOC")),
OutContext); OutContext);
Exp = MCBinaryExpr::CreateSub(Exp, PB, OutContext); Exp = MCBinaryExpr::CreateSub(Exp, PB, OutContext);
TmpInst.getOperand(1) = MCOperand::createExpr(Exp); TmpInst.getOperand(1) = MCOperand::createExpr(Exp);
@ -756,9 +756,9 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
} }
case PPC::PPC32PICGOT: { case PPC::PPC32PICGOT: {
MCSymbol *GOTSymbol = OutContext.GetOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_")); MCSymbol *GOTSymbol = OutContext.getOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_"));
MCSymbol *GOTRef = OutContext.CreateTempSymbol(); MCSymbol *GOTRef = OutContext.createTempSymbol();
MCSymbol *NextInstr = OutContext.CreateTempSymbol(); MCSymbol *NextInstr = OutContext.createTempSymbol();
EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::BL) EmitToStreamer(*OutStreamer, MCInstBuilder(PPC::BL)
// FIXME: We would like an efficient form for this, so we don't have to do // FIXME: We would like an efficient form for this, so we don't have to do
@ -784,7 +784,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return; return;
} }
case PPC::PPC32GOT: { case PPC::PPC32GOT: {
MCSymbol *GOTSymbol = OutContext.GetOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_")); MCSymbol *GOTSymbol = OutContext.getOrCreateSymbol(StringRef("_GLOBAL_OFFSET_TABLE_"));
const MCExpr *SymGotTlsL = const MCExpr *SymGotTlsL =
MCSymbolRefExpr::Create(GOTSymbol, MCSymbolRefExpr::VK_PPC_LO, MCSymbolRefExpr::Create(GOTSymbol, MCSymbolRefExpr::VK_PPC_LO,
OutContext); OutContext);
@ -1004,8 +1004,8 @@ void PPCLinuxAsmPrinter::EmitStartOfAsmFile(Module &M) {
OutStreamer->SwitchSection(OutContext.getELFSection( OutStreamer->SwitchSection(OutContext.getELFSection(
".got2", ELF::SHT_PROGBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC)); ".got2", ELF::SHT_PROGBITS, ELF::SHF_WRITE | ELF::SHF_ALLOC));
MCSymbol *TOCSym = OutContext.GetOrCreateSymbol(Twine(".LTOC")); MCSymbol *TOCSym = OutContext.getOrCreateSymbol(Twine(".LTOC"));
MCSymbol *CurrentPos = OutContext.CreateTempSymbol(); MCSymbol *CurrentPos = OutContext.createTempSymbol();
OutStreamer->EmitLabel(CurrentPos); OutStreamer->EmitLabel(CurrentPos);
@ -1037,7 +1037,7 @@ void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() {
const MCExpr *OffsExpr = const MCExpr *OffsExpr =
MCBinaryExpr::CreateSub( MCBinaryExpr::CreateSub(
MCSymbolRefExpr::Create(OutContext.GetOrCreateSymbol(Twine(".LTOC")), MCSymbolRefExpr::Create(OutContext.getOrCreateSymbol(Twine(".LTOC")),
OutContext), OutContext),
MCSymbolRefExpr::Create(PICBase, OutContext), MCSymbolRefExpr::Create(PICBase, OutContext),
OutContext); OutContext);
@ -1064,7 +1064,7 @@ void PPCLinuxAsmPrinter::EmitFunctionEntryLabel() {
// entry point. // entry point.
OutStreamer->EmitValue(MCSymbolRefExpr::Create(Symbol1, OutContext), OutStreamer->EmitValue(MCSymbolRefExpr::Create(Symbol1, OutContext),
8 /*size*/); 8 /*size*/);
MCSymbol *Symbol2 = OutContext.GetOrCreateSymbol(StringRef(".TOC.")); MCSymbol *Symbol2 = OutContext.getOrCreateSymbol(StringRef(".TOC."));
// Generates a R_PPC64_TOC relocation for TOC base insertion. // Generates a R_PPC64_TOC relocation for TOC base insertion.
OutStreamer->EmitValue( OutStreamer->EmitValue(
MCSymbolRefExpr::Create(Symbol2, MCSymbolRefExpr::VK_PPC_TOCBASE, OutContext), MCSymbolRefExpr::Create(Symbol2, MCSymbolRefExpr::VK_PPC_TOCBASE, OutContext),
@ -1130,12 +1130,12 @@ void PPCLinuxAsmPrinter::EmitFunctionBodyStart() {
// Only do all that if the function uses r2 in the first place. // Only do all that if the function uses r2 in the first place.
&& !MF->getRegInfo().use_empty(PPC::X2)) { && !MF->getRegInfo().use_empty(PPC::X2)) {
MCSymbol *GlobalEntryLabel = OutContext.CreateTempSymbol(); MCSymbol *GlobalEntryLabel = OutContext.createTempSymbol();
OutStreamer->EmitLabel(GlobalEntryLabel); OutStreamer->EmitLabel(GlobalEntryLabel);
const MCSymbolRefExpr *GlobalEntryLabelExp = const MCSymbolRefExpr *GlobalEntryLabelExp =
MCSymbolRefExpr::Create(GlobalEntryLabel, OutContext); MCSymbolRefExpr::Create(GlobalEntryLabel, OutContext);
MCSymbol *TOCSymbol = OutContext.GetOrCreateSymbol(StringRef(".TOC.")); MCSymbol *TOCSymbol = OutContext.getOrCreateSymbol(StringRef(".TOC."));
const MCExpr *TOCDeltaExpr = const MCExpr *TOCDeltaExpr =
MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(TOCSymbol, OutContext), MCBinaryExpr::CreateSub(MCSymbolRefExpr::Create(TOCSymbol, OutContext),
GlobalEntryLabelExp, OutContext); GlobalEntryLabelExp, OutContext);
@ -1154,7 +1154,7 @@ void PPCLinuxAsmPrinter::EmitFunctionBodyStart() {
.addReg(PPC::X2) .addReg(PPC::X2)
.addExpr(TOCDeltaLo)); .addExpr(TOCDeltaLo));
MCSymbol *LocalEntryLabel = OutContext.CreateTempSymbol(); MCSymbol *LocalEntryLabel = OutContext.createTempSymbol();
OutStreamer->EmitLabel(LocalEntryLabel); OutStreamer->EmitLabel(LocalEntryLabel);
const MCSymbolRefExpr *LocalEntryLabelExp = const MCSymbolRefExpr *LocalEntryLabelExp =
MCSymbolRefExpr::Create(LocalEntryLabel, OutContext); MCSymbolRefExpr::Create(LocalEntryLabel, OutContext);
@ -1259,12 +1259,12 @@ void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) {
static MCSymbol *GetLazyPtr(MCSymbol *Sym, MCContext &Ctx) { static MCSymbol *GetLazyPtr(MCSymbol *Sym, MCContext &Ctx) {
// Remove $stub suffix, add $lazy_ptr. // Remove $stub suffix, add $lazy_ptr.
StringRef NoStub = Sym->getName().substr(0, Sym->getName().size()-5); StringRef NoStub = Sym->getName().substr(0, Sym->getName().size()-5);
return Ctx.GetOrCreateSymbol(NoStub + "$lazy_ptr"); return Ctx.getOrCreateSymbol(NoStub + "$lazy_ptr");
} }
static MCSymbol *GetAnonSym(MCSymbol *Sym, MCContext &Ctx) { static MCSymbol *GetAnonSym(MCSymbol *Sym, MCContext &Ctx) {
// Add $tmp suffix to $stub, yielding $stub$tmp. // Add $tmp suffix to $stub, yielding $stub$tmp.
return Ctx.GetOrCreateSymbol(Sym->getName() + "$tmp"); return Ctx.getOrCreateSymbol(Sym->getName() + "$tmp");
} }
void PPCDarwinAsmPrinter:: void PPCDarwinAsmPrinter::
@ -1344,7 +1344,7 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol);
MCSymbol *DyldStubBindingHelper = MCSymbol *DyldStubBindingHelper =
OutContext.GetOrCreateSymbol(StringRef("dyld_stub_binding_helper")); OutContext.getOrCreateSymbol(StringRef("dyld_stub_binding_helper"));
if (isPPC64) { if (isPPC64) {
// .quad dyld_stub_binding_helper // .quad dyld_stub_binding_helper
OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 8); OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 8);
@ -1399,7 +1399,7 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) {
OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol); OutStreamer->EmitSymbolAttribute(RawSym, MCSA_IndirectSymbol);
MCSymbol *DyldStubBindingHelper = MCSymbol *DyldStubBindingHelper =
OutContext.GetOrCreateSymbol(StringRef("dyld_stub_binding_helper")); OutContext.getOrCreateSymbol(StringRef("dyld_stub_binding_helper"));
if (isPPC64) { if (isPPC64) {
// .quad dyld_stub_binding_helper // .quad dyld_stub_binding_helper
OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 8); OutStreamer->EmitSymbolValue(DyldStubBindingHelper, 8);

View File

@ -66,7 +66,7 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
unsigned OrigLen = Name.size() - PrefixLen; unsigned OrigLen = Name.size() - PrefixLen;
Name += Suffix; Name += Suffix;
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
StringRef OrigName = StringRef(Name).substr(PrefixLen, OrigLen); StringRef OrigName = StringRef(Name).substr(PrefixLen, OrigLen);
// If the target flags on the operand changes the name of the symbol, do that // If the target flags on the operand changes the name of the symbol, do that
@ -85,7 +85,7 @@ static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO, AsmPrinter &AP){
} else { } else {
StubSym = StubSym =
MachineModuleInfoImpl:: MachineModuleInfoImpl::
StubValueTy(Ctx.GetOrCreateSymbol(OrigName), false); StubValueTy(Ctx.getOrCreateSymbol(OrigName), false);
} }
return Sym; return Sym;
} }

View File

@ -19,7 +19,7 @@ void PPCFunctionInfo::anchor() { }
MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const { MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const {
const DataLayout *DL = MF.getTarget().getDataLayout(); const DataLayout *DL = MF.getTarget().getDataLayout();
return MF.getContext().GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix()) + return MF.getContext().getOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix()) +
Twine(MF.getFunctionNumber()) + Twine(MF.getFunctionNumber()) +
"$poff"); "$poff");
} }

View File

@ -95,7 +95,7 @@ void AMDGPUAsmPrinter::EmitEndOfAsmFile(Module &M) {
const TargetLoweringObjectFile &TLOF = getObjFileLowering(); const TargetLoweringObjectFile &TLOF = getObjFileLowering();
OutStreamer->SwitchSection(TLOF.getTextSection()); OutStreamer->SwitchSection(TLOF.getTextSection());
MCSymbol *EndOfTextLabel = MCSymbol *EndOfTextLabel =
OutContext.GetOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME)); OutContext.getOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME));
OutStreamer->EmitLabel(EndOfTextLabel); OutStreamer->EmitLabel(EndOfTextLabel);
} }

View File

@ -69,19 +69,19 @@ void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
break; break;
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
const GlobalValue *GV = MO.getGlobal(); const GlobalValue *GV = MO.getGlobal();
MCSymbol *Sym = Ctx.GetOrCreateSymbol(StringRef(GV->getName())); MCSymbol *Sym = Ctx.getOrCreateSymbol(StringRef(GV->getName()));
MCOp = MCOperand::createExpr(MCSymbolRefExpr::Create(Sym, Ctx)); MCOp = MCOperand::createExpr(MCSymbolRefExpr::Create(Sym, Ctx));
break; break;
} }
case MachineOperand::MO_TargetIndex: { case MachineOperand::MO_TargetIndex: {
assert(MO.getIndex() == AMDGPU::TI_CONSTDATA_START); assert(MO.getIndex() == AMDGPU::TI_CONSTDATA_START);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME)); MCSymbol *Sym = Ctx.getOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME));
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::Create(Sym, Ctx); const MCSymbolRefExpr *Expr = MCSymbolRefExpr::Create(Sym, Ctx);
MCOp = MCOperand::createExpr(Expr); MCOp = MCOperand::createExpr(Expr);
break; break;
} }
case MachineOperand::MO_ExternalSymbol: { case MachineOperand::MO_ExternalSymbol: {
MCSymbol *Sym = Ctx.GetOrCreateSymbol(StringRef(MO.getSymbolName())); MCSymbol *Sym = Ctx.getOrCreateSymbol(StringRef(MO.getSymbolName()));
const MCSymbolRefExpr *Expr = MCSymbolRefExpr::Create(Sym, Ctx); const MCSymbolRefExpr *Expr = MCSymbolRefExpr::Create(Sym, Ctx);
MCOp = MCOperand::createExpr(Expr); MCOp = MCOperand::createExpr(Expr);
break; break;

View File

@ -1084,7 +1084,7 @@ AMDGPUAsmParser::parseSOppBrTarget(OperandVector &Operands) {
case AsmToken::Identifier: case AsmToken::Identifier:
Operands.push_back(AMDGPUOperand::CreateExpr( Operands.push_back(AMDGPUOperand::CreateExpr(
MCSymbolRefExpr::Create(getContext().GetOrCreateSymbol( MCSymbolRefExpr::Create(getContext().getOrCreateSymbol(
Parser.getTok().getString()), getContext()), S)); Parser.getTok().getString()), getContext()), S));
Parser.Lex(); Parser.Lex();
return MatchOperand_Success; return MatchOperand_Success;

View File

@ -252,7 +252,7 @@ uint64_t SIMCCodeEmitter::getMachineOpValue(const MCInst &MI,
const MCSymbolRefExpr *Expr = cast<MCSymbolRefExpr>(MO.getExpr()); const MCSymbolRefExpr *Expr = cast<MCSymbolRefExpr>(MO.getExpr());
MCFixupKind Kind; MCFixupKind Kind;
const MCSymbol *Sym = const MCSymbol *Sym =
Ctx.GetOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME)); Ctx.getOrCreateSymbol(StringRef(END_OF_TEXT_LABEL_NAME));
if (&Expr->getSymbol() == Sym) { if (&Expr->getSymbol() == Sym) {
// Add the offset to the beginning of the constant values. // Add the offset to the beginning of the constant values.

View File

@ -772,7 +772,7 @@ SparcAsmParser::parseSparcAsmOperand(std::unique_ptr<SparcOperand> &Op,
StringRef Identifier; StringRef Identifier;
if (!getParser().parseIdentifier(Identifier)) { if (!getParser().parseIdentifier(Identifier)) {
E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1); E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer() - 1);
MCSymbol *Sym = getContext().GetOrCreateSymbol(Identifier); MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
const MCExpr *Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, const MCExpr *Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None,
getContext()); getContext());

View File

@ -176,7 +176,7 @@ void SparcAsmPrinter::LowerGETPCXAndEmitMCInsts(const MachineInstr *MI,
const MCSubtargetInfo &STI) const MCSubtargetInfo &STI)
{ {
MCSymbol *GOTLabel = MCSymbol *GOTLabel =
OutContext.GetOrCreateSymbol(Twine("_GLOBAL_OFFSET_TABLE_")); OutContext.getOrCreateSymbol(Twine("_GLOBAL_OFFSET_TABLE_"));
const MachineOperand &MO = MI->getOperand(0); const MachineOperand &MO = MI->getOperand(0);
assert(MO.getReg() != SP::O7 && assert(MO.getReg() != SP::O7 &&
@ -225,9 +225,9 @@ void SparcAsmPrinter::LowerGETPCXAndEmitMCInsts(const MachineInstr *MI,
return; return;
} }
MCSymbol *StartLabel = OutContext.CreateTempSymbol(); MCSymbol *StartLabel = OutContext.createTempSymbol();
MCSymbol *EndLabel = OutContext.CreateTempSymbol(); MCSymbol *EndLabel = OutContext.createTempSymbol();
MCSymbol *SethiLabel = OutContext.CreateTempSymbol(); MCSymbol *SethiLabel = OutContext.createTempSymbol();
MCOperand RegO7 = MCOperand::createReg(SP::O7); MCOperand RegO7 = MCOperand::createReg(SP::O7);

View File

@ -863,7 +863,7 @@ SystemZAsmParser::parsePCRel(OperandVector &Operands, int64_t MinVal,
Error(StartLoc, "offset out of range"); Error(StartLoc, "offset out of range");
return MatchOperand_ParseFail; return MatchOperand_ParseFail;
} }
MCSymbol *Sym = Ctx.CreateTempSymbol(); MCSymbol *Sym = Ctx.createTempSymbol();
Out.EmitLabel(Sym); Out.EmitLabel(Sym);
const MCExpr *Base = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None, const MCExpr *Base = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_None,
Ctx); Ctx);
@ -904,7 +904,7 @@ SystemZAsmParser::parsePCRel(OperandVector &Operands, int64_t MinVal,
} }
StringRef Identifier = Parser.getTok().getString(); StringRef Identifier = Parser.getTok().getString();
Sym = MCSymbolRefExpr::Create(Ctx.GetOrCreateSymbol(Identifier), Sym = MCSymbolRefExpr::Create(Ctx.getOrCreateSymbol(Identifier),
Kind, Ctx); Kind, Ctx);
Parser.Lex(); Parser.Lex();
} }

View File

@ -68,14 +68,14 @@ static MCInst lowerRIEfLow(const MachineInstr *MI, unsigned Opcode) {
static const MCSymbolRefExpr *getTLSGetOffset(MCContext &Context) { static const MCSymbolRefExpr *getTLSGetOffset(MCContext &Context) {
StringRef Name = "__tls_get_offset"; StringRef Name = "__tls_get_offset";
return MCSymbolRefExpr::Create(Context.GetOrCreateSymbol(Name), return MCSymbolRefExpr::Create(Context.getOrCreateSymbol(Name),
MCSymbolRefExpr::VK_PLT, MCSymbolRefExpr::VK_PLT,
Context); Context);
} }
static const MCSymbolRefExpr *getGlobalOffsetTable(MCContext &Context) { static const MCSymbolRefExpr *getGlobalOffsetTable(MCContext &Context) {
StringRef Name = "_GLOBAL_OFFSET_TABLE_"; StringRef Name = "_GLOBAL_OFFSET_TABLE_";
return MCSymbolRefExpr::Create(Context.GetOrCreateSymbol(Name), return MCSymbolRefExpr::Create(Context.getOrCreateSymbol(Name),
MCSymbolRefExpr::VK_None, MCSymbolRefExpr::VK_None,
Context); Context);
} }

View File

@ -110,7 +110,7 @@ MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase(
NameStr += DL->getPrivateGlobalPrefix(); NameStr += DL->getPrivateGlobalPrefix();
TM.getNameWithPrefix(NameStr, GV, Mang); TM.getNameWithPrefix(NameStr, GV, Mang);
NameStr.append(Suffix.begin(), Suffix.end()); NameStr.append(Suffix.begin(), Suffix.end());
return Ctx->GetOrCreateSymbol(NameStr); return Ctx->getOrCreateSymbol(NameStr);
} }
MCSymbol *TargetLoweringObjectFile::getCFIPersonalitySymbol( MCSymbol *TargetLoweringObjectFile::getCFIPersonalitySymbol(
@ -330,7 +330,7 @@ getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
case dwarf::DW_EH_PE_pcrel: { case dwarf::DW_EH_PE_pcrel: {
// Emit a label to the streamer for the current position. This gives us // Emit a label to the streamer for the current position. This gives us
// .-foo addressing. // .-foo addressing.
MCSymbol *PCSym = getContext().CreateTempSymbol(); MCSymbol *PCSym = getContext().createTempSymbol();
Streamer.EmitLabel(PCSym); Streamer.EmitLabel(PCSym);
const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext()); const MCExpr *PC = MCSymbolRefExpr::Create(PCSym, getContext());
return MCBinaryExpr::CreateSub(Sym, PC, getContext()); return MCBinaryExpr::CreateSub(Sym, PC, getContext());

View File

@ -189,5 +189,5 @@ MCSymbol *TargetMachine::getSymbol(const GlobalValue *GV, Mangler &Mang) const {
SmallString<60> NameStr; SmallString<60> NameStr;
getNameWithPrefix(NameStr, GV, Mang); getNameWithPrefix(NameStr, GV, Mang);
const TargetLoweringObjectFile *TLOF = getObjFileLowering(); const TargetLoweringObjectFile *TLOF = getObjFileLowering();
return TLOF->getContext().GetOrCreateSymbol(NameStr); return TLOF->getContext().getOrCreateSymbol(NameStr);
} }

View File

@ -613,7 +613,7 @@ private:
Out, MCInstBuilder(X86::PUSH32r).addReg(RegCtx.AddressReg(MVT::i32))); Out, MCInstBuilder(X86::PUSH32r).addReg(RegCtx.AddressReg(MVT::i32)));
const std::string &Fn = FuncName(AccessSize, IsWrite); const std::string &Fn = FuncName(AccessSize, IsWrite);
MCSymbol *FnSym = Ctx.GetOrCreateSymbol(StringRef(Fn)); MCSymbol *FnSym = Ctx.getOrCreateSymbol(StringRef(Fn));
const MCSymbolRefExpr *FnExpr = const MCSymbolRefExpr *FnExpr =
MCSymbolRefExpr::Create(FnSym, MCSymbolRefExpr::VK_PLT, Ctx); MCSymbolRefExpr::Create(FnSym, MCSymbolRefExpr::VK_PLT, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::CALLpcrel32).addExpr(FnExpr)); EmitInstruction(Out, MCInstBuilder(X86::CALLpcrel32).addExpr(FnExpr));
@ -653,7 +653,7 @@ void X86AddressSanitizer32::InstrumentMemOperandSmall(
EmitInstruction( EmitInstruction(
Out, MCInstBuilder(X86::TEST8rr).addReg(ShadowRegI8).addReg(ShadowRegI8)); Out, MCInstBuilder(X86::TEST8rr).addReg(ShadowRegI8).addReg(ShadowRegI8));
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr)); EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr));
@ -728,7 +728,7 @@ void X86AddressSanitizer32::InstrumentMemOperandLarge(
Inst.addOperand(MCOperand::createImm(0)); Inst.addOperand(MCOperand::createImm(0));
EmitInstruction(Out, Inst); EmitInstruction(Out, Inst);
} }
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr)); EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr));
@ -742,7 +742,7 @@ void X86AddressSanitizer32::InstrumentMOVSImpl(unsigned AccessSize,
StoreFlags(Out); StoreFlags(Out);
// No need to test when ECX is equals to zero. // No need to test when ECX is equals to zero.
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction( EmitInstruction(
Out, MCInstBuilder(X86::TEST32rr).addReg(X86::ECX).addReg(X86::ECX)); Out, MCInstBuilder(X86::TEST32rr).addReg(X86::ECX).addReg(X86::ECX));
@ -883,7 +883,7 @@ private:
RegCtx.AddressReg(MVT::i64))); RegCtx.AddressReg(MVT::i64)));
} }
const std::string &Fn = FuncName(AccessSize, IsWrite); const std::string &Fn = FuncName(AccessSize, IsWrite);
MCSymbol *FnSym = Ctx.GetOrCreateSymbol(StringRef(Fn)); MCSymbol *FnSym = Ctx.getOrCreateSymbol(StringRef(Fn));
const MCSymbolRefExpr *FnExpr = const MCSymbolRefExpr *FnExpr =
MCSymbolRefExpr::Create(FnSym, MCSymbolRefExpr::VK_PLT, Ctx); MCSymbolRefExpr::Create(FnSym, MCSymbolRefExpr::VK_PLT, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::CALL64pcrel32).addExpr(FnExpr)); EmitInstruction(Out, MCInstBuilder(X86::CALL64pcrel32).addExpr(FnExpr));
@ -924,7 +924,7 @@ void X86AddressSanitizer64::InstrumentMemOperandSmall(
EmitInstruction( EmitInstruction(
Out, MCInstBuilder(X86::TEST8rr).addReg(ShadowRegI8).addReg(ShadowRegI8)); Out, MCInstBuilder(X86::TEST8rr).addReg(ShadowRegI8).addReg(ShadowRegI8));
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr)); EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr));
@ -1000,7 +1000,7 @@ void X86AddressSanitizer64::InstrumentMemOperandLarge(
EmitInstruction(Out, Inst); EmitInstruction(Out, Inst);
} }
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr)); EmitInstruction(Out, MCInstBuilder(X86::JE_1).addExpr(DoneExpr));
@ -1014,7 +1014,7 @@ void X86AddressSanitizer64::InstrumentMOVSImpl(unsigned AccessSize,
StoreFlags(Out); StoreFlags(Out);
// No need to test when RCX is equals to zero. // No need to test when RCX is equals to zero.
MCSymbol *DoneSym = Ctx.CreateTempSymbol(); MCSymbol *DoneSym = Ctx.createTempSymbol();
const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx); const MCExpr *DoneExpr = MCSymbolRefExpr::Create(DoneSym, Ctx);
EmitInstruction( EmitInstruction(
Out, MCInstBuilder(X86::TEST64rr).addReg(X86::RCX).addReg(X86::RCX)); Out, MCInstBuilder(X86::TEST64rr).addReg(X86::RCX).addReg(X86::RCX));

View File

@ -1191,7 +1191,7 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
StringRef IDVal = getTok().getString(); StringRef IDVal = getTok().getString();
if (IDVal == "f" || IDVal == "b") { if (IDVal == "f" || IDVal == "b") {
MCSymbol *Sym = MCSymbol *Sym =
getContext().GetDirectionalLocalSymbol(IntVal, IDVal == "b"); getContext().getDirectionalLocalSymbol(IntVal, IDVal == "b");
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None; MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
const MCExpr *Val = const MCExpr *Val =
MCSymbolRefExpr::Create(Sym, Variant, getContext()); MCSymbolRefExpr::Create(Sym, Variant, getContext());
@ -1351,7 +1351,7 @@ bool X86AsmParser::ParseIntelIdentifier(const MCExpr *&Val,
} }
// Create the symbol reference. // Create the symbol reference.
MCSymbol *Sym = getContext().GetOrCreateSymbol(Identifier); MCSymbol *Sym = getContext().getOrCreateSymbol(Identifier);
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None; MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
Val = MCSymbolRefExpr::Create(Sym, Variant, getParser().getContext()); Val = MCSymbolRefExpr::Create(Sym, Variant, getParser().getContext());
return false; return false;

View File

@ -34,7 +34,7 @@ public:
uint64_t SymSize; SymI->getSize(SymSize); uint64_t SymSize; SymI->getSize(SymSize);
int64_t Addend; getELFRelocationAddend(Rel, Addend); int64_t Addend; getELFRelocationAddend(Rel, Addend);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName); MCSymbol *Sym = Ctx.getOrCreateSymbol(SymName);
// FIXME: check that the value is actually the same. // FIXME: check that the value is actually the same.
if (!Sym->isVariable()) if (!Sym->isVariable())
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx)); Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));

View File

@ -36,7 +36,7 @@ public:
any_relocation_info RE = Obj->getRelocation(Rel.getRawDataRefImpl()); any_relocation_info RE = Obj->getRelocation(Rel.getRawDataRefImpl());
bool isPCRel = Obj->getAnyRelocationPCRel(RE); bool isPCRel = Obj->getAnyRelocationPCRel(RE);
MCSymbol *Sym = Ctx.GetOrCreateSymbol(SymName); MCSymbol *Sym = Ctx.getOrCreateSymbol(SymName);
// FIXME: check that the value is actually the same. // FIXME: check that the value is actually the same.
if (!Sym->isVariable()) if (!Sym->isVariable())
Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx)); Sym->setVariableValue(MCConstantExpr::Create(SymAddr, Ctx));
@ -92,7 +92,7 @@ public:
StringRef RSymName; StringRef RSymName;
RSymI->getName(RSymName); RSymI->getName(RSymName);
MCSymbol *RSym = Ctx.GetOrCreateSymbol(RSymName); MCSymbol *RSym = Ctx.getOrCreateSymbol(RSymName);
if (!RSym->isVariable()) if (!RSym->isVariable())
RSym->setVariableValue(MCConstantExpr::Create(RSymAddr, Ctx)); RSym->setVariableValue(MCConstantExpr::Create(RSymAddr, Ctx));

View File

@ -179,7 +179,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(
// non-relocatable expression. // non-relocatable expression.
if (A->isUndefined() || B->isUndefined()) { if (A->isUndefined() || B->isUndefined()) {
StringRef Name = A->isUndefined() ? A->getName() : B->getName(); StringRef Name = A->isUndefined() ? A->getName() : B->getName();
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
"unsupported relocation with subtraction expression, symbol '" + "unsupported relocation with subtraction expression, symbol '" +
Name + "' can not be undefined in a subtraction expression"); Name + "' can not be undefined in a subtraction expression");
} }
@ -395,7 +395,7 @@ bool X86MachObjectWriter::RecordScatteredRelocation(MachObjectWriter *Writer,
if (FixupOffset > 0xffffff) { if (FixupOffset > 0xffffff) {
char Buffer[32]; char Buffer[32];
format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer)); format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer));
Asm.getContext().FatalError(Fixup.getLoc(), Asm.getContext().reportFatalError(Fixup.getLoc(),
Twine("Section too large, can't encode " Twine("Section too large, can't encode "
"r_address (") + Buffer + "r_address (") + Buffer +
") into 24 bits of scattered " ") into 24 bits of scattered "

View File

@ -97,7 +97,7 @@ static void printSymbolOperand(X86AsmPrinter &P, const MachineOperand &MO,
// Handle dllimport linkage. // Handle dllimport linkage.
if (MO.getTargetFlags() == X86II::MO_DLLIMPORT) if (MO.getTargetFlags() == X86II::MO_DLLIMPORT)
GVSym = GVSym =
P.OutContext.GetOrCreateSymbol(Twine("__imp_") + GVSym->getName()); P.OutContext.getOrCreateSymbol(Twine("__imp_") + GVSym->getName());
if (MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY || if (MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY ||
MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY_PIC_BASE) { MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY_PIC_BASE) {
@ -513,7 +513,7 @@ void X86AsmPrinter::EmitStartOfAsmFile(Module &M) {
// Emit an absolute @feat.00 symbol. This appears to be some kind of // Emit an absolute @feat.00 symbol. This appears to be some kind of
// compiler features bitfield read by link.exe. // compiler features bitfield read by link.exe.
if (TT.getArch() == Triple::x86) { if (TT.getArch() == Triple::x86) {
MCSymbol *S = MMI->getContext().GetOrCreateSymbol(StringRef("@feat.00")); MCSymbol *S = MMI->getContext().getOrCreateSymbol(StringRef("@feat.00"));
OutStreamer->BeginCOFFSymbolDef(S); OutStreamer->BeginCOFFSymbolDef(S);
OutStreamer->EmitCOFFSymbolStorageClass(COFF::IMAGE_SYM_CLASS_STATIC); OutStreamer->EmitCOFFSymbolStorageClass(COFF::IMAGE_SYM_CLASS_STATIC);
OutStreamer->EmitCOFFSymbolType(COFF::IMAGE_SYM_DTYPE_NULL); OutStreamer->EmitCOFFSymbolType(COFF::IMAGE_SYM_DTYPE_NULL);
@ -682,7 +682,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
if (TT.isKnownWindowsMSVCEnvironment() && MMI->usesVAFloatArgument()) { if (TT.isKnownWindowsMSVCEnvironment() && MMI->usesVAFloatArgument()) {
StringRef SymbolName = StringRef SymbolName =
(TT.getArch() == Triple::x86_64) ? "_fltused" : "__fltused"; (TT.getArch() == Triple::x86_64) ? "_fltused" : "__fltused";
MCSymbol *S = MMI->getContext().GetOrCreateSymbol(SymbolName); MCSymbol *S = MMI->getContext().getOrCreateSymbol(SymbolName);
OutStreamer->EmitSymbolAttribute(S, MCSA_Global); OutStreamer->EmitSymbolAttribute(S, MCSA_Global);
} }

View File

@ -165,7 +165,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
unsigned OrigLen = Name.size() - PrefixLen; unsigned OrigLen = Name.size() - PrefixLen;
Name += Suffix; Name += Suffix;
MCSymbol *Sym = Ctx.GetOrCreateSymbol(Name); MCSymbol *Sym = Ctx.getOrCreateSymbol(Name);
StringRef OrigName = StringRef(Name).substr(PrefixLen, OrigLen); StringRef OrigName = StringRef(Name).substr(PrefixLen, OrigLen);
@ -212,7 +212,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
} else { } else {
StubSym = StubSym =
MachineModuleInfoImpl:: MachineModuleInfoImpl::
StubValueTy(Ctx.GetOrCreateSymbol(OrigName), false); StubValueTy(Ctx.getOrCreateSymbol(OrigName), false);
} }
break; break;
} }
@ -275,7 +275,7 @@ MCOperand X86MCInstLower::LowerSymbolOperand(const MachineOperand &MO,
// relocations the assembler will generate for differences between // relocations the assembler will generate for differences between
// local labels. This is only safe when the symbols are in the same // local labels. This is only safe when the symbols are in the same
// section so we are restricting it to jumptable references. // section so we are restricting it to jumptable references.
MCSymbol *Label = Ctx.CreateTempSymbol(); MCSymbol *Label = Ctx.createTempSymbol();
AsmPrinter.OutStreamer->EmitAssignment(Label, Expr); AsmPrinter.OutStreamer->EmitAssignment(Label, Expr);
Expr = MCSymbolRefExpr::Create(Label, Ctx); Expr = MCSymbolRefExpr::Create(Label, Ctx);
} }
@ -747,7 +747,7 @@ void X86AsmPrinter::LowerTlsAddr(X86MCInstLower &MCInstLowering,
} }
StringRef name = is64Bits ? "__tls_get_addr" : "___tls_get_addr"; StringRef name = is64Bits ? "__tls_get_addr" : "___tls_get_addr";
MCSymbol *tlsGetAddr = context.GetOrCreateSymbol(name); MCSymbol *tlsGetAddr = context.getOrCreateSymbol(name);
const MCSymbolRefExpr *tlsRef = const MCSymbolRefExpr *tlsRef =
MCSymbolRefExpr::Create(tlsGetAddr, MCSymbolRefExpr::Create(tlsGetAddr,
MCSymbolRefExpr::VK_PLT, MCSymbolRefExpr::VK_PLT,
@ -1094,7 +1094,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
// MYGLOBAL + (. - PICBASE) // MYGLOBAL + (. - PICBASE)
// However, we can't generate a ".", so just emit a new label here and refer // However, we can't generate a ".", so just emit a new label here and refer
// to it. // to it.
MCSymbol *DotSym = OutContext.CreateTempSymbol(); MCSymbol *DotSym = OutContext.createTempSymbol();
OutStreamer->EmitLabel(DotSym); OutStreamer->EmitLabel(DotSym);
// Now that we have emitted the label, lower the complex operand expression. // Now that we have emitted the label, lower the complex operand expression.

View File

@ -96,7 +96,7 @@ void XCoreAsmPrinter::emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV) {
if (ArrayType *ATy = dyn_cast<ArrayType>( if (ArrayType *ATy = dyn_cast<ArrayType>(
cast<PointerType>(GV->getType())->getElementType())) { cast<PointerType>(GV->getType())->getElementType())) {
MCSymbol *SymGlob = OutContext.GetOrCreateSymbol( MCSymbol *SymGlob = OutContext.getOrCreateSymbol(
Twine(Sym->getName() + StringRef(".globound"))); Twine(Sym->getName() + StringRef(".globound")));
OutStreamer->EmitSymbolAttribute(SymGlob, MCSA_Global); OutStreamer->EmitSymbolAttribute(SymGlob, MCSA_Global);
OutStreamer->EmitAssignment(SymGlob, OutStreamer->EmitAssignment(SymGlob,

View File

@ -770,8 +770,8 @@ void DwarfStreamer::emitLineTableForUnit(StringRef PrologueBytes,
unsigned PointerSize) { unsigned PointerSize) {
// Switch to the section where the table will be emitted into. // Switch to the section where the table will be emitted into.
MS->SwitchSection(MC->getObjectFileInfo()->getDwarfLineSection()); MS->SwitchSection(MC->getObjectFileInfo()->getDwarfLineSection());
MCSymbol *LineStartSym = MC->CreateTempSymbol(); MCSymbol *LineStartSym = MC->createTempSymbol();
MCSymbol *LineEndSym = MC->CreateTempSymbol(); MCSymbol *LineEndSym = MC->createTempSymbol();
// The first 4 bytes is the total length of the information for this // The first 4 bytes is the total length of the information for this
// compilation unit (not including these 4 bytes for the length). // compilation unit (not including these 4 bytes for the length).