aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Native
AgeCommit message (Collapse)AuthorFilesLines
2025-09-10[PDB] Add public symbol lookup by address (#157361)nerix1-0/+50
This adds a method on the `PublicsStream` to look up symbols using their address (segment + offset). It's largely a reimplementation of [`NearestSym`](https://github.com/microsoft/microsoft-pdb/blob/805655a28bd8198004be2ac27e6e0290121a5e89/PDB/dbi/gsi.cpp#L1492-L1581) from the reference. However, we don't return the nearest symbol, but the exact symbol. Still, in case of ICF, we return the symbol that's first in the address map. Users can then use the returned offset to read the next records to check if multiple symbols overlap, if desired. From #149701.
2025-08-29[llvm] Support building with c++23 (#154372)Kyle Krüger1-0/+5
closes #154331 This PR addresses all minimum changes needed to compile LLVM and MLIR with the c++23 standard. It is a work in progress and to be reviewed for better methods of handling the parts of the build broken by c++23.
2025-07-03[DebugInfo] Remove an unnecessary cast (NFC) (#146809)Kazu Hirata1-1/+1
Mem is already of uint8_t *.
2025-05-23[pdb] Tweak the message about overflowing the publics/globals record streamHans Wennborg1-2/+2
Follow-up to https://github.com/llvm/llvm-project/pull/140884
2025-05-22[pdb] Provide a better error message when overflowing the public/global ↵Hans Wennborg1-2/+10
symbol record stream (#140884) Before: lld-link: error: Stream Error: The stream is too short to perform the requested operation. lld-link: error: failed to write PDB file ./unit_tests.exe.pdb After: lld-link: error: the public (2127832912 bytes) and global (2200532960 bytes) symbols are too large to fit in a PDB file; the maximum total is 4294967295 bytes. lld-link: error: failed to write PDB file ./unit_tests.exe.pdb
2025-03-23[DebugInfo] Avoid repeated hash lookups (NFC) (#132586)Kazu Hirata1-3/+4
2024-11-18[PDB] Fix missing `consumeError` which raise error with asserts enabled ↵Romain Thomas1-2/+6
(#116480) As mentioned in the title, the missing `consumeError` triggers assertions.
2024-11-17[DebugInfo] Remove unused includes (NFC) (#116551)Kazu Hirata20-24/+0
Identified with misc-include-cleaner.
2024-10-15[DebugInfo] Avoid repeated hash lookups (NFC) (#112298)Kazu Hirata1-3/+3
2024-06-29[llvm] Use std::make_unique (NFC) (#97165)Kazu Hirata1-2/+1
This patch is based on clang-tidy's modernize-make-unique but limited to those cases where type names are mentioned twice like std::unique_ptr<Type>(new Type()), which is a bit mouthful.
2024-03-10Add llvm::min/max_element and use it in llvm/ and mlir/ directories. (#84678)Justin Lebar1-2/+1
For some reason this was missing from STLExtras.
2023-12-08[DebugInfo] Use llvm::to_underlying (NFC)Kazu Hirata1-3/+2
2023-11-13[llvm] Stop including llvm/ADT/SparseBitVector.h (NFC)Kazu Hirata1-1/+0
Identified with clangd.
2023-11-06[DebugInfo] Use StringRef::starts_with/ends_with instead of ↵Simon Pilgrim3-3/+3
startswith/endswith. NFC. startswith/endswith wrap starts_with/ends_with and will eventually go away (to more closely match string_view)
2023-10-21[llvm] Stop including Endian.h (NFC)Kazu Hirata4-4/+0
These files satisfy all of the following: - misc-include-cleaner indicates that these files do not need Endian.h. - They do not mention "endian" anywhere. - They do not include any *.inc or *.def, which could need llvm::support::endian.
2023-10-12Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata1-1/+1
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-10-10Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata3-5/+5
Note that llvm::support::endianness has been renamed to llvm::endianness while becoming an enum class as opposed to an enum. This patch replaces llvm::support::{big,little,native} with llvm::endianness::{big,little,native}.
2023-10-10[llvm] Use llvm::endianness::{big,little,native} (NFC)Kazu Hirata1-1/+1
Now that llvm::support::endianness has been renamed to llvm::endianness, we can use the shorter form. This patch replaces support::endianness::{big,little,native} with llvm::endianness::{big,little,native}.
2023-10-05[LLD][COFF] Add support for `--time-trace` (#68236)Alexandre Ganea6-9/+27
This adds support for generating Chrome-tracing .json profile traces in the LLD COFF driver. Also add the necessary time scopes, so that the profile trace shows in great detail which tasks are executed. As an example, this is what we see when linking a Unreal Engine executable: ![image](https://github.com/llvm/llvm-project/assets/37383324/b2e26eb4-9d37-4cf9-b002-48b604e7dcb7)
2023-07-19PDBFileBuilder: Switch to xxh3_64bitsFangrui Song2-2/+2
Following recent changes switching from xxh64 to xxh32 for better hashing performance (e.g., D154813). I am not familiar with this use case, but this change will ensure that the lld executable doesn't need xxHash64 after wasm-ld migrates.
2023-06-25[llvm] Add missing StringExtras.h includesElliot Goodrich5-0/+6
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 Hirata1-3/+3
{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 Vaishay1-9/+9
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
2023-02-27[llvm-debuginfo-analyzer] (09/09) - CodeView ReaderCarlos Alberto Enciso1-1/+3
llvm-debuginfo-analyzer is a command line tool that processes debug info contained in a binary file and produces a debug information format agnostic “Logical View”, which is a high-level semantic representation of the debug info, independent of the low-level format. The code has been divided into the following patches: 1) Interval tree 2) Driver and documentation 3) Logical elements 4) Locations and ranges 5) Select elements 6) Warning and internal options 7) Compare elements 8) ELF Reader 9) CodeView Reader Full details: https://discourse.llvm.org/t/llvm-dev-rfc-llvm-dva-debug-information-visual-analyzer/62570 This patch: This is a high level summary of the changes in this patch. CodeView Reader - Support for CodeView/PDB. LVCodeViewReader, LVTypeVisitor, LVSymbolVisitor, LVLogicalVisitor Reviewed By: psamolysov, probinson, djtodoro, zequanwu Differential Revision: https://reviews.llvm.org/D125784
2023-01-22Use llvm::popcount instead of llvm::countPopulation(NFC)Kazu Hirata1-1/+1
2023-01-05Move from llvm::makeArrayRef to ArrayRef deduction guides - llvm/ partserge-sans-paille5-11/+11
Use deduction guides instead of helper functions. The only non-automatic changes have been: 1. ArrayRef(some_uint8_pointer, 0) needs to be changed into ArrayRef(some_uint8_pointer, (size_t)0) to avoid an ambiguous call with ArrayRef((uint8_t*), (uint8_t*)) 2. CVSymbol sym(makeArrayRef(symStorage)); needed to be rewritten as CVSymbol sym{ArrayRef(symStorage)}; otherwise the compiler is confused and thinks we have a (bad) function prototype. There was a few similar situation across the codebase. 3. ADL doesn't seem to work the same for deduction-guides and functions, so at some point the llvm namespace must be explicitly stated. 4. The "reference mode" of makeArrayRef(ArrayRef<T> &) that acts as no-op is not supported (a constructor cannot achieve that). Per reviewers' comment, some useless makeArrayRef have been removed in the process. This is a follow-up to https://reviews.llvm.org/D140896 that introduced the deduction guides. Differential Revision: https://reviews.llvm.org/D140955
2022-12-05Remove unused #include "llvm/ADT/Optional.h"Fangrui Song1-1/+0
2022-12-05[DebugInfo] llvm::Optional => std::optionalFangrui Song5-13/+13
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-02[DebugInfo] Use std::nullopt instead of None (NFC)Kazu Hirata1-3/+3
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-25[Native] Use std::optional in NativeTypeEnum.cpp (NFC)Kazu Hirata1-1/+2
This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-21Don't use Optional::getPointer (NFC)Kazu Hirata1-2/+2
Since std::optional does not offer getPointer(), this patch replaces X.getPointer() with &*X to make the migration from llvm::Optional to std::optional easier. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Differential Revision: https://reviews.llvm.org/D138466
2022-11-08Reland "[llvm][NFC] Use c++17 style variable type traits"Nathan James1-1/+1
This reverts commit 632a389f96355cbe7ed8fa7b8d2ed6267c92457c. This relands commit 1834a310d060d55748ca38d4ae0482864c2047d8. Differential Revision: https://reviews.llvm.org/D137493
2022-11-08Revert "[llvm][NFC] Use c++17 style variable type traits"Nathan James1-1/+1
This reverts commit 1834a310d060d55748ca38d4ae0482864c2047d8.
2022-11-08[llvm][NFC] Use c++17 style variable type traitsNathan James1-1/+1
This was done as a test for D137302 and it makes sense to push these changes Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D137493
2022-08-08[llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song1-1/+1
With C++17 there is no Clang pedantic warning or MSVC C5051.
2022-08-08[LLD][COFF] Ignore DEBUG_S_XFGHASH_TYPE/VIRTUALTobias Hieta1-0/+7
These are new debug types that ships with the latest Windows SDK and would warn and finally fail lld-link. The symbols seems to be related to Microsoft's XFG which is their version of CFG. We can't handle any of this yet, so for now we can just ignore these types so that lld doesn't fail with a new version of Windows SDK. Fixes: #56285 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D129378
2022-08-07[llvm] Qualify auto (NFC)Kazu Hirata1-1/+1
Identified with readability-qualified-auto.
2022-07-10ManagedStatic: remove many straightforward uses in llvmNicolai Hähnle1-3/+4
(Reapply after revert in e9ce1a588030d8d4004f5d7e443afe46245e9a92 due to Fuchsia test failures. Removed changes in lib/ExecutionEngine/ other than error categories, to be checked in more detail and reapplied separately.) Bulk remove many of the more trivial uses of ManagedStatic in the llvm directory, either by defining a new getter function or, in many cases, moving the static variable directly into the only function that uses it. Differential Revision: https://reviews.llvm.org/D129120
2022-07-10Revert "ManagedStatic: remove many straightforward uses in llvm"Nicolai Hähnle1-4/+3
This reverts commit e6f1f062457c928c18a88c612f39d9e168f65a85. Reverting due to a failure on the fuchsia-x86_64-linux buildbot.
2022-07-10ManagedStatic: remove many straightforward uses in llvmNicolai Hähnle1-3/+4
Bulk remove many of the more trivial uses of ManagedStatic in the llvm directory, either by defining a new getter function or, in many cases, moving the static variable directly into the only function that uses it. Differential Revision: https://reviews.llvm.org/D129120
2022-06-29[CodeView] Call llvm::codeview::visitMemberRecordStream with the ↵Zequan Wu1-3/+6
deserialized CVType whose kind is FieldListRecord. llvm::codeview::visitMemberRecordStream expects to receive an array ref that's FieldListRecord's Data not a CVType's data which has 4 more bytes preceeding. The first 2 bytes indicate the size of the FieldListRecord, and following 2 bytes is always 0x1203. Inside llvm::codeview::visitMemberRecordStream, it iterates to the data to check if first two bytes matching some type record kinds. If the size coincidentally matches one type kind, it will start parsing from there and causing crash.
2022-06-25[llvm] Don't use Optional::hasValue (NFC)Kazu Hirata1-2/+2
This patch replaces Optional::hasValue with the implicit cast to bool in conditionals only.
2022-06-25Revert "Don't use Optional::hasValue (NFC)"Kazu Hirata1-2/+2
This reverts commit aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.
2022-06-25Don't use Optional::hasValue (NFC)Kazu Hirata1-2/+2
2022-06-20Don't use Optional::hasValue (NFC)Kazu Hirata1-1/+1
2022-06-20Don't use Optional::hasValue (NFC)Kazu Hirata1-2/+2
2022-06-20[llvm] Don't use Optional::hasValue (NFC)Kazu Hirata3-5/+5
2022-06-19Rename parallelForEachN to just parallelForNico Weber1-2/+2
Patch created by running: rg -l parallelForEachN | xargs sed -i '' -c 's/parallelForEachN/parallelFor/' No behavior change. Differential Revision: https://reviews.llvm.org/D128140
2022-06-05[PDB] Remove truncate* (NFC)Kazu Hirata1-52/+0
- truncateQuotedNameFront: The last use was removed on Jul 10, 2017 in commit a9d944fd6fd19ac377b5ebea9272676642b7ceaa. - truncateQuotedNameBack: The last use was removed on Mar 26, 2018 in commit 7b84b678a993c8a8236868f65d1d4c2b3e29fb3d. - truncateStringMiddle: The last use was removed on Mar 26, 2018 in commit 7b84b678a993c8a8236868f65d1d4c2b3e29fb3d. - truncateStringBack: The last use is in truncateQuotedNameBack being removed above. - truncateStringFront: The last use is in truncateQuotedNameFront being removed above.
2022-05-25Reland "[llvm-pdbutil] Add options to only dump symbol record at specified ↵Zequan Wu1-1/+1
offset and its parents or children with spcified depth." This reverts commit cfb4e782520ce59602a34732386ebbdf58136cfb.