Skip to content

Commit 2a1010f

Browse files
authored
Merge branch 'main' into fix/fixit-unknown-attributes
2 parents 7fd17bb + 8b11de7 commit 2a1010f

File tree

668 files changed

+30967
-9520
lines changed

Some content is hidden

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

668 files changed

+30967
-9520
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ FilterMemProfile("filter-mem-profile",
6161
cl::init(true),
6262
cl::cat(AggregatorCategory));
6363

64+
static cl::opt<bool> ParseMemProfile(
65+
"parse-mem-profile",
66+
cl::desc("enable memory profile parsing if it's present in the input data, "
67+
"on by default unless `--itrace` is set."),
68+
cl::init(true), cl::cat(AggregatorCategory));
69+
6470
static cl::opt<unsigned long long>
6571
FilterPID("pid",
6672
cl::desc("only use samples from process with specified PID"),
@@ -181,6 +187,10 @@ void DataAggregator::start() {
181187
"script -F pid,event,ip",
182188
/*Wait = */false);
183189
} else if (!opts::ITraceAggregation.empty()) {
190+
// Disable parsing memory profile from trace data, unless requested by user.
191+
if (!opts::ParseMemProfile.getNumOccurrences())
192+
opts::ParseMemProfile = false;
193+
184194
std::string ItracePerfScriptArgs = llvm::formatv(
185195
"script -F pid,brstack --itrace={0}", opts::ITraceAggregation);
186196
launchPerfProcess("branch events with itrace", MainEventsPPI,
@@ -191,12 +201,9 @@ void DataAggregator::start() {
191201
/*Wait = */ false);
192202
}
193203

194-
// Note: we launch script for mem events regardless of the option, as the
195-
// command fails fairly fast if mem events were not collected.
196-
launchPerfProcess("mem events",
197-
MemEventsPPI,
198-
"script -F pid,event,addr,ip",
199-
/*Wait = */false);
204+
if (opts::ParseMemProfile)
205+
launchPerfProcess("mem events", MemEventsPPI, "script -F pid,event,addr,ip",
206+
/*Wait = */ false);
200207

201208
launchPerfProcess("process events", MMapEventsPPI,
202209
"script --show-mmap-events --no-itrace",
@@ -217,7 +224,8 @@ void DataAggregator::abort() {
217224
sys::Wait(TaskEventsPPI.PI, 1, &Error);
218225
sys::Wait(MMapEventsPPI.PI, 1, &Error);
219226
sys::Wait(MainEventsPPI.PI, 1, &Error);
220-
sys::Wait(MemEventsPPI.PI, 1, &Error);
227+
if (opts::ParseMemProfile)
228+
sys::Wait(MemEventsPPI.PI, 1, &Error);
221229

222230
deleteTempFiles();
223231

@@ -506,7 +514,8 @@ Error DataAggregator::preprocessProfile(BinaryContext &BC) {
506514
errs() << "PERF2BOLT: failed to parse samples\n";
507515

508516
// Special handling for memory events
509-
if (!prepareToParse("mem events", MemEventsPPI, MemEventsErrorCallback))
517+
if (opts::ParseMemProfile &&
518+
!prepareToParse("mem events", MemEventsPPI, MemEventsErrorCallback))
510519
if (const std::error_code EC = parseMemEvents())
511520
errs() << "PERF2BOLT: failed to parse memory events: " << EC.message()
512521
<< '\n';

clang-tools-extra/clang-tidy/modernize/UseIntegerSignComparisonCheck.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,21 @@ intCastExpression(bool IsSigned,
3939
// std::cmp_{} functions trigger a compile-time error if either LHS or RHS
4040
// is a non-integer type, char, enum or bool
4141
// (unsigned char/ signed char are Ok and can be used).
42-
const auto HasIntegerType = hasType(hasCanonicalType(qualType(
42+
auto IntTypeExpr = expr(hasType(hasCanonicalType(qualType(
4343
isInteger(), IsSigned ? isSignedInteger() : isUnsignedInteger(),
44-
unless(isActualChar()), unless(booleanType()), unless(enumType()))));
45-
46-
const auto IntTypeExpr = expr(HasIntegerType);
44+
unless(isActualChar()), unless(booleanType()), unless(enumType())))));
4745

4846
const auto ImplicitCastExpr =
4947
CastBindName.empty() ? implicitCastExpr(hasSourceExpression(IntTypeExpr))
5048
: implicitCastExpr(hasSourceExpression(IntTypeExpr))
5149
.bind(CastBindName);
5250

53-
const auto ExplicitCastExpr =
54-
anyOf(explicitCastExpr(has(ImplicitCastExpr)),
55-
ignoringImpCasts(explicitCastExpr(has(ImplicitCastExpr))));
56-
57-
// Match function calls or variable references not directly wrapped by an
58-
// implicit cast
59-
const auto CallIntExpr = CastBindName.empty()
60-
? callExpr(HasIntegerType)
61-
: callExpr(HasIntegerType).bind(CastBindName);
51+
const auto CStyleCastExpr = cStyleCastExpr(has(ImplicitCastExpr));
52+
const auto StaticCastExpr = cxxStaticCastExpr(has(ImplicitCastExpr));
53+
const auto FunctionalCastExpr = cxxFunctionalCastExpr(has(ImplicitCastExpr));
6254

63-
return expr(anyOf(ImplicitCastExpr, ExplicitCastExpr, CallIntExpr));
55+
return expr(anyOf(ImplicitCastExpr, CStyleCastExpr, StaticCastExpr,
56+
FunctionalCastExpr));
6457
}
6558

6659
static StringRef parseOpCode(BinaryOperator::Opcode Code) {

clang-tools-extra/clangd/unittests/HoverTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ class Foo final {})cpp";
974974
HI.Name = "abc";
975975
HI.Kind = index::SymbolKind::Variable;
976976
HI.NamespaceScope = "";
977-
HI.Definition = "int abc = <recovery - expr>()";
977+
HI.Definition = "int abc";
978978
HI.Type = "int";
979979
HI.AccessSpecifier = "public";
980980
}},

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ Changes in existing checks
237237
<clang-tidy/checks/modernize/use-designated-initializers>` check by avoiding
238238
diagnosing designated initializers for ``std::array`` initializations.
239239

240-
- Improved :doc:`modernize-use-integer-sign-comparison
241-
<clang-tidy/checks/modernize/use-integer-sign-comparison>` check by matching
242-
valid integer expressions not directly wrapped around an implicit cast.
243-
244240
- Improved :doc:`modernize-use-ranges
245241
<clang-tidy/checks/modernize/use-ranges>` check by updating suppress
246242
warnings logic for ``nullptr`` in ``std::find``.

clang-tools-extra/test/clang-tidy/checkers/modernize/use-integer-sign-comparison.cpp

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -121,81 +121,3 @@ int AllComparisons() {
121121

122122
return 0;
123123
}
124-
125-
namespace PR127471 {
126-
int getSignedValue();
127-
unsigned int getUnsignedValue();
128-
129-
void callExprTest() {
130-
131-
if (getSignedValue() < getUnsignedValue())
132-
return;
133-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
134-
// CHECK-FIXES: if (std::cmp_less(getSignedValue() , getUnsignedValue()))
135-
136-
int sVar = 0;
137-
if (getUnsignedValue() > sVar)
138-
return;
139-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
140-
// CHECK-FIXES: if (std::cmp_greater(getUnsignedValue() , sVar))
141-
142-
unsigned int uVar = 0;
143-
if (getSignedValue() > uVar)
144-
return;
145-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
146-
// CHECK-FIXES: if (std::cmp_greater(getSignedValue() , uVar))
147-
148-
}
149-
150-
// Add a class with member functions for testing member function calls
151-
class TestClass {
152-
public:
153-
int getSignedValue() { return -5; }
154-
unsigned int getUnsignedValue() { return 5; }
155-
};
156-
157-
void memberFunctionTests() {
158-
TestClass obj;
159-
160-
if (obj.getSignedValue() < obj.getUnsignedValue())
161-
return;
162-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
163-
// CHECK-FIXES: if (std::cmp_less(obj.getSignedValue() , obj.getUnsignedValue()))
164-
}
165-
166-
void castFunctionTests() {
167-
// C-style casts with function calls
168-
if ((int)getUnsignedValue() < (unsigned int)getSignedValue())
169-
return;
170-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
171-
// CHECK-FIXES: if (std::cmp_less(getUnsignedValue(),getSignedValue()))
172-
173-
174-
// Static casts with function calls
175-
if (static_cast<int>(getUnsignedValue()) < static_cast<unsigned int>(getSignedValue()))
176-
return;
177-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
178-
// CHECK-FIXES: if (std::cmp_less(getUnsignedValue(),getSignedValue()))
179-
}
180-
181-
// Define tests
182-
#define SIGNED_FUNC getSignedValue()
183-
#define UNSIGNED_FUNC getUnsignedValue()
184-
185-
void defineTests() {
186-
if (SIGNED_FUNC < UNSIGNED_FUNC)
187-
return;
188-
// CHECK-MESSAGES: :[[@LINE-2]]:13: warning: comparison between 'signed' and 'unsigned' integers [modernize-use-integer-sign-comparison]
189-
// CHECK-FIXES: if (std::cmp_less(SIGNED_FUNC , UNSIGNED_FUNC))
190-
}
191-
192-
// Template tests (should not warn)
193-
template <typename T1>
194-
void templateFunctionTest(T1 value) {
195-
if (value() < getUnsignedValue())
196-
return;
197-
198-
if (value() < (getSignedValue() || getUnsignedValue()))
199-
return;
200-
}
201-
} // namespace PR127471

clang/docs/HIPSupport.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
HIP Support
1818
=============
1919

20-
HIP (Heterogeneous-Compute Interface for Portability) `<https://github.com/ROCm-Developer-Tools/HIP>`_ is
20+
HIP (Heterogeneous-Compute Interface for Portability) `<https://github.com/ROCm/HIP>`_ is
2121
a C++ Runtime API and Kernel Language. It enables developers to create portable applications for
2222
offloading computation to different hardware platforms from a single source code.
2323

@@ -41,9 +41,9 @@ backend or the out-of-tree LLVM-SPIRV translator. The SPIR-V is then bundled and
4141
.. note::
4242
While Clang does not directly provide HIP support for NVIDIA GPUs and CPUs, these platforms are supported via other means:
4343

44-
- NVIDIA GPUs: HIP support is offered through the HIP project `<https://github.com/ROCm-Developer-Tools/HIP>`_, which provides a header-only library for translating HIP runtime APIs into CUDA runtime APIs. The code is subsequently compiled using NVIDIA's `nvcc`.
44+
- NVIDIA GPUs: HIP support is offered through the HIP project `<https://github.com/ROCm/HIP>`_, which provides a header-only library for translating HIP runtime APIs into CUDA runtime APIs. The code is subsequently compiled using NVIDIA's `nvcc`.
4545

46-
- CPUs: HIP support is available through the HIP-CPU runtime library `<https://github.com/ROCm-Developer-Tools/HIP-CPU>`_. This header-only library enables CPUs to execute unmodified HIP code.
46+
- CPUs: HIP support is available through the HIP-CPU runtime library `<https://github.com/ROCm/HIP-CPU>`_. This header-only library enables CPUs to execute unmodified HIP code.
4747

4848

4949
Example Usage
@@ -328,7 +328,7 @@ The `parallel_unsequenced_policy <https://en.cppreference.com/w/cpp/algorithm/ex
328328
maps relatively well to the execution model of AMD GPUs. This, coupled with the
329329
the availability and maturity of GPU accelerated algorithm libraries that
330330
implement most / all corresponding algorithms in the standard library
331-
(e.g. `rocThrust <https://github.com/ROCmSoftwarePlatform/rocThrust>`__), makes
331+
(e.g. `rocThrust <https://github.com/ROCm/rocm-libraries/tree/develop/projects/rocthrust>`__), makes
332332
it feasible to provide seamless accelerator offload for supported algorithms,
333333
when an accelerated version exists. Thus, it becomes possible to easily access
334334
the computational resources of an AMD accelerator, via a well specified,
@@ -483,7 +483,7 @@ such as GPUs, work.
483483
allocation / deallocation functions with accelerator-aware equivalents,
484484
based on a pre-established table; the list of functions that can be
485485
interposed is available
486-
`here <https://github.com/ROCmSoftwarePlatform/roc-stdpar#allocation--deallocation-interposition-status>`__;
486+
`here <https://github.com/ROCm/roc-stdpar#allocation--deallocation-interposition-status>`__;
487487
- This is only run when compiling for the host.
488488

489489
The second pass is optional.
@@ -627,7 +627,7 @@ Linux operating system. Support is synthesised in the following table:
627627
The minimum Linux kernel version for running in HMM mode is 6.4.
628628

629629
The forwarding header can be obtained from
630-
`its GitHub repository <https://github.com/ROCmSoftwarePlatform/roc-stdpar>`_.
630+
`its GitHub repository <https://github.com/ROCm/roc-stdpar>`_.
631631
It will be packaged with a future `ROCm <https://rocm.docs.amd.com/en/latest/>`_
632632
release. Because accelerated algorithms are provided via
633633
`rocThrust <https://rocm.docs.amd.com/projects/rocThrust/en/latest/>`_, a
@@ -636,7 +636,7 @@ transitive dependency on
636636
can be obtained either by installing their associated components of the
637637
`ROCm <https://rocm.docs.amd.com/en/latest/>`_ stack, or from their respective
638638
repositories. The list algorithms that can be offloaded is available
639-
`here <https://github.com/ROCmSoftwarePlatform/roc-stdpar#algorithm-support-status>`_.
639+
`here <https://github.com/ROCm/roc-stdpar#algorithm-support-status>`_.
640640

641641
HIP Specific Elements
642642
---------------------

clang/docs/ReleaseNotes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,14 @@ Improvements to Clang's diagnostics
622622

623623
- Improved the FixIts for unused lambda captures.
624624

625+
- Delayed typo correction was removed from the compiler; immediate typo
626+
correction behavior remains the same. Delayed typo correction facilities were
627+
fragile and unmaintained, and the removal closed the following issues:
628+
#GH142457, #GH139913, #GH138850, #GH137867, #GH137860, #GH107840, #GH93308,
629+
#GH69470, #GH59391, #GH58172, #GH46215, #GH45915, #GH45891, #GH44490,
630+
#GH36703, #GH32903, #GH23312, #GH69874.
631+
632+
625633
Improvements to Clang's time-trace
626634
----------------------------------
627635

clang/docs/SanitizerSpecialCaseList.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ precedence. Here are a few examples.
109109
.. code-block:: bash
110110
111111
$ cat ignorelist1.txt
112-
# test.cc will be instrumented.
112+
# test.cc will not be instrumented.
113113
src:*
114114
src:*/mylib/*=sanitize
115115
src:*/mylib/test.cc
116116
117117
$ cat ignorelist2.txt
118-
# test.cc will not be instrumented.
118+
# test.cc will be instrumented.
119119
src:*
120120
src:*/mylib/test.cc
121121
src:*/mylib/*=sanitize

clang/include/clang/AST/Expr.h

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ class Expr : public ValueStmt {
240240
return static_cast<bool>(getDependence() & ExprDependence::UnexpandedPack);
241241
}
242242

243-
/// Whether this expression contains subexpressions which had errors, e.g. a
244-
/// TypoExpr.
243+
/// Whether this expression contains subexpressions which had errors.
245244
bool containsErrors() const {
246245
return static_cast<bool>(getDependence() & ExprDependence::Error);
247246
}
@@ -6965,36 +6964,6 @@ class AtomicExpr : public Expr {
69656964
}
69666965
};
69676966

6968-
/// TypoExpr - Internal placeholder for expressions where typo correction
6969-
/// still needs to be performed and/or an error diagnostic emitted.
6970-
class TypoExpr : public Expr {
6971-
// The location for the typo name.
6972-
SourceLocation TypoLoc;
6973-
6974-
public:
6975-
TypoExpr(QualType T, SourceLocation TypoLoc)
6976-
: Expr(TypoExprClass, T, VK_LValue, OK_Ordinary), TypoLoc(TypoLoc) {
6977-
assert(T->isDependentType() && "TypoExpr given a non-dependent type");
6978-
setDependence(ExprDependence::TypeValueInstantiation |
6979-
ExprDependence::Error);
6980-
}
6981-
6982-
child_range children() {
6983-
return child_range(child_iterator(), child_iterator());
6984-
}
6985-
const_child_range children() const {
6986-
return const_child_range(const_child_iterator(), const_child_iterator());
6987-
}
6988-
6989-
SourceLocation getBeginLoc() const LLVM_READONLY { return TypoLoc; }
6990-
SourceLocation getEndLoc() const LLVM_READONLY { return TypoLoc; }
6991-
6992-
static bool classof(const Stmt *T) {
6993-
return T->getStmtClass() == TypoExprClass;
6994-
}
6995-
6996-
};
6997-
69986967
/// This class represents BOTH the OpenMP Array Section and OpenACC 'subarray',
69996968
/// with a boolean differentiator.
70006969
/// OpenMP 5.0 [2.1.5, Array Sections].

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,6 @@ DEF_TRAVERSE_STMT(CXXRewrittenBinaryOperator, {
29562956
}
29572957
})
29582958
DEF_TRAVERSE_STMT(OpaqueValueExpr, {})
2959-
DEF_TRAVERSE_STMT(TypoExpr, {})
29602959
DEF_TRAVERSE_STMT(RecoveryExpr, {})
29612960
DEF_TRAVERSE_STMT(CUDAKernelCallExpr, {})
29622961

0 commit comments

Comments
 (0)