summaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Native/InputFile.cpp
AgeCommit message (Collapse)Author
2023-11-06[DebugInfo] Use StringRef::starts_with/ends_with instead of ↵Simon Pilgrim
startswith/endswith. NFC. startswith/endswith wrap starts_with/ends_with and will eventually go away (to more closely match string_view)
2023-10-12Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata
Note that llvm::support::endianness has been renamed to llvm::endianness while becoming an enum class as opposed to an enum. This patch replaces support::{big,little,native} with llvm::endianness::{big,little,native}.
2023-06-25[llvm] Add missing StringExtras.h includesElliot Goodrich
In preparation for removing the `#include "llvm/ADT/StringExtras.h"` from the header to source file of `llvm/Support/Error.h`, first add in all the missing includes that were previously included transitively through this header.
2023-05-12[llvm] Migrate {starts,ends}with_insensitive to ↵Kazu Hirata
{starts,ends}_with_insensitive (NFC) This patch migrates uses of StringRef::{starts,ends}with_insensitive to StringRef::{starts,ends}_with_insensitive so that we can use names similar to those used in std::string_view. I'm planning to deprecate StringRef::{starts,ends}with_insensitive once the migration is complete across the code base. Differential Revision: https://reviews.llvm.org/D150426
2023-04-17[nfc][llvm] Replace pointer cast functions in PointerUnion by llvm casting ↵Shraiysh Vaishay
functions. This patch replaces the uses of PointerUnion.is function by llvm::isa, PointerUnion.get function by llvm::cast, and PointerUnion.dyn_cast by llvm::dyn_cast_if_present. This is according to the FIXME in the definition of the class PointerUnion. This patch does not remove them as they are being used in other subprojects. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D148449
2022-06-20Don't use Optional::hasValue (NFC)Kazu Hirata
2022-05-25Reland "[llvm-pdbutil] Add options to only dump symbol record at specified ↵Zequan Wu
offset and its parents or children with spcified depth." This reverts commit cfb4e782520ce59602a34732386ebbdf58136cfb.
2022-04-28Revert "[llvm-pdbutil] Add options to only dump symbol record at specified ↵Michael Forster
offset and its parents or children with spcified depth." This reverts commit a3b7cb015fd5fd2aa98afda8ae22759576ce2888. symbol-offset.test fails under MSAN: [ 1] ; RUN: llvm-pdbutil yaml2pdb %p/Inputs/symbol-offset.yaml --pdb=%t.pdb [FAIL] llvm-pdbutil yaml2pdb <REDACTED>/llvm/test/tools/llvm-pdbutil/Inputs/symbol-offset.yaml --pdb=<REDACTED>/tmp/symbol-offset.test/symbol-offset.test.tmp.pdb ==9283==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x55f975e5eb91 in __libcpp_tls_set <REDACTED>/include/c++/v1/__threading_support:428:12 #1 0x55f975e5eb91 in set_pointer <REDACTED>/include/c++/v1/thread:196:5 #2 0x55f975e5eb91 in void* std::__msan::__thread_proxy<std::__msan::tuple<std::__msan::unique_ptr<std::__msan::__thread_struct, std::__msan::default_delete<std::__msan::__thread_struct> >, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*) <REDACTED>/include/c++/v1/thread:285:27 #3 0x7f74a1e55b54 in start_thread (<REDACTED>/libpthread.so.0+0xbb54) (BuildId: 64752de50ebd1a108f4b3f8d0d7e1a13) #4 0x7f74a1dc9f7e in clone (<REDACTED>/libc.so.6+0x13cf7e) (BuildId: 7cfed7708e5ab7fcb286b373de21ee76)
2022-04-27[llvm-pdbutil] Add options to only dump symbol record at specified offset ↵Zequan Wu
and its parents or children with spcified depth. Right now, if we want to dump symbol at specified offset, we need to use `grep`. And it can only show surrounding symbols in layout (not in lexical scope sense). This adds similar options to `dump` command as `llvm-dwarfdump` to allow users to dump symbol record at specified offset and its parents or children with spcified depth. `--symbol-offset=` must be used with `--modi` to dump only one symbol at given offset. `--show-parents`/`--show-children` must be used with `--symbol-offset` to dump all symbols that are parents/children of the symbol at given offset. `--parent-recurse-depth`/`--children-recurse-depth` must be used with `--show-parents`/`--show-children` to specify the max up/down depth. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D124317
2022-04-12[llvm-pdbutil] Fix broken '-modi' option after change D122226.Carlos Alberto Enciso
The change described by: https://reviews.llvm.org/D122226 Moved some llvm-pdbutil functionality to the debug PDB library. This patch addresses a broken '-modi' argument handling, which causes an assertion if its value is other than '0' or '1'. In addition, it moves the assertion for the number of occurrences of the '-modi' argument from the PDB library into the llvm-pdbutil driver. Reviewed By: zequanwu Differential Revision: https://reviews.llvm.org/D123483
2022-04-08[llvm-pdbutil] Move global state (Filters) inside LinePrinter class.Carlos Alberto Enciso
The changes described by: https://reviews.llvm.org/D121801 https://reviews.llvm.org/D122226 Moved some llvm-pdbutil functionality to the debug PDB library. This patch addresses one outstanding issue concerning the global state (Filters) created in the PDB library. - Move 'Filters' inside the 'LinePrinter' class. - Omit 'Optional' and just pass 'PrintScope &HeaderScope' everywhere. Reviewed By: aganea Differential Revision: https://reviews.llvm.org/D122887
2022-03-28Apply clang-tidy fixes for modernize-use-equals-default in InputFile.cpp (NFC)Kazu Hirata
2022-03-25[llvm-pdbutil] Move InputFile/FormatUtil/LinePrinter to PDB library.Carlos Alberto Enciso
At Sony we are developing llvm-dva https://lists.llvm.org/pipermail/llvm-dev/2020-August/144174.html For its PDB support, it requires functionality already present in llvm-pdbutil. We intend to move that functionaly into the PDB library to be shared by both tools. That change will be done in 2 steps, that will be submitted as 2 patches: (1) Replace 'ExitOnError' with explicit error handling. (2) Move the intended shared code to the PDB library. Patch for step (1): https://reviews.llvm.org/D121801 This patch is for step (2). Move InputFile.cpp[h], FormatUtil.cpp[h] and LinePrinter.cpp[h] files to the debug PDB library. It exposes the following functionality that can be used by tools: - Open a PDB file. - Get module debug stream. - Traverse module sections. - Traverse module subsections. Most of the needed functionality is in InputFile, but there are dependencies from LinePrinter and FormatUtil. Some other functionality is in the following functions in DumpOutputStyle.cpp file: - iterateModuleSubsections - getModuleDebugStream - iterateOneModule - iterateSymbolGroups - iterateModuleSubsections Only these specific functions from DumpOutputStyle are moved to the PDB library. Reviewed By: aganea, dblaikie, rnk Differential Revision: https://reviews.llvm.org/D122226