The code can be used in multi-threads and the allocator is not thread safe.
fixes PR/54378
Differential D121638
[lld-macho] Avoid using bump-alloc in TrieBuider oontvoo on Mar 14 2022, 2:01 PM. Authored by
Details
The code can be used in multi-threads and the allocator is not thread safe. fixes PR/54378
Diff Detail
Event Timeline
Comment Actions breaking HIP and AMDGPU buildbots please fix asap or revert Comment Actions This change breaks the lld build with: ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ac6467df252ff017b0d6ba076db369db/external/llvm-project/lld/BUILD.bazel:191:11: Compiling lld/MachO/ExportTrie.cpp failed: (Exit 1): clang failed: error executing command /usr/local/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -MD -MF ... (remaining 81 argument(s) skipped) external/llvm-project/lld/MachO/ExportTrie.cpp:148:11: error: definition of implicitly declared destructor TrieNode::~TrieNode() { ^ external/llvm-project/lld/MachO/ExportTrie.cpp:149:25: error: use of undeclared identifier 'nodes'; did you mean 'node'? for (TrieNode *node : nodes) ^~~~~ node external/llvm-project/lld/MachO/ExportTrie.cpp:149:18: note: 'node' declared here for (TrieNode *node : nodes) ^ external/llvm-project/lld/MachO/ExportTrie.cpp:149:23: error: invalid range expression of type 'lld::macho::TrieNode *'; no viable 'begin' function available for (TrieNode *node : nodes) ^ ~~~~~ 3 errors generated. Reverting shortly. Comment Actions Or, if you prefer the cmake version: [159/255] Building CXX object tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o FAILED: tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/local/google/home/saugustine/llvm/build/tools/lld/MachO -I/usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO -I/usr/local/google/home/saugustine/llvm/llvm-project/lld/include -I/usr/local/google/home/saugustine/llvm/build/tools/lld/include -I/usr/local/google/home/saugustine/llvm/build/include -I/usr/local/google/home/saugustine/llvm/llvm-project/llvm/include -I/usr/local/google/home/saugustine/llvm/llvm-project/llvm/../libunwind/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -g -fno-exceptions -fno-rtti -std=c++17 -MD -MT tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o -MF tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o.d -o tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.o -c /usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp /usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp:148:11: error: definition of implicitly declared destructor TrieNode::~TrieNode() { ^ /usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp:149:25: error: use of undeclared identifier 'nodes'; did you mean 'node'? for (TrieNode *node : nodes) ^~~~~ node /usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp:149:18: note: 'node' declared here for (TrieNode *node : nodes) ^ /usr/local/google/home/saugustine/llvm/llvm-project/lld/MachO/ExportTrie.cpp:149:23: error: invalid range expression of type 'lld::macho::TrieNode *'; no viable 'begin' function available for (TrieNode *node : nodes) ^ ~~~~~ 3 errors generated. Comment Actions This change has broken windows builds: FAILED: tools/lld/MachO/CMakeFiles/lldMachO.dir/ExportTrie.cpp.obj |
do we need this?