]> granicus.if.org Git - llvm/commitdiff
[DWARF] Rename getDwarf5OrGNUCallSite{Attr,Tag}, NFC
authorVedant Kumar <vsk@apple.com>
Mon, 26 Aug 2019 20:53:34 +0000 (20:53 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 26 Aug 2019 20:53:34 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369967 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 4ed452d61d55dc53c7014a941c6d9c978ff67738..626486a5761e1990fad2423ca9d7d372949efa79 100644 (file)
@@ -897,7 +897,7 @@ static bool useGNUAnalogForDwarf5Feature(DwarfDebug *DD) {
   return DD->getDwarfVersion() == 4 && DD->tuneForGDB();
 }
 
-dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const {
+dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUTag(dwarf::Tag Tag) const {
   if (!useGNUAnalogForDwarf5Feature(DD))
     return Tag;
   switch (Tag) {
@@ -906,12 +906,12 @@ dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const {
   case dwarf::DW_TAG_call_site_parameter:
     return dwarf::DW_TAG_GNU_call_site_parameter;
   default:
-    llvm_unreachable("unhandled call site tag");
+    llvm_unreachable("DWARF5 tag with no GNU analog");
   }
 }
 
 dwarf::Attribute
-DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const {
+DwarfCompileUnit::getDwarf5OrGNUAttr(dwarf::Attribute Attr) const {
   if (!useGNUAnalogForDwarf5Feature(DD))
     return Attr;
   switch (Attr) {
@@ -928,7 +928,7 @@ DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const {
   case dwarf::DW_AT_call_tail_call:
     return dwarf::DW_AT_GNU_tail_call;
   default:
-    llvm_unreachable("unhandled call site attribute");
+    llvm_unreachable("DWARF5 attribute with no GNU analog");
   }
 }
 
@@ -948,26 +948,23 @@ 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(getDwarf5OrGNUTag(dwarf::DW_TAG_call_site),
+                                     ScopeDIE, nullptr);
 
   if (CallReg) {
     // Indirect call.
-    addAddress(CallSiteDIE,
-               getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_target),
+    addAddress(CallSiteDIE, getDwarf5OrGNUAttr(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, getDwarf5OrGNUAttr(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, getDwarf5OrGNUAttr(dwarf::DW_AT_call_tail_call));
 
   // Attach the return PC to allow the debugger to disambiguate call paths
   // from one function to another.
@@ -988,7 +985,7 @@ void DwarfCompileUnit::constructCallSiteParmEntryDIEs(
     unsigned Register = Param.getRegister();
     auto CallSiteDieParam =
         DIE::get(DIEValueAllocator,
-                 getDwarf5OrGNUCallSiteTag(dwarf::DW_TAG_call_site_parameter));
+                 getDwarf5OrGNUTag(dwarf::DW_TAG_call_site_parameter));
     insertDIE(CallSiteDieParam);
     addAddress(*CallSiteDieParam, dwarf::DW_AT_location,
                MachineLocation(Register));
@@ -999,8 +996,7 @@ void DwarfCompileUnit::constructCallSiteParmEntryDIEs(
 
     DwarfDebug::emitDebugLocValue(*Asm, nullptr, Param.getValue(), DwarfExpr);
 
-    addBlock(*CallSiteDieParam,
-             getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_value),
+    addBlock(*CallSiteDieParam, getDwarf5OrGNUAttr(dwarf::DW_AT_call_value),
              DwarfExpr.finalize());
 
     CallSiteDIE.addChild(CallSiteDieParam);
index 361bb4c669d0e8e15094151aaf66bd2d43f96842..1b7ea2673ac09b25535b6c25db586ac6dda45738 100644 (file)
@@ -227,12 +227,11 @@ public:
 
   void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
 
-  /// This takes the official DWARF 5 tag and returns the appropriate
-  /// GNU tag if needed.
-  dwarf::Tag getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const;
-  /// This takes the official DWARF 5 attribute and returns the appropriate
-  /// GNU attribute if needed.
-  dwarf::Attribute getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const;
+  /// This takes a DWARF 5 tag and returns it or a GNU analog.
+  dwarf::Tag getDwarf5OrGNUTag(dwarf::Tag Tag) const;
+
+  /// This takes a DWARF 5 attribute and returns it or a GNU analog.
+  dwarf::Attribute getDwarf5OrGNUAttr(dwarf::Attribute Attr) const;
 
   /// This takes a DWARF 5 location atom and either returns it or a GNU analog.
   dwarf::LocationAtom getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const;
index 136c0e90163e7fe9b6ce2846072801f98615bdaf..371ee3a7e166447bbabf6d6d48314785abf5d89c 100644 (file)
@@ -709,8 +709,7 @@ void DwarfDebug::constructCallSiteEntryDIEs(const DISubprogram &SP,
   // for both tail and non-tail calls. Don't use DW_AT_call_all_source_calls
   // because one of its requirements is not met: call site entries for
   // optimized-out calls are elided.
-  CU.addFlag(ScopeDIE,
-             CU.getDwarf5OrGNUCallSiteAttr(dwarf::DW_AT_call_all_calls));
+  CU.addFlag(ScopeDIE, CU.getDwarf5OrGNUAttr(dwarf::DW_AT_call_all_calls));
 
   const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo();
   assert(TII && "TargetInstrInfo not found: cannot label tail calls");