llvm-capstone/clang
Fangrui Song 5624e86ae0 [tsan] Respect !nosanitize metadata and remove gcov special case
Certain instrumentations set the !nosanitize metadata for inserted
instructions, which are generally not interested for sanitizers. Skip
tsan instrumentation like we do for asan (D126294)/msan/hwasan.

-fprofile-arcs instrumentation has data race unless
-fprofile-update=atomic is specified. Let's remove the the `__llvm_gcov`
special case from commit 0222adbcd2 (2016)
as the racy instructions have the !nosanitize metadata.
(-fprofile-arcs instrumentation does not use `__llvm_gcda` as global variables.)

```
std::atomic<int> c;
void foo() { c++; }
int main() {
  std::thread th(foo);
  c++;
  th.join();
}
```
Tested that `clang++ --coverage -fsanitize=thread a.cc && ./a.out` does
not report spurious tsan errors.

Also remove the default CC1 option -fprofile-update=atomic for
-fsanitize=thread to make options more orthogonal.

Reviewed By: Enna1

Differential Revision: https://reviews.llvm.org/D158385
2023-08-24 22:31:11 -07:00
..
bindings
cmake Revert part of "[test][asan] Disable new test from D157552 on Android" 2023-08-11 15:07:29 -07:00
docs [OpenMP 5.1] Parsing and Sema support for scope directive 2023-08-24 18:13:52 -07:00
examples Fix examples after C2x renaming 2023-08-11 08:01:17 -04:00
include [OpenMP 5.1] Parsing and Sema support for scope directive 2023-08-24 18:13:52 -07:00
lib [tsan] Respect !nosanitize metadata and remove gcov special case 2023-08-24 22:31:11 -07:00
runtime
test [tsan] Respect !nosanitize metadata and remove gcov special case 2023-08-24 22:31:11 -07:00
tools [OpenMP 5.1] Parsing and Sema support for scope directive 2023-08-24 18:13:52 -07:00
unittests [ORC][clang-repl] Fix another unit test after 122ebe3b50. 2023-08-24 08:20:07 -07:00
utils [clang] Fix the pre-commit CI pipeline after changes to libc++'s own CI pipeline 2023-08-23 22:21:53 -04:00
www Revert "[Clang] CWG1473: do not err on the lack of space after operator""" 2023-08-22 18:10:41 -07:00
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt cmake: add missing dependencies on ClangDriverOptions tablegen 2023-08-04 10:27:19 -07:00
CodeOwners.rst Add my Discord, IRC, and Discourse handles 2023-08-04 09:12:14 -04:00
INSTALL.txt
LICENSE.TXT
NOTES.txt Revert "Test commit config" 2023-08-22 16:43:34 -07:00
README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:             http://clang.llvm.org/
Building and using Clang:         http://clang.llvm.org/get_started.html
Clang Static Analyzer:            http://clang-analyzer.llvm.org/
Information on the LLVM project:  http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang forums:
  https://discourse.llvm.org/c/clang/

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/