36 Commits

Author SHA1 Message Date
Kazu Hirata
586ecdf205
[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
2023-12-11 21:01:36 -08:00
Kazu Hirata
3b1761b845 [llvm] Stop including map (NFC)
Identified with clangd.
2023-12-03 11:31:38 -08:00
avl-llvm
6b708cc96b
[DWARFLinkerParallel] fix build on 32-bit platform. (#73388)
This fixes usage of PointerIntPair on 32-bit platform -
https://github.com/llvm/llvm-project/issues/73267.
2023-11-26 02:21:52 +03:00
Simon Pilgrim
7b97d5048a Fix MSVC "not all control paths return a value" warning. NFC. 2023-11-23 12:09:11 +00:00
avl-llvm
b61ac4a88f
[DWARFLinkerParallel] Add support for -odr mode. (#68721)
This patch is extracted from D96035, it adds support for the type
deduplication mode. With this patch DWARFLinkerParallel handles --odr
option. It also processes clang modules.
2023-11-23 13:56:34 +03:00
Alexander Yermolovich
b00e2f2a5f
[LLVM][DWARF] Add support for monolithic types in .debug_names (#70515)
Enable Type Units with DWARF5 accelerator tables for monolithic DWARF.
Implementation relies on linker to tombstone offset in LocalTU list to
-1 when
it deduplciates type units using COMDAT.
2023-11-18 06:36:33 -08:00
Kazu Hirata
1564c225ef [llvm] Stop including llvm/ADT/SmallString.h (NFC)
Identified with clangd.
2023-11-11 12:32:13 -08:00
Kazu Hirata
d4360e428f [llvm] Stop including llvm/ADT/DenseMap.h (NFC)
Ientified with clangd.
2023-11-11 10:07:19 -08:00
Adrian Prantl
2d460f25f1 Attempt to fix test on Windows.
I'm assuming that because sys::path::append defaults to native path
this fails. Since dsymutil is a Darwin tool, we can just hardcode the
UNIX path separator.
2023-11-03 18:27:41 -07:00
Adrian Prantl
71a13675da
[dsymutil] Filter our swiftinterface files from the toolchain. (#71205)
Dsymutil already avoids copying textual Swift interface files from the
SDK, since any consumer would have to have a matching SDK installed
anyway. It should also do the same thing with interfaces found in the
toolchain itself, which includes the compiler built-in libraries such as
Swift (=the standard library), and _Concurrency.

rdar://117881604
2023-11-03 12:57:41 -07:00
Alexander Yermolovich
da27c25c19
[LLVM[NFC] Refactor to allow debug_names entries to conatain DIE offset (#69399)
This is pre-cursor patch to enabling type units with DWARF5 acceleration
tables.
With this change it allows for entries to contain offsets directly, this
way type
units do not need to be preserved until .debug_names is written out.
2023-10-25 12:39:28 -07:00
Kazu Hirata
a9d5056862 Use llvm::endianness (NFC)
Now that llvm::support::endianness has been renamed to
llvm::endianness, we can use the shorter form.  This patch replaces
support::endianness with llvm::endianness.
2023-10-10 21:54:15 -07:00
Kazu Hirata
b05dbc4d5f [llvm] Use llvm::endianness::{big,little,native} (NFC)
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-10 20:14:20 -07:00
Kazu Hirata
af8eff41df [DWARFLinkerParallel] Use llvm::endianness::native (NFC) 2023-10-05 21:21:36 -07:00
Nico Weber
f320065aeb Revert "[LLVM][DWARF] Add support for monolithic types in .debug_names (#68131)"
This reverts commit 9bbd2bf654634cd95dd0be7948ec8402c3c76e1e.

Accidental commit: https://github.com/llvm/llvm-project/pull/68131#issuecomment-1749430207
2023-10-05 14:47:04 -04:00
Alexander Yermolovich
9bbd2bf654
[LLVM][DWARF] Add support for monolithic types in .debug_names (#68131)
Added support for Type Units in monolithic DWARF in .debug_names.
2023-10-05 11:14:18 -07:00
Kazu Hirata
6b31b02600
[Support] Deprecate system_endianness (#68279)
system_endianness() just returns llvm::endianness::native, a
compile-time constant equivalent to std::native in C++20.  This patch
deprecates system_endianness() while replacing all invocations of
system_endianness() with llvm::endianness::native.

While we are at it, this patch replaces
llvm::support::endianness::{big,little} with
llvm::endianness::{big,little} in those statements that happen to call
system_endianness().  It does not go out of its way to replace other
occurrences of llvm::support::endianness::{big,little}.
2023-10-05 09:17:09 -07:00
Alexey Lapshin
08136d822c [DWARFLinkerParallel] Add support of accelerator tables to DWARFLinkerParallel.
This patch is extracted from D96035, it adds support for the accelerator
tables to the DWARFLinkerParallel functionality.

Differential Revision: https://reviews.llvm.org/D154793
2023-09-27 13:37:35 +02:00
Jonas Devlieghere
697b34fd96
[dsymutil] Remove paper trail warnings (#67041)
Remove the paper trail warning from dsymutil and the DWARF linker. The
original purpose of this functionality was to leave a paper trail in the
output artifact about missing object files. The current implementation
however has diverged and is the source of a pretty serious bug:

- In the debug map parser, missing object files are not the only
  warnings we emit. When paper trail warnings are enabled, all of them end
  up in the dSYM which wasn't the goal.
  
- When warnings are associated with a object file in the debug map, it
  is skipped by the DWARF linker. This only makes sense if the object file
  is missing and is obviously incorrect for any other type of warning
  (such as a missing symbol).

The combination of the two means that we can generate broken DWARF when
the feature is enabled. AFAIK it was only used by Apple and nobody I
spoke to has relied on it, so rather than fixing the broken behavior I
propose we remove it.
2023-09-22 11:27:33 -07:00
Alexey Lapshin
097971b318 [DWARFLinkerParallel][PowerPC] Cure tests failing on powerpc machine.
location-expression.test and tls-variable.test failed because wrong
endianness was used on powerpc machine. To fix the issue this patch
uses endianness from debug map as endianness for the whole target file.
Previosly, architecture endianness won over what is specified
in debug map.

Differential Revision: https://reviews.llvm.org/D159349
2023-09-02 13:35:53 +02:00
Kazu Hirata
7b1bfb2405 [DWARFLinkerParallel] Remove a redundant return (NFC) 2023-08-27 12:13:24 -07:00
Alexey Lapshin
5f2a7fa67e [Reland][Reland][DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel.
This patch is extracted from D96035, it adds support for the existing
DWARFLinker functionality. What is not supported yet:

1. Types deduplication(--odr mode).
2. Modules deduplication.
3. Generation of index tables.

Reland2: temporarily disabled call to "--linker llvm" for tls-variable.test
and location-expression.test as it does not work properly on bigendian
architecture.

Differential Revision: https://reviews.llvm.org/D153268
2023-08-21 11:09:18 +02:00
Nikita Popov
fab91e9509 Revert "[Reland][DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel."
This reverts commit 0229dd0626b2538c78ebbd2b1bd44c31fbf1cdec.

This introduces two test failures on s390x.

tools/dsymutil/X86/location-expression.test:

    warning: cann't load line table.
    note: while processing CU1
    /builddir/build/BUILD/llvm-18.0.0.src/test/tools/dsymutil/X86/location-expression.test:20:10: error: CHECK: expected string not found in input
    # CHECK: DW_AT_name{{.*}}"CU1"
             ^
    <stdin>:34:32: note: scanning from here
    0x0000000b: DW_TAG_compile_unit [1] *
                                   ^
    <stdin>:37:2: note: possible intended match here
     DW_AT_name [DW_FORM_strp] ( .debug_str[0x09000000] = )
     ^

tools/dsymutil/X86/tls-variable.test:

    warning: cann't load line table.
    note: while processing CU1
    /builddir/build/BUILD/llvm-18.0.0.src/test/tools/dsymutil/X86/tls-variable.test:19:10: error: CHECK: expected string not found in input
    # CHECK: DW_AT_name{{.*}}"CU1"
             ^
    <stdin>:26:32: note: scanning from here
    0x0000000b: DW_TAG_compile_unit
                                   ^
    <stdin>:29:2: note: possible intended match here
     DW_AT_name ()
     ^
2023-08-21 10:39:25 +02:00
Alexey Lapshin
0229dd0626 [Reland][DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel.
This patch is extracted from D96035, it adds support for the existing
DWARFLinker functionality. What is not supported yet:

1. Types deduplication(--odr mode).
2. Modules deduplication.
3. Generation of index tables.

Differential Revision: https://reviews.llvm.org/D153268
2023-08-19 12:19:39 +02:00
Alexey Lapshin
32484c1724 Revert "[DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel."
This reverts commit 1506e4c77624aa3d208658fd356b9caccc1a713f.
2023-08-17 12:45:12 +02:00
Alexey Lapshin
1506e4c776 [DWARFLinkerParallel] Add limited functionality to DWARFLinkerParallel.
This patch is extracted from D96035, it adds support for the existing
DWARFLinker functionality. What is not supported yet:

1. Types deduplication(--odr mode).
2. Modules deduplication.
3. Generation of index tables.

Differential Revision: https://reviews.llvm.org/D153268
2023-08-17 09:47:34 +02:00
Elliot Goodrich
b0abd4893f [llvm] Add missing StringExtras.h includes
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-06-25 15:42:22 +01:00
Kazu Hirata
fdd5f695fc [llvm] Use llvm::is_contained (NFC) 2023-06-22 23:45:50 -07:00
Alexey Lapshin
0b8fbd49b5 make sanitizer happy for 36f351098cd50809658493d9b2e22a795874bab0. 2023-06-04 20:49:14 +02:00
Alexey Lapshin
36f351098c [DWARFLinkerParallel][Reland] Add interface files, create a skeleton implementation.
This patch creates skeleton implementation for the DWARFLinkerParallel.
It also integrates DWARFLinkerParallel into dsymutil and llvm-dwarfutil,
so that empty DWARFLinker::link() can be called. To do this new command
line option is added "--linker apple/llvm". Additionally it changes
existing DWARFLinker interfaces/implementations to be compatible:
use Error for error reporting for the DWARFStreamer, make DWARFFile to
owner of referenced resources, other small refactorings.

Differential Revision: https://reviews.llvm.org/D147952
2023-06-04 20:18:06 +02:00
Alexey Lapshin
66e5678fec Revert "[DWARFLinkerParallel] Add interface files, create a skeleton implementation."
This reverts commit e0ba9b2ace7ffc20bf8fe2eb533d638f27619b10.
2023-06-04 13:28:54 +02:00
Alexey Lapshin
e0ba9b2ace [DWARFLinkerParallel] Add interface files, create a skeleton implementation.
This patch creates skeleton implementation for the DWARFLinkerParallel.
It also integrates DWARFLinkerParallel into dsymutil and llvm-dwarfutil,
so that empty DWARFLinker::link() can be called. To do this new command
line option is added "--linker apple/llvm". Additionally it changes
existing DWARFLinker interfaces/implementations to be compatible:
use Error for error reporting for the DWARFStreamer, make DWARFFile to
owner of referenced resources, other small refactorings.

Differential Revision: https://reviews.llvm.org/D147952
2023-06-04 13:03:57 +02:00
NAKAMURA Takumi
7d5d987e93 [CMake] Reorder and reformat deps 2023-04-17 00:32:16 +09:00
Alexey Lapshin
33c442118f [Reland][ADT][ConcurrentHashTable] adapt ConcurrentHashTable and its users to LLVM_ENABLE_THREADS=0 mode.
This patch hides thread specific handling under LLVM_ENABLE_THREADS guard.
It also removes usages of thread_local variables, since it has a weak
support on some platforms. Instead, the patch uses single mutex for locking
allocator. That may be replaced with more effective allocator later.
f.e. D142318

Differential Revision: https://reviews.llvm.org/D147649
2023-04-12 11:28:44 +02:00
Alexey Lapshin
868654e549 [DWARFLinkerParallel] Add StringPool class.
This patch is extracted from D96035. It adds StringPool class.
StringPool allows to store strings in parallel. It also allows
to have string data associated with the concrete string.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D140841
2023-03-31 12:11:43 +02:00
Alexey Lapshin
a920ae3b8d [DWARF][dsymutil][llvm-dwarfutil] Create a placeholder library DWARFLinkerParallel.
This patch is extracted from D96035. It creates an empty library DWARFLinkerParallel.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D140787
2023-01-20 16:36:09 +01:00