Skip to content

Commit 0a3d2ff

Browse files
committed
Merge from 'main' to 'sycl-web' (intel#50)
CONFLICT (add/add): Merge conflict in clang/test/SemaSYCL/unique-stable-name-multiple-target-crash.cpp CONFLICT (content): Merge conflict in clang/lib/AST/ASTContext.cpp
2 parents eb1470e + cb66bf2 commit 0a3d2ff

File tree

278 files changed

+7313
-8457
lines changed

Some content is hidden

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

278 files changed

+7313
-8457
lines changed

clang/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-readability-identifier-naming'
1+
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-readability-identifier-naming,-misc-no-recursion'
22
# Note that the readability-identifier-naming check is disabled, there are too
33
# many violations in the codebase and they create too much noise in clang-tidy
44
# results.

clang/docs/OpenCLSupport.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<style type="text/css">
44
.none { background-color: #FFCCCC }
5-
.partial { background-color: #FFFF99 }
5+
.part { background-color: #FFFF99 }
66
.good { background-color: #CCFF99 }
77
</style>
88

99
.. role:: none
10-
.. role:: partial
10+
.. role:: part
1111
.. role:: good
1212

1313
.. contents::
@@ -327,7 +327,7 @@ Limited support of experimental C++ libraries is described in the :ref:`experime
327327

328328
Bugzilla bugs for this functionality are typically prefixed
329329
with '[C++4OpenCL]' - click `here
330-
<https://bugs.llvm.org/buglist.cgi?component=OpenCL&list_id=204139&product=clang&query_format=advanced&resolution=---&sh ort_desc=%5BC%2B%2B4OpenCL%5D&short_desc_type=allwordssubstr>`_
330+
<https://bugs.llvm.org/buglist.cgi?component=OpenCL&list_id=204139&product=clang&query_format=advanced&resolution=---&short_desc=%5BC%2B%2B4OpenCL%5D&short_desc_type=allwordssubstr>`__
331331
to view the full bug list.
332332

333333

@@ -344,7 +344,7 @@ OpenCL C 3.0 Usage
344344

345345
OpenCL C 3.0 language standard makes most OpenCL C 2.0 features optional. Optional
346346
functionality in OpenCL C 3.0 is indicated with the presence of feature-test macros
347-
(list of feature-test macros is `here <https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#features>`_).
347+
(list of feature-test macros is `here <https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#features>`__).
348348
Command-line flag :ref:`-cl-ext <opencl_cl_ext>` can be used to override features supported by a target.
349349

350350
For cases when there is an associated extension for a specific feature (fp64 and 3d image writes)

clang/docs/SanitizerCoverage.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,9 @@ Disabling instrumentation with ``__attribute__((no_sanitize("coverage")))``
316316
===========================================================================
317317

318318
It is possible to disable coverage instrumentation for select functions via the
319-
function attribute ``__attribute__((no_sanitize("coverage")))``.
319+
function attribute ``__attribute__((no_sanitize("coverage")))``. Because this
320+
attribute may not be supported by other compilers, it is recommended to use it
321+
together with ``__has_feature(coverage_sanitizer)``.
320322

321323
Disabling instrumentation without source modification
322324
=====================================================

clang/include/clang/Basic/Features.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ FEATURE(memtag_sanitizer, LangOpts.Sanitize.has(SanitizerKind::MemTag))
4949
FEATURE(xray_instrument, LangOpts.XRayInstrument)
5050
FEATURE(undefined_behavior_sanitizer,
5151
LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined))
52+
FEATURE(coverage_sanitizer, LangOpts.SanitizeCoverage)
5253
FEATURE(assume_nonnull, true)
5354
FEATURE(attribute_analyzer_noreturn, true)
5455
FEATURE(attribute_availability, true)

clang/include/clang/Basic/LangOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ class LangOptions : public LangOptionsBase {
286286

287287
/// Set of enabled sanitizers.
288288
SanitizerSet Sanitize;
289+
/// Is at least one coverage instrumentation type enabled.
290+
bool SanitizeCoverage = false;
289291

290292
/// Paths to files specifying which objects
291293
/// (files, functions, variables) should not be instrumented.

clang/lib/Analysis/RetainSummaryManager.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,20 @@ static bool isSubclass(const Decl *D,
145145
return !(match(SubclassM, *D, D->getASTContext()).empty());
146146
}
147147

148-
static bool isOSObjectSubclass(const Decl *D) {
149-
return D && isSubclass(D, "OSMetaClassBase");
148+
static bool isExactClass(const Decl *D, StringRef ClassName) {
149+
using namespace ast_matchers;
150+
DeclarationMatcher sameClassM =
151+
cxxRecordDecl(hasName(std::string(ClassName)));
152+
return !(match(sameClassM, *D, D->getASTContext()).empty());
150153
}
151154

152-
static bool isOSObjectDynamicCast(StringRef S) {
153-
return S == "safeMetaCast";
155+
static bool isOSObjectSubclass(const Decl *D) {
156+
return D && isSubclass(D, "OSMetaClassBase") &&
157+
!isExactClass(D, "OSMetaClass");
154158
}
155159

160+
static bool isOSObjectDynamicCast(StringRef S) { return S == "safeMetaCast"; }
161+
156162
static bool isOSObjectRequiredCast(StringRef S) {
157163
return S == "requiredMetaCast";
158164
}

clang/lib/Analysis/ThreadSafety.cpp

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,8 @@ class ThreadSafetyAnalyzer {
10501050
const CFGBlock* PredBlock,
10511051
const CFGBlock *CurrBlock);
10521052

1053+
bool join(const FactEntry &a, const FactEntry &b);
1054+
10531055
void intersectAndWarn(FactSet &FSet1, const FactSet &FSet2,
10541056
SourceLocation JoinLoc, LockErrorKind LEK1,
10551057
LockErrorKind LEK2);
@@ -2186,6 +2188,28 @@ void BuildLockset::VisitDeclStmt(const DeclStmt *S) {
21862188
}
21872189
}
21882190

2191+
/// Given two facts merging on a join point, decide whether to warn and which
2192+
/// one to keep.
2193+
///
2194+
/// \return false if we should keep \p A, true if we should keep \p B.
2195+
bool ThreadSafetyAnalyzer::join(const FactEntry &A, const FactEntry &B) {
2196+
if (A.kind() != B.kind()) {
2197+
// For managed capabilities, the destructor should unlock in the right mode
2198+
// anyway. For asserted capabilities no unlocking is needed.
2199+
if ((A.managed() || A.asserted()) && (B.managed() || B.asserted())) {
2200+
// The shared capability subsumes the exclusive capability.
2201+
return B.kind() == LK_Shared;
2202+
} else {
2203+
Handler.handleExclusiveAndShared("mutex", B.toString(), B.loc(), A.loc());
2204+
// Take the exclusive capability to reduce further warnings.
2205+
return B.kind() == LK_Exclusive;
2206+
}
2207+
} else {
2208+
// The non-asserted capability is the one we want to track.
2209+
return A.asserted() && !B.asserted();
2210+
}
2211+
}
2212+
21892213
/// Compute the intersection of two locksets and issue warnings for any
21902214
/// locks in the symmetric difference.
21912215
///
@@ -2213,20 +2237,8 @@ void ThreadSafetyAnalyzer::intersectAndWarn(FactSet &FSet1,
22132237

22142238
FactSet::iterator Iter1 = FSet1.findLockIter(FactMan, LDat2);
22152239
if (Iter1 != FSet1.end()) {
2216-
const FactEntry &LDat1 = FactMan[*Iter1];
2217-
if (LDat1.kind() != LDat2.kind()) {
2218-
Handler.handleExclusiveAndShared("mutex", LDat2.toString(), LDat2.loc(),
2219-
LDat1.loc());
2220-
if (LEK1 == LEK_LockedSomePredecessors &&
2221-
LDat1.kind() != LK_Exclusive) {
2222-
// Take the exclusive lock, which is the one in FSet2.
2223-
*Iter1 = Fact;
2224-
}
2225-
} else if (LEK1 == LEK_LockedSomePredecessors && LDat1.asserted() &&
2226-
!LDat2.asserted()) {
2227-
// The non-asserted lock in FSet2 is the one we want to track.
2240+
if (join(FactMan[*Iter1], LDat2) && LEK1 == LEK_LockedSomePredecessors)
22282241
*Iter1 = Fact;
2229-
}
22302242
} else {
22312243
LDat2.handleRemovalFromIntersection(FSet2, FactMan, JoinLoc, LEK1,
22322244
Handler);

clang/lib/Basic/Targets/PPC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
5959
} else if (Feature == "+prefix-instrs") {
6060
HasPrefixInstrs = true;
6161
} else if (Feature == "+spe" || Feature == "+efpu2") {
62+
HasStrictFP = false;
6263
HasSPE = true;
6364
LongDoubleWidth = LongDoubleAlign = 64;
6465
LongDoubleFormat = &llvm::APFloat::IEEEdouble();

clang/lib/Driver/ToolChain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ ToolChain::UnwindLibType ToolChain::GetUnwindLibType(
856856
else if (LibName == "platform" || LibName == "") {
857857
ToolChain::RuntimeLibType RtLibType = GetRuntimeLibType(Args);
858858
if (RtLibType == ToolChain::RLT_CompilerRT) {
859-
if (getTriple().isAndroid())
859+
if (getTriple().isAndroid() || getTriple().isOSAIX())
860860
unwindLibType = ToolChain::UNW_CompilerRT;
861861
else
862862
unwindLibType = ToolChain::UNW_None;

clang/lib/Driver/ToolChains/AIX.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ void AIX::AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
221221
switch (GetCXXStdlibType(Args)) {
222222
case ToolChain::CST_Libcxx:
223223
CmdArgs.push_back("-lc++");
224+
CmdArgs.push_back("-lc++abi");
224225
return;
225226
case ToolChain::CST_Libstdcxx:
226227
llvm::report_fatal_error("linking libstdc++ unimplemented on AIX");

0 commit comments

Comments
 (0)