Skip to content

Commit 48c1578

Browse files
authored
Merge branch 'llvm:main' into fix_objcopy_wrong_path_diagnostic
2 parents 37289e6 + 7abca75 commit 48c1578

File tree

743 files changed

+27670
-11819
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

743 files changed

+27670
-11819
lines changed

bolt/lib/Core/BinaryContext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,11 @@ void BinaryContext::preprocessDebugInfo() {
17591759
dwarf::toString(CU->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
17601760
if (std::optional<uint64_t> DWOID = CU->getDWOId()) {
17611761
auto Iter = DWOCUs.find(*DWOID);
1762-
assert(Iter != DWOCUs.end() && "DWO CU was not found.");
1762+
if (Iter == DWOCUs.end()) {
1763+
this->errs() << "BOLT-ERROR: DWO CU was not found for " << Name
1764+
<< '\n';
1765+
exit(1);
1766+
}
17631767
Name = dwarf::toString(
17641768
Iter->second->getUnitDIE().find(dwarf::DW_AT_name), nullptr);
17651769
}

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,18 +494,31 @@ genReferencesBlock(const std::vector<Reference> &References,
494494
static std::unique_ptr<TagNode>
495495
writeFileDefinition(const Location &L,
496496
std::optional<StringRef> RepositoryUrl = std::nullopt) {
497-
if (!L.IsFileInRootDir || !RepositoryUrl)
497+
if (!L.IsFileInRootDir && !RepositoryUrl)
498498
return std::make_unique<TagNode>(
499499
HTMLTag::TAG_P, "Defined at line " + std::to_string(L.LineNumber) +
500500
" of file " + L.Filename);
501501
SmallString<128> FileURL(*RepositoryUrl);
502-
llvm::sys::path::append(FileURL, llvm::sys::path::Style::posix, L.Filename);
502+
llvm::sys::path::append(
503+
FileURL, llvm::sys::path::Style::posix,
504+
// If we're on Windows, the file name will be in the wrong format, and
505+
// append won't convert the full path being appended to the correct
506+
// format, so we need to do that here.
507+
llvm::sys::path::convert_to_slash(
508+
L.Filename,
509+
// The style here is the current style of the path, not the one we're
510+
// targeting. If the string is already in the posix style, it will do
511+
// nothing.
512+
llvm::sys::path::Style::windows));
503513
auto Node = std::make_unique<TagNode>(HTMLTag::TAG_P);
504514
Node->Children.emplace_back(std::make_unique<TextNode>("Defined at line "));
505515
auto LocNumberNode =
506516
std::make_unique<TagNode>(HTMLTag::TAG_A, std::to_string(L.LineNumber));
507517
// The links to a specific line in the source code use the github /
508518
// googlesource notation so it won't work for all hosting pages.
519+
// FIXME: we probably should have a configuration setting for line number
520+
// rendering in the HTML. For example, GitHub uses #L22, while googlesource
521+
// uses #22 for line numbers.
509522
LocNumberNode->Attributes.emplace_back(
510523
"href", (FileURL + "#" + std::to_string(L.LineNumber)).str());
511524
Node->Children.emplace_back(std::move(LocNumberNode));

clang-tools-extra/test/clang-doc/Inputs/basic-project/src/Circle.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ double Circle::area() const {
88

99
double Circle::perimeter() const {
1010
return 3.141 * radius_;
11-
}
11+
}
12+

clang-tools-extra/test/clang-doc/basic-project.test

Lines changed: 176 additions & 123 deletions
Large diffs are not rendered by default.

clang-tools-extra/unittests/clang-doc/HTMLGeneratorTest.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ TEST(HTMLGeneratorTest, emitFunctionHTML) {
319319
<a href="path/to/int.html">int</a>
320320
P)
321321
</p>
322-
<p>Defined at line 10 of file dir/test.cpp</p>
322+
<p>
323+
Defined at line
324+
<a href="https://www.repository.com/dir/test.cpp#10">10</a>
325+
of file
326+
<a href="https://www.repository.com/dir/test.cpp">test.cpp</a>
327+
</p>
323328
</div>
324329
<div id="sidebar-right" class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right"></div>
325330
</main>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This file sets up a CMakeCache for the second stage of a Fuchsia toolchain build.
2+
3+
include(${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake)
4+
5+
if(NOT APPLE)
6+
set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
7+
endif()
8+
9+
set(CLANG_BOOTSTRAP_TARGETS
10+
check-all
11+
check-clang
12+
check-lld
13+
check-llvm
14+
clang
15+
clang-test-depends
16+
toolchain-distribution
17+
install-toolchain-distribution
18+
install-toolchain-distribution-stripped
19+
install-toolchain-distribution-toolchain
20+
lld-test-depends
21+
llvm-config
22+
llvm-test-depends
23+
test-depends
24+
test-suite CACHE STRING "")
25+
26+
get_cmake_property(variableNames VARIABLES)
27+
foreach(variableName ${variableNames})
28+
if(variableName MATCHES "^STAGE2_")
29+
string(REPLACE "STAGE2_" "" new_name ${variableName})
30+
list(APPEND EXTRA_ARGS "-D${new_name}=${${variableName}}")
31+
endif()
32+
endforeach()
33+
34+
set(CLANG_PGO_TRAINING_DEPS
35+
builtins
36+
runtimes
37+
CACHE STRING "")
38+
39+
# Setup the bootstrap build.
40+
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
41+
set(CLANG_BOOTSTRAP_CMAKE_ARGS
42+
${EXTRA_ARGS}
43+
-C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake
44+
CACHE STRING "")

clang/cmake/caches/Fuchsia.cmake

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ else()
126126
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
127127
set(LIBCXX_HARDENING_MODE "none" CACHE STRING "")
128128
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
129+
set(COMPILER_RT_BUILD_LIBFUZZER OFF CACHE BOOL "")
130+
set(COMPILER_RT_BUILD_PROFILE ON CACHE BOOL "")
131+
set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "")
132+
set(COMPILER_RT_BUILD_XRAY OFF CACHE BOOL "")
133+
set(COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
134+
set(COMPILER_RT_DEFAULT_TARGET_ONLY ON CACHE BOOL "")
135+
set(SANITIZER_CXX_ABI "libc++" CACHE STRING "")
136+
set(SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
137+
set(SANITIZER_TEST_CXX "libc++" CACHE STRING "")
138+
set(SANITIZER_TEST_CXX_INTREE ON CACHE BOOL "")
129139
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
130140
set(RUNTIMES_CMAKE_ARGS "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13;-DCMAKE_OSX_ARCHITECTURES=arm64|x86_64" CACHE STRING "")
131141
endif()
@@ -164,34 +174,29 @@ endif()
164174

165175
set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
166176
set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
177+
set(BOOTSTRAP_LLVM_BUILD_INSTRUMENTED ON CACHE BOOL "")
167178

168179
set(_FUCHSIA_BOOTSTRAP_TARGETS
169-
check-all
170-
check-clang
171-
check-lld
172-
check-llvm
173-
check-polly
174-
llvm-config
175-
clang-test-depends
176-
lld-test-depends
177-
llvm-test-depends
178-
test-suite
179-
test-depends
180-
toolchain-distribution
181-
install-toolchain-distribution
182-
install-toolchain-distribution-stripped
183-
install-toolchain-distribution-toolchain
184-
clang)
180+
generate-profdata
181+
stage2
182+
stage2-toolchain-distribution
183+
stage2-install-toolchain-distribution
184+
stage2-install-toolchain-distribution-stripped
185+
stage2-install-toolchain-distribution-toolchain
186+
stage2-check-all
187+
stage2-check-lld
188+
stage2-check-llvm
189+
stage2-check-clang
190+
stage2-test-suite)
185191

186192
if(FUCHSIA_ENABLE_LLDB)
187193
list(APPEND _FUCHSIA_ENABLE_PROJECTS lldb)
188194
list(APPEND _FUCHSIA_BOOTSTRAP_TARGETS
189-
check-lldb
190-
lldb-test-depends
191-
debugger-distribution
192-
install-debugger-distribution
193-
install-debugger-distribution-stripped
194-
install-debugger-distribution-toolchain)
195+
stage2-check-lldb
196+
stage2-debugger-distribution
197+
stage2-install-debugger-distribution
198+
stage2-install-debugger-distribution-stripped
199+
stage2-install-debugger-distribution-toolchain)
195200
endif()
196201

197202
set(LLVM_ENABLE_PROJECTS ${_FUCHSIA_ENABLE_PROJECTS} CACHE STRING "")
@@ -200,6 +205,7 @@ set(CLANG_BOOTSTRAP_TARGETS ${_FUCHSIA_BOOTSTRAP_TARGETS} CACHE STRING "")
200205
get_cmake_property(variableNames VARIABLES)
201206
foreach(variableName ${variableNames})
202207
if(variableName MATCHES "^STAGE2_")
208+
list(APPEND EXTRA_ARGS "-D${variableName}=${${variableName}}")
203209
string(REPLACE "STAGE2_" "" new_name ${variableName})
204210
string(REPLACE ";" "|" value "${${variableName}}")
205211
list(APPEND EXTRA_ARGS "-D${new_name}=${value}")
@@ -209,6 +215,9 @@ endforeach()
209215
# TODO: This is a temporary workaround until we figure out the right solution.
210216
set(BOOTSTRAP_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "")
211217

218+
set(LLVM_BUILTIN_TARGETS "default" CACHE STRING "")
219+
set(LLVM_RUNTIME_TARGETS "default" CACHE STRING "")
220+
212221
# Setup the bootstrap build.
213222
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
214223
set(CLANG_BOOTSTRAP_EXTRA_DEPS
@@ -217,5 +226,5 @@ set(CLANG_BOOTSTRAP_EXTRA_DEPS
217226
CACHE STRING "")
218227
set(CLANG_BOOTSTRAP_CMAKE_ARGS
219228
${EXTRA_ARGS}
220-
-C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake
229+
-C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2-instrumented.cmake
221230
CACHE STRING "")

clang/docs/BoundsSafety.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,8 @@ that has the define.
959959
#if defined(__has_feature) && __has_feature(bounds_safety)
960960
#define __counted_by(T) __attribute__((__counted_by__(T)))
961961
// ... other bounds annotations
962-
#else #define __counted_by(T) // defined as nothing
962+
#else
963+
#define __counted_by(T) // defined as nothing
963964
// ... other bounds annotations
964965
#endif
965966
@@ -987,7 +988,7 @@ and it does not guarantee other types of memory safety properties. Consequently,
987988
it may not prevent some of the secondary bounds safety violations caused by
988989
other types of safety violations such as type confusion. For instance,
989990
``-fbounds-safety`` does not perform type-safety checks on conversions between
990-
`__single`` pointers of different pointee types (e.g., ``char *__single`` →
991+
``__single`` pointers of different pointee types (e.g., ``char *__single`` →
991992
``void *__single`` → ``int *__single``) beyond what the foundation languages
992993
(C/C++) already offer.
993994

@@ -1003,4 +1004,4 @@ Try it out
10031004

10041005
Your feedback on the programming model is valuable. You may want to follow the
10051006
instruction in :doc:`BoundsSafetyAdoptionGuide` to play with ``-fbounds-safety``
1006-
and please send your feedback to `Yeoul Na <mailto:[email protected]>`_.
1007+
and please send your feedback to `Yeoul Na <mailto:[email protected]>`_.

clang/docs/OpenMPSupport.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ implementation.
364364
+=============================================================+===========================+===========================+==========================================================================+
365365
| free-agent threads | :none:`unclaimed` | :none:`unclaimed` | |
366366
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
367+
| threadset clause | :`worked on` | :none:`unclaimed` | |
368+
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
367369
| Recording of task graphs | :none:`unclaimed` | :none:`unclaimed` | |
368370
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
369371
| Parallel inductions | :none:`unclaimed` | :none:`unclaimed` | |
@@ -410,7 +412,7 @@ implementation.
410412
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
411413
| Extensions to interop construct | :none:`unclaimed` | :none:`unclaimed` | |
412414
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
413-
| no_openmp_constructs | :none:`unclaimed` | :none:`unclaimed` | |
415+
| no_openmp_constructs | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125933 |
414416
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
415417
| safe_sync and progress with identifier and API | :none:`unclaimed` | :none:`unclaimed` | |
416418
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ Improvements to Clang's diagnostics
127127
- The ``-Wunique-object-duplication`` warning has been added to warn about objects
128128
which are supposed to only exist once per program, but may get duplicated when
129129
built into a shared library.
130+
- Fixed a bug where Clang's Analysis did not correctly model the destructor behavior of ``union`` members (#GH119415).
130131

131132
Improvements to Clang's time-trace
132133
----------------------------------
@@ -278,6 +279,7 @@ Python Binding Changes
278279

279280
OpenMP Support
280281
--------------
282+
- Added support 'no_openmp_constructs' assumption clause.
281283

282284
Improvements
283285
^^^^^^^^^^^^

0 commit comments

Comments
 (0)