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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2015-05-18 18:43:14 +00:00
parent 0799eb1140
commit 19696daa21
76 changed files with 297 additions and 296 deletions
+8 -8
View File
@@ -462,7 +462,7 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
if (GVKind.isThreadLocal() && MAI->hasMachoTBSSDirective()) {
// Emit the .tbss symbol
MCSymbol *MangSym =
OutContext.GetOrCreateSymbol(GVSym->getName() + Twine("$tlv$init"));
OutContext.getOrCreateSymbol(GVSym->getName() + Twine("$tlv$init"));
if (GVKind.isThreadBSS()) {
TheSection = getObjFileLowering().getTLSBSSSection();
@@ -563,7 +563,7 @@ void AsmPrinter::EmitFunctionHeader() {
if (CurrentFnBegin) {
if (MAI->useAssignmentForEHBegin()) {
MCSymbol *CurPos = OutContext.CreateTempSymbol();
MCSymbol *CurPos = OutContext.createTempSymbol();
OutStreamer->EmitLabel(CurPos);
OutStreamer->EmitAssignment(CurrentFnBegin,
MCSymbolRefExpr::Create(CurPos, OutContext));
@@ -1128,7 +1128,7 @@ bool AsmPrinter::doFinalization(Module &M) {
OutStreamer->SwitchSection(ReadOnlySection);
MCSymbol *AddrSymbol =
OutContext.GetOrCreateSymbol(StringRef("__morestack_addr"));
OutContext.getOrCreateSymbol(StringRef("__morestack_addr"));
OutStreamer->EmitLabel(AddrSymbol);
unsigned PtrSize = TM.getDataLayout()->getPointerSize(0);
@@ -1443,7 +1443,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
if (TM.getRelocationModel() == Reloc::Static &&
MAI->hasStaticCtorDtorReferenceInStaticMode()) {
StringRef Sym(".constructors_used");
OutStreamer->EmitSymbolAttribute(OutContext.GetOrCreateSymbol(Sym),
OutStreamer->EmitSymbolAttribute(OutContext.getOrCreateSymbol(Sym),
MCSA_Reference);
}
return true;
@@ -1455,7 +1455,7 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
if (TM.getRelocationModel() == Reloc::Static &&
MAI->hasStaticCtorDtorReferenceInStaticMode()) {
StringRef Sym(".destructors_used");
OutStreamer->EmitSymbolAttribute(OutContext.GetOrCreateSymbol(Sym),
OutStreamer->EmitSymbolAttribute(OutContext.getOrCreateSymbol(Sym),
MCSA_Reference);
}
return true;
@@ -2293,7 +2293,7 @@ MCSymbol *AsmPrinter::GetBlockAddressSymbol(const BasicBlock *BB) const {
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
const DataLayout *DL = TM.getDataLayout();
return OutContext.GetOrCreateSymbol
return OutContext.getOrCreateSymbol
(Twine(DL->getPrivateGlobalPrefix()) + "CPI" + Twine(getFunctionNumber())
+ "_" + Twine(CPID));
}
@@ -2307,7 +2307,7 @@ MCSymbol *AsmPrinter::GetJTISymbol(unsigned JTID, bool isLinkerPrivate) const {
/// FIXME: privatize to AsmPrinter.
MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const {
const DataLayout *DL = TM.getDataLayout();
return OutContext.GetOrCreateSymbol
return OutContext.getOrCreateSymbol
(Twine(DL->getPrivateGlobalPrefix()) + Twine(getFunctionNumber()) + "_" +
Twine(UID) + "_set_" + Twine(MBBID));
}
@@ -2323,7 +2323,7 @@ MCSymbol *AsmPrinter::getSymbolWithGlobalValueBase(const GlobalValue *GV,
MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const {
SmallString<60> NameStr;
Mang->getNameWithPrefix(NameStr, Sym);
return OutContext.GetOrCreateSymbol(NameStr);
return OutContext.getOrCreateSymbol(NameStr);
}
+2 -2
View File
@@ -997,7 +997,7 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) {
return;
if (!PrevLabel) {
PrevLabel = MMI->getContext().CreateTempSymbol();
PrevLabel = MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(PrevLabel);
}
I->second = PrevLabel;
@@ -1025,7 +1025,7 @@ void DwarfDebug::endInstruction() {
// We need a label after this instruction.
if (!PrevLabel) {
PrevLabel = MMI->getContext().CreateTempSymbol();
PrevLabel = MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(PrevLabel);
}
I->second = PrevLabel;
+1 -1
View File
@@ -439,7 +439,7 @@ void EHStreamer::emitExceptionTable() {
// Emit the LSDA.
MCSymbol *GCCETSym =
Asm->OutContext.GetOrCreateSymbol(Twine("GCC_except_table")+
Asm->OutContext.getOrCreateSymbol(Twine("GCC_except_table")+
Twine(Asm->getFunctionNumber()));
Asm->OutStreamer->EmitLabel(GCCETSym);
Asm->OutStreamer->EmitLabel(Asm->getCurExceptionSym());
+1 -1
View File
@@ -60,7 +60,7 @@ static void EmitCamlGlobal(const Module &M, AsmPrinter &AP, const char *Id) {
SmallString<128> TmpStr;
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->EmitLabel(Sym);
+5 -5
View File
@@ -274,7 +274,7 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
GlobalValue::getRealLinkageName(ParentF->getName());
MCSymbol *FuncInfoXData =
Asm->OutContext.GetOrCreateSymbol(Twine("$cppxdata$", ParentLinkageName));
Asm->OutContext.getOrCreateSymbol(Twine("$cppxdata$", ParentLinkageName));
OS.EmitValue(createImageRel32(FuncInfoXData), 4);
// 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 *IPToStateXData = nullptr;
if (!FuncInfo.UnwindMap.empty())
UnwindMapXData = Asm->OutContext.GetOrCreateSymbol(
UnwindMapXData = Asm->OutContext.getOrCreateSymbol(
Twine("$stateUnwindMap$", ParentLinkageName));
if (!FuncInfo.TryBlockMap.empty())
TryBlockMapXData = Asm->OutContext.GetOrCreateSymbol(
TryBlockMapXData = Asm->OutContext.getOrCreateSymbol(
Twine("$tryMap$", ParentLinkageName));
if (!FuncInfo.IPToStateList.empty())
IPToStateXData = Asm->OutContext.GetOrCreateSymbol(
IPToStateXData = Asm->OutContext.getOrCreateSymbol(
Twine("$ip2state$", ParentLinkageName));
// FuncInfo {
@@ -426,7 +426,7 @@ void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) {
if (!TBME.HandlerArray.empty())
HandlerMapXData =
Asm->OutContext.GetOrCreateSymbol(Twine("$handlerMap$")
Asm->OutContext.getOrCreateSymbol(Twine("$handlerMap$")
.concat(Twine(I))
.concat("$")
.concat(ParentLinkageName));
@@ -94,7 +94,7 @@ void WinCodeViewLineTables::maybeRecordLocation(DebugLoc DL,
}
FileNameRegistry.add(Filename);
MCSymbol *MCL = Asm->MMI->getContext().CreateTempSymbol();
MCSymbol *MCL = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(MCL);
CurFn->Instrs.push_back(MCL);
InstrInfo[MCL] = InstrInfoTy(Filename, DL.getLine());
@@ -201,15 +201,15 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
if (GVName.startswith("\01?"))
FuncName = GVName.substr(1);
// Emit a symbol subsection, required by VS2012+ to find function boundaries.
MCSymbol *SymbolsBegin = Asm->MMI->getContext().CreateTempSymbol(),
*SymbolsEnd = Asm->MMI->getContext().CreateTempSymbol();
MCSymbol *SymbolsBegin = Asm->MMI->getContext().createTempSymbol(),
*SymbolsEnd = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->AddComment("Symbol subsection for " + Twine(FuncName));
Asm->EmitInt32(COFF::DEBUG_SYMBOL_SUBSECTION);
EmitLabelDiff(*Asm->OutStreamer, SymbolsBegin, SymbolsEnd);
Asm->OutStreamer->EmitLabel(SymbolsBegin);
{
MCSymbol *ProcSegmentBegin = Asm->MMI->getContext().CreateTempSymbol(),
*ProcSegmentEnd = Asm->MMI->getContext().CreateTempSymbol();
MCSymbol *ProcSegmentBegin = Asm->MMI->getContext().createTempSymbol(),
*ProcSegmentEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, ProcSegmentBegin, ProcSegmentEnd, 2);
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.
Asm->OutStreamer->AddComment("Line table subsection for " + Twine(FuncName));
Asm->EmitInt32(COFF::DEBUG_LINE_TABLE_SUBSECTION);
MCSymbol *LineTableBegin = Asm->MMI->getContext().CreateTempSymbol(),
*LineTableEnd = Asm->MMI->getContext().CreateTempSymbol();
MCSymbol *LineTableBegin = Asm->MMI->getContext().createTempSymbol(),
*LineTableEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, LineTableBegin, LineTableEnd);
Asm->OutStreamer->EmitLabel(LineTableBegin);
@@ -288,7 +288,7 @@ void WinCodeViewLineTables::emitDebugInfoForFunction(const Function *GV) {
// in the string table.
Asm->OutStreamer->AddComment(
"Segment for file '" + Twine(CurFilename) + "' begins");
MCSymbol *FileSegmentBegin = Asm->MMI->getContext().CreateTempSymbol();
MCSymbol *FileSegmentBegin = Asm->MMI->getContext().createTempSymbol();
Asm->OutStreamer->EmitLabel(FileSegmentBegin);
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
// records.
FileSegmentEnd = Asm->MMI->getContext().CreateTempSymbol();
FileSegmentEnd = Asm->MMI->getContext().createTempSymbol();
EmitLabelDiff(*Asm->OutStreamer, FileSegmentBegin, FileSegmentEnd);
}
+1 -1
View File
@@ -272,7 +272,7 @@ void GCMachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
MCSymbol *GCMachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI,
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);
return Label;
}
+1 -1
View File
@@ -53,7 +53,7 @@ MCSymbol *MachineBasicBlock::getSymbol() const {
const MachineFunction *MF = getParent();
MCContext &Ctx = MF->getContext();
const char *Prefix = Ctx.getAsmInfo()->getPrivateLabelPrefix();
CachedMCSymbol = Ctx.GetOrCreateSymbol(Twine(Prefix) + "BB" +
CachedMCSymbol = Ctx.getOrCreateSymbol(Twine(Prefix) + "BB" +
Twine(MF->getFunctionNumber()) +
"_" + Twine(getNumber()));
}
+2 -2
View File
@@ -468,14 +468,14 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
SmallString<60> Name;
raw_svector_ostream(Name)
<< Prefix << "JTI" << getFunctionNumber() << '_' << JTI;
return Ctx.GetOrCreateSymbol(Name);
return Ctx.getOrCreateSymbol(Name);
}
/// getPICBaseSymbol - Return a function-local symbol to represent the PIC
/// base.
MCSymbol *MachineFunction::getPICBaseSymbol() const {
const DataLayout *DL = getTarget().getDataLayout();
return Ctx.GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
return Ctx.getOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
Twine(getFunctionNumber())+"$pb");
}
+2 -2
View File
@@ -118,7 +118,7 @@ MCSymbol *MMIAddrLabelMap::getAddrLabelSymbol(BasicBlock *BB) {
BBCallbacks.back().setMap(this);
Entry.Index = BBCallbacks.size()-1;
Entry.Fn = BB->getParent();
MCSymbol *Result = Context.CreateTempSymbol();
MCSymbol *Result = Context.createTempSymbol();
Entry.Symbols = Result;
return Result;
}
@@ -401,7 +401,7 @@ void MachineModuleInfo::addInvoke(MachineBasicBlock *LandingPad,
/// addLandingPad - Provide the label of a try LandingPad block.
///
MCSymbol *MachineModuleInfo::addLandingPad(MachineBasicBlock *LandingPad) {
MCSymbol *LandingPadLabel = Context.CreateTempSymbol();
MCSymbol *LandingPadLabel = Context.createTempSymbol();
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
LP.LandingPadLabel = LandingPadLabel;
return LandingPadLabel;
@@ -4979,7 +4979,7 @@ SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfo &CLI,
if (LandingPad) {
// 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.
BeginLabel = MMI.getContext().CreateTempSymbol();
BeginLabel = MMI.getContext().createTempSymbol();
// For SjLj, keep track of which landing pads go with which invokes
// so as to maintain the ordering of pads in the LSDA.
@@ -5022,7 +5022,7 @@ SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfo &CLI,
if (LandingPad) {
// 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.
MCSymbol *EndLabel = MMI.getContext().CreateTempSymbol();
MCSymbol *EndLabel = MMI.getContext().createTempSymbol();
DAG.setRoot(DAG.getEHLabel(getCurSDLoc(), getRoot(), EndLabel));
// Inform MachineModuleInfo of range.
+2 -2
View File
@@ -274,7 +274,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
bool recordResult) {
MCContext &OutContext = AP.OutStreamer->getContext();
MCSymbol *MILabel = OutContext.CreateTempSymbol();
MCSymbol *MILabel = OutContext.createTempSymbol();
AP.OutStreamer->EmitLabel(MILabel);
LocationVec Locations;
@@ -529,7 +529,7 @@ void StackMaps::serializeToStackMapSection() {
OS.SwitchSection(StackMapSection);
// Emit a dummy symbol to force section inclusion.
OS.EmitLabel(OutContext.GetOrCreateSymbol(Twine("__LLVM_StackMaps")));
OS.EmitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
// Serialize data.
DEBUG(dbgs() << "********** Stack Map Output **********\n");
+4 -4
View File
@@ -51,7 +51,7 @@ MCSymbol *TargetLoweringObjectFileELF::getCFIPersonalitySymbol(
MachineModuleInfo *MMI) const {
unsigned Encoding = getPersonalityEncoding();
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());
if ((Encoding & 0x70) == dwarf::DW_EH_PE_absptr)
return TM.getSymbol(GV, Mang);
@@ -63,7 +63,7 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(MCStreamer &Streamer,
const MCSymbol *Sym) const {
SmallString<64> NameData("DW.ref.");
NameData += Sym->getName();
MCSymbol *Label = getContext().GetOrCreateSymbol(NameData);
MCSymbol *Label = getContext().getOrCreateSymbol(NameData);
Streamer.EmitSymbolAttribute(Label, MCSA_Hidden);
Streamer.EmitSymbolAttribute(Label, MCSA_Weak);
StringRef Prefix = ".data.";
@@ -525,7 +525,7 @@ emitModuleFlags(MCStreamer &Streamer,
SectionKind::getDataNoRel());
Streamer.SwitchSection(S);
Streamer.EmitLabel(getContext().
GetOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO")));
getOrCreateSymbol(StringRef("L_OBJC_IMAGE_INFO")));
Streamer.EmitIntValue(VersionVal, 4);
Streamer.EmitIntValue(ImageInfoFlags, 4);
Streamer.AddBlankLine();
@@ -758,7 +758,7 @@ const MCExpr *TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(
Name += DL->getPrivateGlobalPrefix();
Name += Sym->getName();
Name += Suffix;
MCSymbol *Stub = Ctx.GetOrCreateSymbol(Name);
MCSymbol *Stub = Ctx.getOrCreateSymbol(Name);
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(Stub);
if (!StubSym.getPointer())