[llvm] r365469 - [NFC][AsmPrinter] Fix the formatting for the rL365467

Djordje Todorovic via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 9 05:06:21 PDT 2019


Author: djtodoro
Date: Tue Jul  9 05:06:21 2019
New Revision: 365469

URL: http://llvm.org/viewvc/llvm-project?rev=365469&view=rev
Log:
[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()'.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=365469&r1=365468&r2=365469&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Tue Jul  9 05:06:21 2019
@@ -894,7 +894,7 @@ dwarf::Tag DwarfCompileUnit::getDwarf5Or
   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::getDwarf5Or
   }
 }
 
-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::getDw
   }
 }
 
-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.

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=365469&r1=365468&r2=365469&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Jul  9 05:06:21 2019
@@ -604,8 +604,7 @@ static void collectCallSiteParameters(co
     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(co
           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::constructCallSiteEntryD
 
   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::constructCallSiteEntryD
 
       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,




More information about the llvm-commits mailing list