Skip to content

Commit 541e697

Browse files
authored
LLVM and SPIRV-LLVM-Translator pulldown (WW23) #3852
LLVM: llvm/llvm-project@caf86d2 SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@485c8c7
2 parents e8d8b3a + fd85b9d commit 541e697

File tree

1,745 files changed

+109468
-84203
lines changed

Some content is hidden

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

1,745 files changed

+109468
-84203
lines changed

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
7575
const CanonicalIncludes &CanonIncludes) override {
7676
if (FIndex)
7777
FIndex->updatePreamble(Path, Version, Ctx, std::move(PP), CanonIncludes);
78-
if (ServerCallbacks)
79-
ServerCallbacks->onSemanticsMaybeChanged(Path);
8078
}
8179

8280
void onMainAST(PathRef Path, ParsedAST &AST, PublishFn Publish) override {
@@ -105,6 +103,11 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
105103
ServerCallbacks->onFileUpdated(File, Status);
106104
}
107105

106+
void onPreamblePublished(PathRef File) override {
107+
if (ServerCallbacks)
108+
ServerCallbacks->onSemanticsMaybeChanged(File);
109+
}
110+
108111
private:
109112
FileIndex *FIndex;
110113
ClangdServer::Callbacks *ServerCallbacks;

clang-tools-extra/clangd/TUScheduler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,7 @@ void PreambleThread::build(Request Req) {
909909
ASTPeer.updatePreamble(std::move(Req.CI), std::move(Req.Inputs),
910910
LatestBuild, std::move(Req.CIDiags),
911911
std::move(Req.WantDiags));
912+
Callbacks.onPreamblePublished(FileName);
912913
});
913914

914915
if (!LatestBuild || Inputs.ForceRebuild) {

clang-tools-extra/clangd/TUScheduler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@ class ParsingCallbacks {
169169

170170
/// Called whenever the TU status is updated.
171171
virtual void onFileUpdated(PathRef File, const TUStatus &Status) {}
172+
173+
/// Preamble for the TU have changed. This might imply new semantics (e.g.
174+
/// different highlightings). Any actions on the file are guranteed to see new
175+
/// preamble after the callback.
176+
virtual void onPreamblePublished(PathRef File) {}
172177
};
173178

174179
/// Handles running tasks for ClangdServer and managing the resources (e.g.,

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ if(FUCHSIA_SDK)
145145
set(FUCHSIA_x86_64-unknown-fuchsia_NAME x64)
146146
set(FUCHSIA_riscv64-unknown-fuchsia_NAME riscv64)
147147
foreach(target i386-unknown-fuchsia;x86_64-unknown-fuchsia;aarch64-unknown-fuchsia;riscv64-unknown-fuchsia)
148-
set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/fdio/include")
148+
set(FUCHSIA_${target}_COMPILER_FLAGS "--target=${target} -I${FUCHSIA_SDK}/pkg/sync/include -I${FUCHSIA_SDK}/pkg/fdio/include")
149149
set(FUCHSIA_${target}_LINKER_FLAGS "-L${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/lib")
150150
set(FUCHSIA_${target}_SYSROOT "${FUCHSIA_SDK}/arch/${FUCHSIA_${target}_NAME}/sysroot")
151151
endforeach()

clang/docs/SanitizerCoverage.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,17 @@ will not be instrumented.
312312
// for every non-constant array index.
313313
void __sanitizer_cov_trace_gep(uintptr_t Idx);
314314

315-
Partially disabling instrumentation
316-
===================================
315+
Disabling instrumentation with ``__attribute__((no_sanitize("coverage")))``
316+
===========================================================================
317+
318+
It is possible to disable coverage instrumentation for select functions via the
319+
function attribute ``__attribute__((no_sanitize("coverage")))``.
320+
321+
Disabling instrumentation without source modification
322+
=====================================================
317323

318324
It is sometimes useful to tell SanitizerCoverage to instrument only a subset of the
319-
functions in your target.
325+
functions in your target without modifying source files.
320326
With ``-fsanitize-coverage-allowlist=allowlist.txt``
321327
and ``-fsanitize-coverage-blocklist=blocklist.txt``,
322328
you can specify such a subset through the combination of an allowlist and a blocklist.

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,6 +3535,10 @@ def NoSanitize : InheritableAttr {
35353535
}
35363536
return Mask;
35373537
}
3538+
3539+
bool hasCoverage() const {
3540+
return llvm::is_contained(sanitizers(), "coverage");
3541+
}
35383542
}];
35393543
}
35403544

clang/include/clang/Basic/AttrDocs.td

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,12 +3736,17 @@ def NoSanitizeDocs : Documentation {
37363736
let Content = [{
37373737
Use the ``no_sanitize`` attribute on a function or a global variable
37383738
declaration to specify that a particular instrumentation or set of
3739-
instrumentations should not be applied. The attribute takes a list of
3740-
string literals, which have the same meaning as values accepted by the
3741-
``-fno-sanitize=`` flag. For example,
3742-
``__attribute__((no_sanitize("address", "thread")))`` specifies that
3743-
AddressSanitizer and ThreadSanitizer should not be applied to the
3744-
function or variable.
3739+
instrumentations should not be applied.
3740+
3741+
The attribute takes a list of string literals with the following accepted
3742+
values:
3743+
* all values accepted by ``-fno-sanitize=``;
3744+
* ``coverage``, to disable SanitizerCoverage instrumentation.
3745+
3746+
For example, ``__attribute__((no_sanitize("address", "thread")))`` specifies
3747+
that AddressSanitizer and ThreadSanitizer should not be applied to the function
3748+
or variable. Using ``__attribute__((no_sanitize("coverage")))`` specifies that
3749+
SanitizerCoverage should not be applied to the function.
37453750

37463751
See :ref:`Controlling Code Generation <controlling-code-generation>` for a
37473752
full list of supported sanitizer flags.

clang/include/clang/Basic/Builtins.def

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,22 +1577,22 @@ BUILTIN(__builtin_nontemporal_store, "v.", "t")
15771577
BUILTIN(__builtin_nontemporal_load, "v.", "t")
15781578

15791579
// Coroutine intrinsics.
1580-
BUILTIN(__builtin_coro_resume, "vv*", "")
1581-
BUILTIN(__builtin_coro_destroy, "vv*", "")
1582-
BUILTIN(__builtin_coro_done, "bv*", "n")
1583-
BUILTIN(__builtin_coro_promise, "v*v*IiIb", "n")
1584-
1585-
BUILTIN(__builtin_coro_size, "z", "n")
1586-
BUILTIN(__builtin_coro_frame, "v*", "n")
1587-
BUILTIN(__builtin_coro_noop, "v*", "n")
1588-
BUILTIN(__builtin_coro_free, "v*v*", "n")
1589-
1590-
BUILTIN(__builtin_coro_id, "v*Iiv*v*v*", "n")
1591-
BUILTIN(__builtin_coro_alloc, "b", "n")
1592-
BUILTIN(__builtin_coro_begin, "v*v*", "n")
1593-
BUILTIN(__builtin_coro_end, "bv*Ib", "n")
1594-
BUILTIN(__builtin_coro_suspend, "cIb", "n")
1595-
BUILTIN(__builtin_coro_param, "bv*v*", "n")
1580+
LANGBUILTIN(__builtin_coro_resume, "vv*", "", COR_LANG)
1581+
LANGBUILTIN(__builtin_coro_destroy, "vv*", "", COR_LANG)
1582+
LANGBUILTIN(__builtin_coro_done, "bv*", "n", COR_LANG)
1583+
LANGBUILTIN(__builtin_coro_promise, "v*v*IiIb", "n", COR_LANG)
1584+
1585+
LANGBUILTIN(__builtin_coro_size, "z", "n", COR_LANG)
1586+
LANGBUILTIN(__builtin_coro_frame, "v*", "n", COR_LANG)
1587+
LANGBUILTIN(__builtin_coro_noop, "v*", "n", COR_LANG)
1588+
LANGBUILTIN(__builtin_coro_free, "v*v*", "n", COR_LANG)
1589+
1590+
LANGBUILTIN(__builtin_coro_id, "v*Iiv*v*v*", "n", COR_LANG)
1591+
LANGBUILTIN(__builtin_coro_alloc, "b", "n", COR_LANG)
1592+
LANGBUILTIN(__builtin_coro_begin, "v*v*", "n", COR_LANG)
1593+
LANGBUILTIN(__builtin_coro_end, "bv*Ib", "n", COR_LANG)
1594+
LANGBUILTIN(__builtin_coro_suspend, "cIb", "n", COR_LANG)
1595+
LANGBUILTIN(__builtin_coro_param, "bv*v*", "n", COR_LANG)
15961596

15971597
// OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions.
15981598
// We need the generic prototype, since the packet type could be anything.

clang/include/clang/Basic/Builtins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ enum LanguageID {
3737
OCLC1X_LANG = 0x40, // builtin for OpenCL C 1.x only.
3838
OMP_LANG = 0x80, // builtin requires OpenMP.
3939
CUDA_LANG = 0x100, // builtin requires CUDA.
40+
COR_LANG = 0x200, // builtin requires use of 'fcoroutine-ts' option.
4041
ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages.
4142
ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode.
4243
ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG, // builtin requires MS mode.

clang/include/clang/Basic/CodeGenOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,12 @@ class CodeGenOptions : public CodeGenOptionsBase {
452452
bool hasMaybeUnusedDebugInfo() const {
453453
return getDebugInfo() >= codegenoptions::UnusedTypeInfo;
454454
}
455+
456+
// Check if any one of SanitizeCoverage* is enabled.
457+
bool hasSanitizeCoverage() const {
458+
return SanitizeCoverageType || SanitizeCoverageIndirectCalls ||
459+
SanitizeCoverageTraceCmp;
460+
}
455461
};
456462

457463
} // end namespace clang

0 commit comments

Comments
 (0)