From owner-svn-src-vendor@freebsd.org Sat Jul 23 21:17:52 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90AE8BA25FA; Sat, 23 Jul 2016 21:17:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FEFD15B9; Sat, 23 Jul 2016 21:17:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6NLHpwf024105; Sat, 23 Jul 2016 21:17:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6NLHpgJ024103; Sat, 23 Jul 2016 21:17:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201607232117.u6NLHpgJ024103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 23 Jul 2016 21:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r303247 - in vendor/llvm/dist: include/llvm/DebugInfo/DWARF lib/DebugInfo/DWARF X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2016 21:17:52 -0000 Author: dim Date: Sat Jul 23 21:17:51 2016 New Revision: 303247 URL: https://svnweb.freebsd.org/changeset/base/303247 Log: Fix-up EOL-styles changed by upstream. Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h (contents, props changed) vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp (contents, props changed) Modified: vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h ============================================================================== --- vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h Sat Jul 23 21:15:40 2016 (r303246) +++ vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h Sat Jul 23 21:17:51 2016 (r303247) @@ -1,58 +1,58 @@ -//===-- DWARFDebugMacro.h ---------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H -#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H - -#include "llvm/ADT/SmallVector.h" -#include "llvm/Support/DataExtractor.h" -#include "llvm/Support/Dwarf.h" - -namespace llvm { - -class raw_ostream; - -class DWARFDebugMacro { - /// A single macro entry within a macro list. - struct Entry { - /// The type of the macro entry. - uint32_t Type; - union { - /// The source line where the macro is defined. - uint64_t Line; - /// Vendor extension constant value. - uint64_t ExtConstant; - }; - - union { - /// The string (name, value) of the macro entry. - const char *MacroStr; - // An unsigned integer indicating the identity of the source file. - uint64_t File; - /// Vendor extension string. - const char *ExtStr; - }; - }; - - typedef SmallVector MacroList; - - /// A list of all the macro entries in the debug_macinfo section. - MacroList Macros; - -public: - DWARFDebugMacro() {} - /// Print the macro list found within the debug_macinfo section. - void dump(raw_ostream &OS) const; - /// Parse the debug_macinfo section accessible via the 'data' parameter. - void parse(DataExtractor data); -}; - -} - -#endif +//===-- DWARFDebugMacro.h ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H +#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGMACRO_H + +#include "llvm/ADT/SmallVector.h" +#include "llvm/Support/DataExtractor.h" +#include "llvm/Support/Dwarf.h" + +namespace llvm { + +class raw_ostream; + +class DWARFDebugMacro { + /// A single macro entry within a macro list. + struct Entry { + /// The type of the macro entry. + uint32_t Type; + union { + /// The source line where the macro is defined. + uint64_t Line; + /// Vendor extension constant value. + uint64_t ExtConstant; + }; + + union { + /// The string (name, value) of the macro entry. + const char *MacroStr; + // An unsigned integer indicating the identity of the source file. + uint64_t File; + /// Vendor extension string. + const char *ExtStr; + }; + }; + + typedef SmallVector MacroList; + + /// A list of all the macro entries in the debug_macinfo section. + MacroList Macros; + +public: + DWARFDebugMacro() {} + /// Print the macro list found within the debug_macinfo section. + void dump(raw_ostream &OS) const; + /// Parse the debug_macinfo section accessible via the 'data' parameter. + void parse(DataExtractor data); +}; + +} + +#endif Modified: vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp ============================================================================== --- vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp Sat Jul 23 21:15:40 2016 (r303246) +++ vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp Sat Jul 23 21:17:51 2016 (r303247) @@ -1,102 +1,102 @@ -//===-- DWARFDebugMacro.cpp -----------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/DebugInfo/DWARF/DWARFDebugMacro.h" -#include "SyntaxHighlighting.h" -#include "llvm/Support/Dwarf.h" -#include "llvm/Support/Format.h" -#include "llvm/Support/raw_ostream.h" - -using namespace llvm; -using namespace dwarf; -using namespace syntax; - -void DWARFDebugMacro::dump(raw_ostream &OS) const { - unsigned IndLevel = 0; - for (const Entry &E : Macros) { - // There should not be DW_MACINFO_end_file when IndLevel is Zero. However, - // this check handles the case of corrupted ".debug_macinfo" section. - if (IndLevel > 0) - IndLevel -= (E.Type == DW_MACINFO_end_file); - // Print indentation. - for (unsigned I = 0; I < IndLevel; I++) - OS << " "; - IndLevel += (E.Type == DW_MACINFO_start_file); - - WithColor(OS, syntax::Macro).get() << MacinfoString(E.Type); - switch (E.Type) { - default: - // Got a corrupted ".debug_macinfo" section (invalid macinfo type). - break; - case DW_MACINFO_define: - case DW_MACINFO_undef: - OS << " - lineno: " << E.Line; - OS << " macro: " << E.MacroStr; - break; - case DW_MACINFO_start_file: - OS << " - lineno: " << E.Line; - OS << " filenum: " << E.File; - break; - case DW_MACINFO_end_file: - break; - case DW_MACINFO_vendor_ext: - OS << " - constant: " << E.ExtConstant; - OS << " string: " << E.ExtStr; - break; - } - OS << "\n"; - } -} - -void DWARFDebugMacro::parse(DataExtractor data) { - uint32_t Offset = 0; - while (data.isValidOffset(Offset)) { - // A macro list entry consists of: - Entry E; - // 1. Macinfo type - E.Type = data.getULEB128(&Offset); - - if (E.Type == 0) { - // Reached end of ".debug_macinfo" section. - return; - } - - switch (E.Type) { - default: - // Got a corrupted ".debug_macinfo" section (invalid macinfo type). - // Push the corrupted entry to the list and halt parsing. - E.Type = DW_MACINFO_invalid; - Macros.push_back(E); - return; - case DW_MACINFO_define: - case DW_MACINFO_undef: - // 2. Source line - E.Line = data.getULEB128(&Offset); - // 3. Macro string - E.MacroStr = data.getCStr(&Offset); - break; - case DW_MACINFO_start_file: - // 2. Source line - E.Line = data.getULEB128(&Offset); - // 3. Source file id - E.File = data.getULEB128(&Offset); - break; - case DW_MACINFO_end_file: - break; - case DW_MACINFO_vendor_ext: - // 2. Vendor extension constant - E.ExtConstant = data.getULEB128(&Offset); - // 3. Vendor extension string - E.ExtStr = data.getCStr(&Offset); - break; - } - - Macros.push_back(E); - } -} +//===-- DWARFDebugMacro.cpp -----------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/DebugInfo/DWARF/DWARFDebugMacro.h" +#include "SyntaxHighlighting.h" +#include "llvm/Support/Dwarf.h" +#include "llvm/Support/Format.h" +#include "llvm/Support/raw_ostream.h" + +using namespace llvm; +using namespace dwarf; +using namespace syntax; + +void DWARFDebugMacro::dump(raw_ostream &OS) const { + unsigned IndLevel = 0; + for (const Entry &E : Macros) { + // There should not be DW_MACINFO_end_file when IndLevel is Zero. However, + // this check handles the case of corrupted ".debug_macinfo" section. + if (IndLevel > 0) + IndLevel -= (E.Type == DW_MACINFO_end_file); + // Print indentation. + for (unsigned I = 0; I < IndLevel; I++) + OS << " "; + IndLevel += (E.Type == DW_MACINFO_start_file); + + WithColor(OS, syntax::Macro).get() << MacinfoString(E.Type); + switch (E.Type) { + default: + // Got a corrupted ".debug_macinfo" section (invalid macinfo type). + break; + case DW_MACINFO_define: + case DW_MACINFO_undef: + OS << " - lineno: " << E.Line; + OS << " macro: " << E.MacroStr; + break; + case DW_MACINFO_start_file: + OS << " - lineno: " << E.Line; + OS << " filenum: " << E.File; + break; + case DW_MACINFO_end_file: + break; + case DW_MACINFO_vendor_ext: + OS << " - constant: " << E.ExtConstant; + OS << " string: " << E.ExtStr; + break; + } + OS << "\n"; + } +} + +void DWARFDebugMacro::parse(DataExtractor data) { + uint32_t Offset = 0; + while (data.isValidOffset(Offset)) { + // A macro list entry consists of: + Entry E; + // 1. Macinfo type + E.Type = data.getULEB128(&Offset); + + if (E.Type == 0) { + // Reached end of ".debug_macinfo" section. + return; + } + + switch (E.Type) { + default: + // Got a corrupted ".debug_macinfo" section (invalid macinfo type). + // Push the corrupted entry to the list and halt parsing. + E.Type = DW_MACINFO_invalid; + Macros.push_back(E); + return; + case DW_MACINFO_define: + case DW_MACINFO_undef: + // 2. Source line + E.Line = data.getULEB128(&Offset); + // 3. Macro string + E.MacroStr = data.getCStr(&Offset); + break; + case DW_MACINFO_start_file: + // 2. Source line + E.Line = data.getULEB128(&Offset); + // 3. Source file id + E.File = data.getULEB128(&Offset); + break; + case DW_MACINFO_end_file: + break; + case DW_MACINFO_vendor_ext: + // 2. Vendor extension constant + E.ExtConstant = data.getULEB128(&Offset); + // 3. Vendor extension string + E.ExtStr = data.getCStr(&Offset); + break; + } + + Macros.push_back(E); + } +}