diff options
author | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-02-09 01:09:54 +0000 |
---|---|---|
committer | Eugene Zelenko <eugene.zelenko@gmail.com> | 2017-02-09 01:09:54 +0000 |
commit | 44d951226ed135bc4273a74444f94edf24f603e5 (patch) | |
tree | 1ae623f1756af7b5f941611a0e8dcc826032f742 /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | 60fc1dd532e06b5b0c37caff308d33daed1b58e5 (diff) | |
download | bcm5719-llvm-44d951226ed135bc4273a74444f94edf24f603e5.tar.gz bcm5719-llvm-44d951226ed135bc4273a74444f94edf24f603e5.zip |
[MC] Fix some Clang-tidy modernize and Include What You Use warnings in SubtargetFeature; other minor fixes (NFC).
Same changes in files affected by reduced SubtargetFeature.h dependencies.
llvm-svn: 294548
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp index f6940080089..f672680cb9e 100644 --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp @@ -1,4 +1,4 @@ -//===-- SymbolizableObjectFile.cpp ----------------------------------------===// +//===- SymbolizableObjectFile.cpp -----------------------------------------===// // // The LLVM Compiler Infrastructure // @@ -12,15 +12,29 @@ //===----------------------------------------------------------------------===// #include "SymbolizableObjectFile.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/Triple.h" +#include "llvm/DebugInfo/DWARF/DWARFContext.h" +#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h" #include "llvm/Object/COFF.h" +#include "llvm/Object/ObjectFile.h" #include "llvm/Object/SymbolSize.h" +#include "llvm/Support/COFF.h" +#include "llvm/Support/Casting.h" #include "llvm/Support/DataExtractor.h" -#include "llvm/DebugInfo/DWARF/DWARFContext.h" - -namespace llvm { -namespace symbolize { +#include "llvm/Support/Error.h" +#include <algorithm> +#include <cstdint> +#include <memory> +#include <string> +#include <system_error> +#include <utility> +#include <vector> +using namespace llvm; using namespace object; +using namespace symbolize; static DILineInfoSpecifier getDILineInfoSpecifier(FunctionNameKind FNKind) { @@ -73,14 +87,17 @@ SymbolizableObjectFile::SymbolizableObjectFile(ObjectFile *Obj, : Module(Obj), DebugInfoContext(std::move(DICtx)) {} namespace { + struct OffsetNamePair { uint32_t Offset; StringRef Name; + bool operator<(const OffsetNamePair &R) const { return Offset < R.Offset; } }; -} + +} // end anonymous namespace std::error_code SymbolizableObjectFile::addCoffExportSymbols( const COFFObjectFile *CoffObj) { @@ -147,7 +164,7 @@ std::error_code SymbolizableObjectFile::addSymbol(const SymbolRef &Symbol, return errorToErrorCode(SymbolNameOrErr.takeError()); StringRef SymbolName = *SymbolNameOrErr; // Mach-O symbol table names have leading underscore, skip it. - if (Module->isMachO() && SymbolName.size() > 0 && SymbolName[0] == '_') + if (Module->isMachO() && !SymbolName.empty() && SymbolName[0] == '_') SymbolName = SymbolName.drop_front(); // FIXME: If a function has alias, there are two entries in symbol table // with same address size. Make sure we choose the correct one. @@ -252,7 +269,3 @@ DIGlobal SymbolizableObjectFile::symbolizeData(uint64_t ModuleOffset) const { Res.Size); return Res; } - -} // namespace symbolize -} // namespace llvm - |