diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h --- a/llvm/include/llvm/DebugInfo/DIContext.h +++ b/llvm/include/llvm/DebugInfo/DIContext.h @@ -56,9 +56,7 @@ Discriminator == RHS.Discriminator; } - bool operator!=(const DILineInfo &RHS) const { - return !(*this == RHS); - } + bool operator!=(const DILineInfo &RHS) const { return !(*this == RHS); } bool operator<(const DILineInfo &RHS) const { return std::tie(FileName, FunctionName, StartFileName, Line, Column, @@ -92,7 +90,7 @@ public: DIInliningInfo() = default; - const DILineInfo & getFrame(unsigned Index) const { + const DILineInfo &getFrame(unsigned Index) const { assert(Index < Frames.size()); return Frames[Index]; } @@ -102,17 +100,11 @@ return &Frames[Index]; } - uint32_t getNumberOfFrames() const { - return Frames.size(); - } + uint32_t getNumberOfFrames() const { return Frames.size(); } - void addFrame(const DILineInfo &Frame) { - Frames.push_back(Frame); - } + void addFrame(const DILineInfo &Frame) { Frames.push_back(Frame); } - void resize(unsigned i) { - Frames.resize(i); - } + void resize(unsigned i) { Frames.resize(i); } }; /// Container for description of a global variable. @@ -175,7 +167,7 @@ /// Selects which debug sections get dumped. enum DIDumpType : unsigned { DIDT_Null, - DIDT_All = ~0U, + DIDT_All = ~0U, #define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME, OPTION) \ DIDT_##ENUM_NAME = 1U << DIDT_ID_##ENUM_NAME, #include "llvm/BinaryFormat/Dwarf.def" @@ -224,10 +216,7 @@ class DIContext { public: - enum DIContextKind { - CK_DWARF, - CK_PDB - }; + enum DIContextKind { CK_DWARF, CK_PDB }; DIContext(DIContextKind K) : Kind(K) {} virtual ~DIContext() = default; @@ -311,7 +300,7 @@ public: template - LoadedObjectInfoHelper(Ts &&... Args) : Base(std::forward(Args)...) {} + LoadedObjectInfoHelper(Ts &&...Args) : Base(std::forward(Args)...) {} std::unique_ptr clone() const override { return std::make_unique(static_cast(*this)); diff --git a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h --- a/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h +++ b/llvm/include/llvm/DebugInfo/GSYM/LookupResult.h @@ -9,8 +9,8 @@ #ifndef LLVM_DEBUGINFO_GSYM_LOOKUPRESULT_H #define LLVM_DEBUGINFO_GSYM_LOOKUPRESULT_H -#include "llvm/DebugInfo/GSYM/Range.h" #include "llvm/ADT/StringRef.h" +#include "llvm/DebugInfo/GSYM/Range.h" #include #include @@ -20,27 +20,25 @@ struct FileEntry; struct SourceLocation { - StringRef Name; ///< Function or symbol name. - StringRef Dir; ///< Line entry source file directory path. - StringRef Base; ///< Line entry source file basename. - uint32_t Line = 0; ///< Source file line number. + StringRef Name; ///< Function or symbol name. + StringRef Dir; ///< Line entry source file directory path. + StringRef Base; ///< Line entry source file basename. + uint32_t Line = 0; ///< Source file line number. uint32_t Offset = 0; ///< Byte size offset within the named function. }; inline bool operator==(const SourceLocation &LHS, const SourceLocation &RHS) { - return LHS.Name == RHS.Name && LHS.Dir == RHS.Dir && - LHS.Base == RHS.Base && LHS.Line == RHS.Line && - LHS.Offset == RHS.Offset; + return LHS.Name == RHS.Name && LHS.Dir == RHS.Dir && LHS.Base == RHS.Base && + LHS.Line == RHS.Line && LHS.Offset == RHS.Offset; } raw_ostream &operator<<(raw_ostream &OS, const SourceLocation &R); using SourceLocations = std::vector; - struct LookupResult { uint64_t LookupAddr = 0; ///< The address that this lookup pertains to. - AddressRange FuncRange; ///< The concrete function address range. + AddressRange FuncRange; ///< The concrete function address range. StringRef FuncName; ///< The concrete function name that contains LookupAddr. /// The source locations that match this address. This information will only /// be filled in if the FunctionInfo contains a line table. If an address is diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h --- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h +++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h @@ -15,8 +15,8 @@ #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/Object/Binary.h" -#include "llvm/Object/ObjectFile.h" #include "llvm/Object/ELFObjectFile.h" +#include "llvm/Object/ObjectFile.h" #include "llvm/Support/Error.h" #include #include @@ -54,9 +54,7 @@ LLVMSymbolizer() = default; LLVMSymbolizer(const Options &Opts) : Opts(Opts) {} - ~LLVMSymbolizer() { - flush(); - } + ~LLVMSymbolizer() { flush(); } // Overloads accepting ObjectFile does not support COFF currently Expected symbolizeCode(const ObjectFile &Obj, @@ -115,8 +113,7 @@ Expected getOrCreateModuleInfo(const ObjectFile &Obj); Expected - createModuleInfo(const ObjectFile *Obj, - std::unique_ptr Context, + createModuleInfo(const ObjectFile *Obj, std::unique_ptr Context, StringRef ModuleName); ObjectFile *lookUpDsymFile(const std::string &Path, @@ -131,13 +128,13 @@ /// Returns pair of pointers to object and debug object. Expected getOrCreateObjectPair(const std::string &Path, - const std::string &ArchName); + const std::string &ArchName); /// Return a pointer to object file at specified path, for a specified /// architecture (e.g. if path refers to a Mach-O universal binary, only one /// object file from it will be returned). Expected getOrCreateObject(const std::string &Path, - const std::string &ArchName); + const std::string &ArchName); std::map, std::less<>> Modules; diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp --- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp +++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp @@ -210,8 +210,8 @@ // /path/to/foo.dSYM/Contents/Resources/DWARF/foo. // For Path="/path/to/bar.dSYM" and Basename="foo" assume that debug info is in // /path/to/bar.dSYM/Contents/Resources/DWARF/foo. -std::string getDarwinDWARFResourceForPath( - const std::string &Path, const std::string &Basename) { +std::string getDarwinDWARFResourceForPath(const std::string &Path, + const std::string &Basename) { SmallString<16> ResourceName = StringRef(Path); if (sys::path::extension(Path) != ".dSYM") { ResourceName += ".dSYM"; @@ -330,7 +330,8 @@ continue; Error Err = Error::success(); for (auto N : Obj.notes(P, Err)) - if (N.getType() == ELF::NT_GNU_BUILD_ID && N.getName() == ELF::ELF_NOTE_GNU) + if (N.getType() == ELF::NT_GNU_BUILD_ID && + N.getName() == ELF::ELF_NOTE_GNU) return N.getDesc(); consumeError(std::move(Err)); } @@ -353,8 +354,7 @@ } bool findDebugBinary(const std::vector &DebugFileDirectory, - const ArrayRef BuildID, - std::string &Result) { + const ArrayRef BuildID, std::string &Result) { auto getDebugPath = [&](StringRef Directory) { SmallString<128> Path{Directory}; sys::path::append(Path, ".build-id", @@ -366,11 +366,11 @@ if (DebugFileDirectory.empty()) { SmallString<128> Path = getDebugPath( #if defined(__NetBSD__) - // Try /usr/libdata/debug/.build-id/../... - "/usr/libdata/debug" + // Try /usr/libdata/debug/.build-id/../... + "/usr/libdata/debug" #else - // Try /usr/lib/debug/.build-id/../... - "/usr/lib/debug" + // Try /usr/lib/debug/.build-id/../... + "/usr/lib/debug" #endif ); if (llvm::sys::fs::exists(Path)) { @@ -393,7 +393,8 @@ } // end anonymous namespace ObjectFile *LLVMSymbolizer::lookUpDsymFile(const std::string &ExePath, - const MachOObjectFile *MachExeObj, const std::string &ArchName) { + const MachOObjectFile *MachExeObj, + const std::string &ArchName) { // On Darwin we may find DWARF in separate object file in // resource directory. std::vector DsymPaths; @@ -653,7 +654,8 @@ // approach to check if the name should be demangled. if (Name.substr(0, 2) == "_Z") { int status = 0; - char *DemangledName = itaniumDemangle(Name.c_str(), nullptr, nullptr, &status); + char *DemangledName = + itaniumDemangle(Name.c_str(), nullptr, nullptr, &status); if (status != 0) return Name; std::string Result = DemangledName;