1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[NFC][AsmPrinter] Fix the formatting for the rL365467

In addition, fix the build failure for the 'unused'
variable. The variable was used inside the 'LLVM_DEBUG()'.

llvm-svn: 365469
This commit is contained in:
Djordje Todorovic 2019-07-09 12:06:21 +00:00
parent 916d5bcc6a
commit 6ff782868c
2 changed files with 21 additions and 23 deletions

View File

@ -894,7 +894,7 @@ dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) {
bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB();
if (!ApplyGNUExtensions)
return Tag;
switch(Tag) {
switch (Tag) {
case dwarf::DW_TAG_call_site:
return dwarf::DW_TAG_GNU_call_site;
case dwarf::DW_TAG_call_site_parameter:
@ -904,11 +904,12 @@ dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) {
}
}
dwarf::Attribute DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) {
dwarf::Attribute
DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) {
bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB();
if (!ApplyGNUExtensions)
return Attr;
switch(Attr) {
switch (Attr) {
case dwarf::DW_AT_call_all_calls:
return dwarf::DW_AT_GNU_all_call_sites;
case dwarf::DW_AT_call_target:
@ -926,31 +927,30 @@ dwarf::Attribute DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute A
}
}
DIE &DwarfCompileUnit::constructCallSiteEntryDIE(DIE &ScopeDIE,
const DISubprogram *CalleeSP,
bool IsTail,
const MCSymbol *PCAddr,
const MCExpr *PCOffset,
unsigned CallReg) {
DIE &DwarfCompileUnit::constructCallSiteEntryDIE(
DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail,
const MCSymbol *PCAddr, const MCExpr *PCOffset, unsigned CallReg) {
// Insert a call site entry DIE within ScopeDIE.
DIE &CallSiteDIE =
createAndAddDIE(getDwarf5OrGNUCallSiteTag(dwarf::DW_TAG_call_site),
ScopeDIE, nullptr);
DIE &CallSiteDIE = createAndAddDIE(
getDwarf5OrGNUCallSiteTag(dwarf::DW_TAG_call_site), ScopeDIE, nullptr);
if (CallReg) {
// Indirect call.
addAddress(CallSiteDIE, getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_target),
addAddress(CallSiteDIE,
getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_target),
MachineLocation(CallReg));
} else {
DIE *CalleeDIE = getOrCreateSubprogramDIE(CalleeSP);
assert(CalleeDIE && "Could not create DIE for call site entry origin");
addDIEEntry(CallSiteDIE, getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_origin),
addDIEEntry(CallSiteDIE,
getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_origin),
*CalleeDIE);
}
if (IsTail)
// Attach DW_AT_call_tail_call to tail calls for standards compliance.
addFlag(CallSiteDIE, getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_tail_call));
addFlag(CallSiteDIE,
getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_tail_call));
// Attach the return PC to allow the debugger to disambiguate call paths
// from one function to another.

View File

@ -604,8 +604,7 @@ static void collectCallSiteParameters(const MachineInstr *CallMI,
return 0;
};
auto finishCallSiteParam = [&](DbgValueLoc &DbgLocVal,
unsigned &Reg) {
auto finishCallSiteParam = [&](DbgValueLoc &DbgLocVal, unsigned &Reg) {
unsigned FwdReg = Reg;
if (ShouldTryEmitEntryVals && RegsForEntryValues.count(Reg))
FwdReg = RegsForEntryValues[Reg];
@ -642,8 +641,7 @@ static void collectCallSiteParameters(const MachineInstr *CallMI,
unsigned FP = TRI->getFrameRegister(*MF);
bool IsSPorFP = (RegLoc == SP) || (RegLoc == FP);
if (TRI->isCallerPreservedPhysReg(RegLoc, *MF) || IsSPorFP) {
DbgValueLoc DbgLocVal(
Expr, MachineLocation(RegLoc, IsSPorFP));
DbgValueLoc DbgLocVal(Expr, MachineLocation(RegLoc, IsSPorFP));
finishCallSiteParam(DbgLocVal, Reg);
} else if (ShouldTryEmitEntryVals) {
ArgsRegsForProcess.insert(RegLoc);
@ -689,7 +687,6 @@ void DwarfDebug::constructCallSiteEntryDIEs(const DISubprogram &SP,
const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo();
assert(TII && "TargetInstrInfo not found: cannot label tail calls");
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
bool ApplyGNUExtensions = getDwarfVersion() == 4 && tuneForGDB();
// Emit call site entries for each call or tail call in the function.
@ -748,9 +745,10 @@ void DwarfDebug::constructCallSiteEntryDIEs(const DISubprogram &SP,
LLVM_DEBUG(dbgs() << "CallSiteEntry: " << MF.getName() << " -> "
<< (CalleeDecl ? CalleeDecl->getName()
: StringRef(TRI->getName(CallReg)))
<< (IsTail ? " [IsTail]" : "")
<< "\n");
: StringRef(MF.getSubtarget()
.getRegisterInfo()
->getName(CallReg)))
<< (IsTail ? " [IsTail]" : "") << "\n");
DIE &CallSiteDIE =
CU.constructCallSiteEntryDIE(ScopeDIE, CalleeSP, IsTail, PCAddr,