[llvm] r314942 - clang-format file.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 15:26:20 PDT 2017


Author: adrian
Date: Wed Oct  4 15:26:19 2017
New Revision: 314942

URL: http://llvm.org/viewvc/llvm-project?rev=314942&view=rev
Log:
clang-format file.

Modified:
    llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp

Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=314942&r1=314941&r2=314942&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Wed Oct  4 15:26:19 2017
@@ -132,7 +132,7 @@ static void dumpAttribute(raw_ostream &O
     return;
   const char BaseIndent[] = "            ";
   OS << BaseIndent;
-  OS.indent(Indent+2);
+  OS.indent(Indent + 2);
   auto attrString = AttributeString(Attr);
   if (!attrString.empty())
     WithColor(OS, syntax::Attribute) << attrString;
@@ -161,7 +161,10 @@ static void dumpAttribute(raw_ostream &O
   if (Attr == DW_AT_decl_file || Attr == DW_AT_call_file) {
     Color = syntax::String;
     if (const auto *LT = U->getContext().getLineTableForUnit(U))
-      if (LT->getFileNameByIndex(formValue.getAsUnsignedConstant().getValue(), U->getCompilationDir(), DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
+      if (LT->getFileNameByIndex(
+              formValue.getAsUnsignedConstant().getValue(),
+              U->getCompilationDir(),
+              DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
         File = '"' + File + '"';
         Name = File;
       }
@@ -182,8 +185,9 @@ static void dumpAttribute(raw_ostream &O
   // having both the raw value and the pretty-printed value is
   // interesting. These attributes are handled below.
   if (Attr == DW_AT_specification || Attr == DW_AT_abstract_origin) {
-    if (const char *Name = Die.getAttributeValueAsReferencedDie(Attr).getName(DINameKind::LinkageName))
-        OS << " \"" << Name << '\"';
+    if (const char *Name = Die.getAttributeValueAsReferencedDie(Attr).getName(
+            DINameKind::LinkageName))
+      OS << " \"" << Name << '\"';
   } else if (Attr == DW_AT_APPLE_property_attribute) {
     if (Optional<uint64_t> OptVal = formValue.getAsUnsignedConstant())
       dumpApplePropertyAttribute(OS, *OptVal);
@@ -196,17 +200,14 @@ static void dumpAttribute(raw_ostream &O
   OS << ")\n";
 }
 
-bool DWARFDie::isSubprogramDIE() const {
-  return getTag() == DW_TAG_subprogram;
-}
+bool DWARFDie::isSubprogramDIE() const { return getTag() == DW_TAG_subprogram; }
 
 bool DWARFDie::isSubroutineDIE() const {
   auto Tag = getTag();
   return Tag == DW_TAG_subprogram || Tag == DW_TAG_inlined_subroutine;
 }
 
-Optional<DWARFFormValue>
-DWARFDie::find(dwarf::Attribute Attr) const {
+Optional<DWARFFormValue> DWARFDie::find(dwarf::Attribute Attr) const {
   if (!isValid())
     return None;
   auto AbbrevDecl = getAbbreviationDeclarationPtr();
@@ -258,8 +259,7 @@ DWARFDie::getAttributeValueAsReferencedD
   return DWARFDie();
 }
 
-Optional<uint64_t>
-DWARFDie::getRangesBaseAttribute() const {
+Optional<uint64_t> DWARFDie::getRangesBaseAttribute() const {
   return toSectionOffset(find({DW_AT_rnglists_base, DW_AT_GNU_ranges_base}));
 }
 
@@ -292,8 +292,7 @@ bool DWARFDie::getLowAndHighPC(uint64_t
   return false;
 }
 
-DWARFAddressRangesVector
-DWARFDie::getAddressRanges() const {
+DWARFAddressRangesVector DWARFDie::getAddressRanges() const {
   if (isNULL())
     return DWARFAddressRangesVector();
   // Single range specified by low/high PC.
@@ -311,8 +310,8 @@ DWARFDie::getAddressRanges() const {
   return DWARFAddressRangesVector();
 }
 
-void
-DWARFDie::collectChildrenAddressRanges(DWARFAddressRangesVector& Ranges) const {
+void DWARFDie::collectChildrenAddressRanges(
+    DWARFAddressRangesVector &Ranges) const {
   if (isNULL())
     return;
   if (isSubprogramDIE()) {
@@ -320,33 +319,32 @@ DWARFDie::collectChildrenAddressRanges(D
     Ranges.insert(Ranges.end(), DIERanges.begin(), DIERanges.end());
   }
 
-  for (auto Child: children())
+  for (auto Child : children())
     Child.collectChildrenAddressRanges(Ranges);
 }
 
 bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const {
-  for (const auto& R : getAddressRanges()) {
+  for (const auto &R : getAddressRanges()) {
     if (R.LowPC <= Address && Address < R.HighPC)
       return true;
   }
   return false;
 }
 
-const char *
-DWARFDie::getSubroutineName(DINameKind Kind) const {
+const char *DWARFDie::getSubroutineName(DINameKind Kind) const {
   if (!isSubroutineDIE())
     return nullptr;
   return getName(Kind);
 }
 
-const char *
-DWARFDie::getName(DINameKind Kind) const {
+const char *DWARFDie::getName(DINameKind Kind) const {
   if (!isValid() || Kind == DINameKind::None)
     return nullptr;
   // Try to get mangled name only if it was asked for.
   if (Kind == DINameKind::LinkageName) {
-    if (auto Name = dwarf::toString(findRecursively({DW_AT_MIPS_linkage_name,
-                                    DW_AT_linkage_name}), nullptr))
+    if (auto Name = dwarf::toString(
+            findRecursively({DW_AT_MIPS_linkage_name, DW_AT_linkage_name}),
+            nullptr))
       return Name;
   }
   if (auto Name = dwarf::toString(findRecursively(DW_AT_name), nullptr))
@@ -401,7 +399,7 @@ void DWARFDie::dump(raw_ostream &OS, uns
           WithColor(OS, syntax::Tag).get().indent(Indent) << tagString;
         else
           WithColor(OS, syntax::Tag).get().indent(Indent)
-          << format("DW_TAG_Unknown_%x", getTag());
+              << format("DW_TAG_Unknown_%x", getTag());
 
         if (DumpOpts.Verbose)
           OS << format(" [%u] %c", abbrCode,
@@ -424,13 +422,13 @@ void DWARFDie::dump(raw_ostream &OS, uns
         if (DumpOpts.RecurseDepth > 0 && child) {
           DumpOpts.RecurseDepth--;
           while (child) {
-            child.dump(OS, Indent+2, DumpOpts);
+            child.dump(OS, Indent + 2, DumpOpts);
             child = child.getSibling();
           }
         }
       } else {
         OS << "Abbreviation code not found in 'debug_abbrev' class for code: "
-        << abbrCode << '\n';
+           << abbrCode << '\n';
       }
     } else {
       OS.indent(Indent) << "NULL\n";
@@ -452,14 +450,13 @@ DWARFDie DWARFDie::getSibling() const {
   return DWARFDie();
 }
 
-iterator_range<DWARFDie::attribute_iterator>
-DWARFDie::attributes() const {
+iterator_range<DWARFDie::attribute_iterator> DWARFDie::attributes() const {
   return make_range(attribute_iterator(*this, false),
                     attribute_iterator(*this, true));
 }
 
-DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End) :
-    Die(D), AttrValue(0), Index(0) {
+DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End)
+    : Die(D), AttrValue(0), Index(0) {
   auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
   assert(AbbrDecl && "Must have abbreviation declaration");
   if (End) {




More information about the llvm-commits mailing list