Skip to content

Commit ed5e4ef

Browse files
authored
Merge pull request llvm#548 from AMD-Lightning-Internal/amd/merge/upstream_merge_20250207081349
merge main into amd-staging
2 parents a26549e + 729b4fe commit ed5e4ef

File tree

521 files changed

+22175
-9508
lines changed

Some content is hidden

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

521 files changed

+22175
-9508
lines changed

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>

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ implementation.
412412
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
413413
| Extensions to interop construct | :none:`unclaimed` | :none:`unclaimed` | |
414414
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
415-
| no_openmp_constructs | :none:`unclaimed` | :none:`unclaimed` | |
415+
| no_openmp_constructs | :good:`done` | :none:`unclaimed` | https://github.com/llvm/llvm-project/pull/125933 |
416416
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
417417
| safe_sync and progress with identifier and API | :none:`unclaimed` | :none:`unclaimed` | |
418418
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

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
^^^^^^^^^^^^

clang/docs/SourceBasedCodeCoverage.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ directory structure will be created. Additionally, the following special
9494
not specified (i.e the pattern is "%m"), it's assumed that ``N = 1``. The
9595
merge pool specifier can only occur once per filename pattern.
9696

97+
* "%b" expands out to the binary ID (build ID). It can be used with "%Nm" to
98+
avoid binary signature collisions. To use it, the program should be compiled
99+
with the build ID linker option (``--build-id`` for GNU ld or LLD,
100+
``/build-id`` for lld-link on Windows). Linux, Windows and AIX are supported.
101+
97102
* "%c" expands out to nothing, but enables a mode in which profile counter
98103
updates are continuously synced to a file. This means that if the
99104
instrumented program crashes, or is killed by a signal, perfect coverage

clang/docs/UsersManual.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,7 +2965,8 @@ instrumentation:
29652965
environment variable to specify an alternate file. If non-default file name
29662966
is specified by both the environment variable and the command line option,
29672967
the environment variable takes precedence. The file name pattern specified
2968-
can include different modifiers: ``%p``, ``%h``, ``%m``, ``%t``, and ``%c``.
2968+
can include different modifiers: ``%p``, ``%h``, ``%m``, ``%b``, ``%t``, and
2969+
``%c``.
29692970

29702971
Any instance of ``%p`` in that file name will be replaced by the process
29712972
ID, so that you can easily distinguish the profile output from multiple
@@ -2987,11 +2988,11 @@ instrumentation:
29872988
``%p`` is that the storage requirement for raw profile data files is greatly
29882989
increased. To avoid issues like this, the ``%m`` specifier can used in the profile
29892990
name. When this specifier is used, the profiler runtime will substitute ``%m``
2990-
with a unique integer identifier associated with the instrumented binary. Additionally,
2991+
with an integer identifier associated with the instrumented binary. Additionally,
29912992
multiple raw profiles dumped from different processes that share a file system (can be
29922993
on different hosts) will be automatically merged by the profiler runtime during the
29932994
dumping. If the program links in multiple instrumented shared libraries, each library
2994-
will dump the profile data into its own profile data file (with its unique integer
2995+
will dump the profile data into its own profile data file (with its integer
29952996
id embedded in the profile name). Note that the merging enabled by ``%m`` is for raw
29962997
profile data generated by profiler runtime. The resulting merged "raw" profile data
29972998
file still needs to be converted to a different format expected by the compiler (
@@ -3001,6 +3002,12 @@ instrumentation:
30013002
30023003
$ LLVM_PROFILE_FILE="code-%m.profraw" ./code
30033004
3005+
Although rare, binary signatures used by the ``%m`` specifier can have
3006+
collisions. In this case, the ``%b`` specifier, which expands to the binary
3007+
ID (build ID in ELF and COFF), can be added. To use it, the program should be
3008+
compiled with the build ID linker option (``--build-id`` for GNU ld or LLD,
3009+
``/build-id`` for lld-link on Windows). Linux, Windows and AIX are supported.
3010+
30043011
See `this <SourceBasedCodeCoverage.html#running-the-instrumented-program>`_ section
30053012
about the ``%t``, and ``%c`` modifiers.
30063013

clang/include/clang/AST/DeclTemplate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,6 +1960,8 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
19601960

19611961
bool hasStrictPackMatch() const { return StrictPackMatch; }
19621962

1963+
void setStrictPackMatch(bool Val) { StrictPackMatch = Val; }
1964+
19631965
/// Get the point of instantiation (if any), or null if none.
19641966
SourceLocation getPointOfInstantiation() const {
19651967
return PointOfInstantiation;

clang/include/clang/AST/OpenMPClause.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,6 +2423,28 @@ class OMPNoOpenMPRoutinesClause final
24232423
OMPNoOpenMPRoutinesClause() : OMPNoChildClause() {}
24242424
};
24252425

2426+
/// This represents the 'no_openmp_constructs' clause in the
2427+
//// '#pragma omp assume' directive.
2428+
///
2429+
/// \code
2430+
/// #pragma omp assume no_openmp_constructs
2431+
/// \endcode
2432+
/// In this example directive '#pragma omp assume' has a 'no_openmp_constructs'
2433+
/// clause.
2434+
class OMPNoOpenMPConstructsClause final
2435+
: public OMPNoChildClause<llvm::omp::OMPC_no_openmp_constructs> {
2436+
public:
2437+
/// Build 'no_openmp_constructs' clause.
2438+
///
2439+
/// \param StartLoc Starting location of the clause.
2440+
/// \param EndLoc Ending location of the clause.
2441+
OMPNoOpenMPConstructsClause(SourceLocation StartLoc, SourceLocation EndLoc)
2442+
: OMPNoChildClause(StartLoc, EndLoc) {}
2443+
2444+
/// Build an empty clause.
2445+
OMPNoOpenMPConstructsClause() : OMPNoChildClause() {}
2446+
};
2447+
24262448
/// This represents the 'no_parallelism' clause in the '#pragma omp assume'
24272449
/// directive.
24282450
///

0 commit comments

Comments
 (0)