[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/75721 I found this handy for situations where you want to pass in a config file and not rely on a default `.clang-tidy` file. The new option is `-config` and will expect something that can be passed into the `--confi

[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
cjappl wrote: @njames93 friendly ping for a review on this PR. Thank you in advance! https://github.com/llvm/llvm-project/pull/75721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/75721 >From 433f4ac919a6967c278e56a19b5824e474ebd907 Mon Sep 17 00:00:00 2001 From: Chris Apple <14171107+cja...@users.noreply.github.com> Date: Sat, 16 Dec 2023 15:53:56 -0800 Subject: [PATCH 1/2] Add ability to pass in

[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/75721 >From 433f4ac919a6967c278e56a19b5824e474ebd907 Mon Sep 17 00:00:00 2001 From: Chris Apple <14171107+cja...@users.noreply.github.com> Date: Sat, 16 Dec 2023 15:53:56 -0800 Subject: [PATCH 1/3] Add ability to pass in

[clang-tools-extra] Allow to pass config file to clang-tidy-diff (PR #75457)

2023-12-16 Thread Chris Apple via cfe-commits
cjappl wrote: @MichaelLettrich I just realized I submitted basically the same PR as you! Great minds think alike. I found yours when I searched. https://github.com/llvm/llvm-project/pull/75721 In this PR I added to the release notes, feel free to steal them if you want. I would love this feat

[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/75721 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] Add ability to pass in a clang-tidy config file to clang-tidy-diff (PR #75721)

2023-12-16 Thread Chris Apple via cfe-commits
cjappl wrote: This is almost exactly the same as #75457 , just with the release notes. I'm going to close this for now and re-open it if that one gets stale. https://github.com/llvm/llvm-project/pull/75721 ___ cfe-commits mailing list cfe-commits@list

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-01 Thread Chris Apple via cfe-commits
cjappl wrote: Pinging reviewers @vitalybuka @MaskRay @zygoloid All the comments on this PR have been addressed, looking for more feedback, or approval/merge if we are getting close! Thanks in advance :) https://github.com/llvm/llvm-project/pull/92460 __

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-03 Thread Chris Apple via cfe-commits
cjappl wrote: > clangDriver changes are usually the last. The expectation is that if > -fsanitize=realtime does not return an error, there should be some basic > functionality. Thanks for the feedback @MaskRay . I removed all of the clang components of this review, leaving only the compiler-r

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-03 Thread Chris Apple via cfe-commits
@@ -0,0 +1,67 @@ +import os + +# Setup config name. +config.name = "RTSAN" + config.name_suffix + +# Setup source root. +config.test_source_root = os.path.dirname(__file__) + +# Setup default compiler flags use with -frtsan-instrument option. +clang_rtsan_cflags = ["-frtsan-instru

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-08 Thread Chris Apple via cfe-commits
cjappl wrote: Pinging reviewers @vitalybuka @zygoloid State of the review: 1 approval from MaskRay, all open comments have been addressed. Looking for more feedback, or more approval or a merge if this is looking good. Thanks much! :) https://github.com/llvm/llvm-project/pull/92460 _

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-08 Thread Chris Apple via cfe-commits
@@ -0,0 +1,516 @@ +//===--- rtsan_test_interceptors.cpp - Realtime Sanitizer ---*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-03 Thread Chris Apple via cfe-commits
cjappl wrote: Just saw the test failure, but it is unrelated: ``` _bk;t=1725300551284FAIL: lld :: ELF/avr-reloc.s (84796 of 87084) _bk;t=1725300551284 TEST 'lld :: ELF/avr-reloc.s' FAILED ``` https://github.com/llvm/llvm-project/pull/106736 ___

[clang] [clang][rtsan] Add realtime_sanitizer to Features.def (PR #106650)

2024-09-05 Thread Chris Apple via cfe-commits
cjappl wrote: Weekly ping of reviewers - also added a couple more folks if they have time to take a look. Current state: no reviews https://github.com/llvm/llvm-project/pull/106650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] [clang][rtsan] Add realtime_sanitizer to Features.def (PR #106650)

2024-09-05 Thread Chris Apple via cfe-commits
cjappl wrote: Oh, also cc @davidtrevelyan https://github.com/llvm/llvm-project/pull/106650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][rtsan] Add realtime_sanitizer to Features.def (PR #106650)

2024-09-05 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/106650 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-06 Thread Chris Apple via cfe-commits
cjappl wrote: Weekly reviewer ping @vitalybuka @MaskRay @pcc https://github.com/llvm/llvm-project/pull/106736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-06 Thread Chris Apple via cfe-commits
cjappl wrote: Hi @dougsonos We’re experiencing an unforeseen pain point trying to use rtsan without function effects, and wanted to ask **how you would feel about making function effect warnings opt-in rather than opt-out.** While users can easily opt in to function effects and not rtsan, t

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-06 Thread Chris Apple via cfe-commits
@@ -54,6 +54,8 @@ FEATURE(memtag_globals, FEATURE(xray_instrument, LangOpts.XRayInstrument) FEATURE(undefined_behavior_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined)) +FEATURE(realtime_sanitizer, cjappl wrote: https://github.com/llvm/l

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-06 Thread Chris Apple via cfe-commits
@@ -54,6 +54,8 @@ FEATURE(memtag_globals, FEATURE(xray_instrument, LangOpts.XRayInstrument) FEATURE(undefined_behavior_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined)) +FEATURE(realtime_sanitizer, cjappl wrote: But not merged yet, waiti

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-09-06 Thread Chris Apple via cfe-commits
cjappl wrote: > My sense is that it would be weird for -Wall not to include > -Wfunction-effects, but that it would be OK for -Wfunction-effects not to be > enabled by default. I do agree, it seems reasonable for it to be in `-Wall` or similar! That is absolutely what I'd expect as a user :)

[clang] [NFC][rtsan] Docs of how to disable rtsan (PR #107707)

2024-09-07 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/107707 None >From e3e211f65afbc923299c0f413d2c50c7b00884b6 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Sat, 7 Sep 2024 08:38:06 -0700 Subject: [PATCH] [NFC][rtsan] Docs of how to disable rtsan --- clang/docs/Rea

[clang] [NFC][rtsan] Docs of how to disable rtsan (PR #107707)

2024-09-07 Thread Chris Apple via cfe-commits
cjappl wrote: CC for review @davidtrevelyan https://github.com/llvm/llvm-project/pull/107707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC][rtsan] Docs of how to disable rtsan (PR #107707)

2024-09-09 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/107707 >From e3e211f65afbc923299c0f413d2c50c7b00884b6 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Sat, 7 Sep 2024 08:38:06 -0700 Subject: [PATCH 1/2] [NFC][rtsan] Docs of how to disable rtsan --- clang/docs/Realt

[clang] [NFC][rtsan] Docs of how to disable rtsan (PR #107707)

2024-09-09 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/107707 >From e3e211f65afbc923299c0f413d2c50c7b00884b6 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Sat, 7 Sep 2024 08:38:06 -0700 Subject: [PATCH 1/3] [NFC][rtsan] Docs of how to disable rtsan --- clang/docs/Realt

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/102622 Introduce the `-fsanitize=realtime` flag in clang driver Plug in the RealtimeSanitizer PassManager pass in Codegen, and attribute a function based on if it has the `[[clang::nonblocking]]` function effect. >Fr

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
cjappl wrote: I was not able to figure out a way to separate the CodeGen from the driver, seeing as the codegen only happens when the sanitizer is enabled. This means to write unit tests for the CodeGen, I needed the -fsanitize=realtime flag. If someone has advice on how to get around this pro

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
@@ -845,6 +845,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, if (SanOpts.has(SanitizerKind::ShadowCallStack)) Fn->addFnAttr(llvm::Attribute::ShadowCallStack); + if (SanOpts.has(SanitizerKind::Realtime)) { +for (const FunctionEffectWithCon

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
@@ -995,6 +996,13 @@ void EmitAssemblyHelper::RunOptimizationPipeline( FPM.addPass(BoundsCheckingPass()); }); +if (LangOpts.Sanitize.has(SanitizerKind::Realtime)) + PB.registerScalarOptimizerLateEPCallback( cjappl wrote: I am co

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
@@ -552,11 +552,15 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, SanitizerKind::Leak | SanitizerKind::Thread | SanitizerKind::Memory | SanitizerKind::KernelAddress | SanitizerKind::Scudo | Sanitiz

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
cjappl wrote: Pinging for a possible review: @Sirraide @AaronBallman @MaskRay @vitalybuka @dougsonos Co-Author @davidtrevelyan https://github.com/llvm/llvm-project/pull/102622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 00d75e70c55e1e0c0b57a6402a9d02604a35dba6 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/2] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-09 Thread Chris Apple via cfe-commits
@@ -845,6 +845,12 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, if (SanOpts.has(SanitizerKind::ShadowCallStack)) Fn->addFnAttr(llvm::Attribute::ShadowCallStack); + if (SanOpts.has(SanitizerKind::Realtime)) { +for (const FunctionEffectWithCon

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-11 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/102622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/3] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/4] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/5] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/6] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/3] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-12 Thread Chris Apple via cfe-commits
cjappl wrote: (Sorry for the "double ping", I just got commit powers, so adding people to the review explicitly) https://github.com/llvm/llvm-project/pull/102622 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang][rtsan] Introduce realtime sanitizer codegen and driver (PR #102622)

2024-08-13 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/102622 >From 9d3d49fa755c28b21c3b4771faae65cf418dec5a Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Wed, 24 Jul 2024 14:25:44 -0700 Subject: [PATCH 1/4] [clang][rtsan] Introduce realtime sanitizer codegen and driver

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-13 Thread Chris Apple via cfe-commits
cjappl wrote: Hi @dougsonos Seeing a possible bug when using `malloc` in a [[nonallocating]] context. Specifically this test program (partially stolen from one of your test cases) ```cpp #include void nb4_inline() {} void nb4_not_inline(); void nb4() noexcept [[clang::nonallocating]] { fl

[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

2024-08-13 Thread Chris Apple via cfe-commits
cjappl wrote: > exceptions to "built-in functions are always safe" aha! I missed this was part of the plan to begin with, that makes sense. This latest commit fixed my example. Code throws a warning as expected! https://github.com/llvm/llvm-project/pull/99656 __

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-06-05 Thread Chris Apple via cfe-commits
@@ -1509,6 +1511,11 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, AddLinkSanitizerLibArgs(Args, CmdArgs, "asan"); } cjappl wrote: Thanks for catching this! Added a few basic ones that test that the flag is supported, and that s

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-06-21 Thread Chris Apple via cfe-commits
cjappl wrote: Pinging reviewers, after we had more conversations on the overall structure and usefulness of RTSan, and it was approved. @zygoloid @vitalybuka @MaskRay Details of the aforementioned discussion are around here in the discourse thread: https://discourse.llvm.org/t/rfc-nolock-an

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce RADSan backend (PR #92460)

2024-05-30 Thread Chris Apple via cfe-commits
cjappl wrote: Ping @yln @vitalybuka @Sirraide @AaronBallman @zygoloid @compnerd @petrhosek @isanbard @MaskRay https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce RADSan backend (PR #92460)

2024-06-03 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-06-03 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-06-03 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-06-03 Thread Chris Apple via cfe-commits
cjappl wrote: Hi @Endilll I did a git bisect that pointed to this change as the one blocking my compilation on an Ubuntu docker image with clang 14.0 The error I see: ``` CMake Error at /test_radsan/llvm-project/compiler-rt/cmake/Modules/CheckSectionExists.cmake:72 (message): cc: error:

[clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-06-03 Thread Chris Apple via cfe-commits
cjappl wrote: Thanks for your help! You were correct that cc was pointing to gcc. This is fixed when I updated my machine to use my known clang as the default compiler. For future archeologists, this meant (from [this answer](https://askubuntu.com/questions/1198087/how-to-set-clang-9-as-the-de

[clang] [compiler-rt] [llvm] [clang][llvm][rtsan] Introduce RealtimeSanitizer clang codegen, llvm attributes (PR #100120)

2024-07-23 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/100120 >From e0a1336da28f0f1d9f870be1676991d415160321 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 18 Jul 2024 17:29:01 +0200 Subject: [PATCH 1/2] [rtsan] Introduce rtsan frontend --- clang/include/clang/Basi

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-23 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/100192 Inserts the `__rtsan_realtime_enter` at the first line of all functions with [[clang::nonblocking]] function effects, and `__rtsan_realtime_exit` at all exit points. Introduces the -fsanitize=realtime flag, and

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-23 Thread Chris Apple via cfe-commits
cjappl wrote: CC for review @MaskRay @vitalybuka @AaronBallman @Sirraide @rjmccall @erichkeane @davidtrevelyan @dougsonos https://github.com/llvm/llvm-project/pull/100192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang] [compiler-rt] [llvm] [clang][llvm][rtsan] Introduce RealtimeSanitizer clang codegen, llvm attributes (PR #100120)

2024-07-23 Thread Chris Apple via cfe-commits
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/100120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [clang][llvm][rtsan] Introduce RealtimeSanitizer clang codegen, llvm attributes (PR #100120)

2024-07-23 Thread Chris Apple via cfe-commits
cjappl wrote: Closing in favor of these two reviews to begin with, a 3rd will be added with the lit test components after these are merged: 1. Fixing unit test intermittent failure on mac: https://github.com/llvm/llvm-project/pull/100188 2. clang codegen component https://github.com/llvm/llvm-

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-23 Thread Chris Apple via cfe-commits
@@ -1410,6 +1414,35 @@ QualType CodeGenFunction::BuildFunctionArgList(GlobalDecl GD, return ResTy; } +void InsertCallBeforeInstruction(llvm::Function *Fn, cjappl wrote: > Also maybe I missed some discussion. these changes looks like better be done > by ll

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-23 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/100192 >From 0307f457862e4a7ef623a74690422eb1425f1067 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 18 Jul 2024 17:29:01 +0200 Subject: [PATCH 1/2] [rtsan] Introduce rtsan clang codegen --- clang/include/clang

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-25 Thread Chris Apple via cfe-commits
cjappl wrote: Thanks to the feedback from @MaskRay and @vitalybuka , closing in favor of doing this processing in LLVM. (PR: https://github.com/llvm/llvm-project/pull/100596) The clang driver changes will come after that is merged! Appreciate all the reviews setting us on the right path. ht

[clang] [clang][rtsan] Introduce realtime sanitizer clang codegen and -fsanitize flag (PR #100192)

2024-07-25 Thread Chris Apple via cfe-commits
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/100192 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)

2024-08-29 Thread Chris Apple via cfe-commits
https://github.com/cjappl approved this pull request. Seems reasonable to me, I would wait for other approvals, as I'm relatively new here. Just ensure this is good to go with rtsan, I recommend running the tests locally, as I don't think they're a part of the default pre-commit set ``` ninja

[clang] [clang][rtsan] Add realtime_sanitizer to Features.def (PR #106650)

2024-08-29 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/106650 None >From 4af0857bd8f2cb332a1ee7b359002ed6522d1aa8 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 29 Aug 2024 17:16:37 -0700 Subject: [PATCH] [clang][rtsan] Add realtime sanitizer to Features.def --- c

[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)

2024-08-30 Thread Chris Apple via cfe-commits
cjappl wrote: > I'm seeing a test failure but I'm not sure if it's an issue with RTSan or > compiler-rt atomic implementation: Interesting, so that test basically tests that large atomics that insert locks under the hood die as expected. Zooming in on the second part of the test: ``` std::at

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
https://github.com/cjappl created https://github.com/llvm/llvm-project/pull/106736 Follows #106650 - that's why that change is in this PR, that will disappear when that is approved and merged. To disable rtsan, we are following the same approach as lsan: https://github.com/llvm/llvm-project/

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
cjappl wrote: CC @davidtrevelyan for review https://github.com/llvm/llvm-project/pull/106736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/106736 >From c9d3d6c256b763bc99e7bf2d2dca43cb1e88adb8 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 29 Aug 2024 17:16:37 -0700 Subject: [PATCH 1/3] [clang][rtsan] Add realtime sanitizer to Features.def --- cla

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
@@ -0,0 +1,117 @@ +//===-- sanitizer/rtsan_interface.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/106736 >From c9d3d6c256b763bc99e7bf2d2dca43cb1e88adb8 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 29 Aug 2024 17:16:37 -0700 Subject: [PATCH 1/4] [clang][rtsan] Add realtime sanitizer to Features.def --- cla

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
https://github.com/cjappl deleted https://github.com/llvm/llvm-project/pull/106736 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
@@ -0,0 +1,117 @@ +//===-- sanitizer/rtsan_interface.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-08-30 Thread Chris Apple via cfe-commits
@@ -0,0 +1,117 @@ +//===-- sanitizer/rtsan_interface.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)

2024-08-30 Thread Chris Apple via cfe-commits
cjappl wrote: Ok, it appears that on Apple systems, we would catch this, as we intercept OSSpinLockLock used by compiler-rt atomics: https://github.com/llvm/llvm-project/blob/c55e24b8507d47a8cc04b5d9570e8e3d02be1ca3/compiler-rt/lib/builtins/atomic.c#L95-L102 But, in the non-darwin case this is

[clang] [compiler-rt] [llvm] [CMake][compiler-rt] Support for using compiler-rt atomic library (PR #106603)

2024-08-30 Thread Chris Apple via cfe-commits
cjappl wrote: > but it'd be better if we handled atomic CAS spinlocks as well since we would > like to avoid the pthread dependency if possible. Agreed, I have something in the works for this but it is a little ways off. (catching these unbound loops is a bit tricky) My recommendation to make

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-02 Thread Chris Apple via cfe-commits
https://github.com/cjappl updated https://github.com/llvm/llvm-project/pull/106736 >From c9d3d6c256b763bc99e7bf2d2dca43cb1e88adb8 Mon Sep 17 00:00:00 2001 From: Chris Apple Date: Thu, 29 Aug 2024 17:16:37 -0700 Subject: [PATCH 1/6] [clang][rtsan] Add realtime sanitizer to Features.def --- cla

[clang] [compiler-rt] [compiler-rt][rtsan] Introduce rtsan_interface.h and ScopedDisabler (PR #106736)

2024-09-02 Thread Chris Apple via cfe-commits
@@ -0,0 +1,117 @@ +//===-- sanitizer/rtsan_interface.h -*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-09 Thread Chris Apple via cfe-commits
cjappl wrote: Also, just as a heads up, neither of the authors have commit access as we are new to LLVM. If this is OK to go in we will need help with that step. https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-09 Thread Chris Apple via cfe-commits
cjappl wrote: > I can reproduce and will debug in an hour. Thanks for the help @vitalybuka , I am looking into this as well, but very grateful for more experienced eyes on the matter too. I'll keep you posted here if I find anything https://github.com/llvm/llvm-project/pull/92460

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-09 Thread Chris Apple via cfe-commits
cjappl wrote: There are 3 errors I see: Mostly it's this `llvm_gtest` issue: ``` ninja: error: 'compiler-rt/lib/rtsan/tests/llvm_gtest', needed by 'compiler-rt/lib/rtsan/tests/RtsanNoInstTestObjects.rtsan_preinit.cpp.x86_64.o', missing and no known rule to make it ``` On fuchsia it is a param

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-09 Thread Chris Apple via cfe-commits
cjappl wrote: This patch I have a strong hunch fixes issue 1 in my comment above. This patch compiles and runs on my linux container and my mac, proving it doesn't affect compilation on those two systems. ``` diff --git a/compiler-rt/lib/rtsan/tests/CMakeLists.txt b/compiler-rt/lib/rtsan/test

[clang] [compiler-rt] [compiler-rt] Realtime Sanitizer: Introduce Realtime Sanitizer (RTSan) backend (PR #92460)

2024-07-09 Thread Chris Apple via cfe-commits
cjappl wrote: > This also breaks building the compiler-rt for older android versions, because > pthread_spinlock_t is only defined when `__ANDROID_API__` >= 24. Thanks for reporting this @glandium ! I am in the process of disabling this for android as we speak. Let me know if you see anything

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-01 Thread Chris Apple via cfe-commits
@@ -27,6 +27,8 @@ #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtVisitor.h" #include "clang/AST/Type.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" cjappl wrote: FYI, these two headers require a cmake change: ``` diff --git a/clang/lib/Sema/CMakeL

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-01 Thread Chris Apple via cfe-commits
@@ -27,6 +27,8 @@ #include "clang/AST/StmtObjC.h" #include "clang/AST/StmtVisitor.h" #include "clang/AST/Type.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" cjappl wrote: To be less prescriptive with the solution: I was getting linker errors saying that th

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-03 Thread Chris Apple via cfe-commits
@@ -8057,3 +8057,70 @@ requirement: } }]; } + +def DocCatNonBlockingNonAllocating : DocumentationCategory<"Performance Constraint Attributes"> { + let Content = [{ cjappl wrote: It may be good to mention what the flag is that you use to enable these war

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-03 Thread Chris Apple via cfe-commits
cjappl wrote: Hi @dougsonos, Just starting to integrate our two changes and noticing a possible bug here. Issue: `blocking(false)` does not seem to resolve to `nonblocking` ## Streps to repro: 1. Have an example like ``` int main() [[clang::blocking(false)]] { return 0; } ``` 2. (optional

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-03 Thread Chris Apple via cfe-commits
cjappl wrote: Ah! Nice, that is a totally valid solution as well. The only argument for the parameter that I can think of is symmetry. I just noticed it _could_ accept a parameter, so I expected the behavior above. Absolutely good by me to strike it from being possible. https://github.com/llv

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
cjappl wrote: I can confirm that now if I try to use any argument with `blocking` I get: ``` /Users/topher/Desktop/test_radsan/main.cpp:25:40: error: 'blocking' attribute takes no arguments 25 | float process (float* data) noexcept [[clang::blocking(false)]] ``` Great! https://github.com/l

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
cjappl wrote: Possibly another bug here (or user error). I am trying to see the warnings show up for a simple test program. The clang used in this example is the tip of your branch at time of writing b95964c2570c11d1d80ae6874be5e400f7b504ad ```cpp #include #include int* process () [[clang:

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -1870,6 +1870,28 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, FromFn = QT->getAs(); Changed = true; } + +// For C, when called from checkPointerTypesForAssignment, +// we need not to alter FromFn, or else even an innocuous c

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, cjappl wro

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -7963,6 +7967,148 @@ static Attr *getCCTypeAttr(ASTContext &Ctx, ParsedAttr &Attr) { llvm_unreachable("unexpected attribute kind!"); } +ExprResult Sema::ActOnEffectExpression(Expr *CondExpr, FunctionEffectMode &Mode, + bool RequireC

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
https://github.com/cjappl commented: Just doing a first pass review. The guts of this are above my paygrade, but after playing with this functionally for a few days it seems to behave as intended from the realtime sanitizer team! :) https://github.com/llvm/llvm-project/pull/84983 _

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/84983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -0,0 +1,124 @@ +// RUN: %clang_cc1 %s -ast-dump -fblocks | FileCheck %s + +// Make sure that the attribute gets parsed and attached to the correct AST elements. + +#pragma clang diagnostic ignored "-Wunused-variable" + +// =

[clang] nonblocking/nonallocating attributes (was: nolock/noalloc) (PR #84983)

2024-05-04 Thread Chris Apple via cfe-commits
@@ -18347,7 +18347,7 @@ void Sema::SetFunctionBodyKind(Decl *D, SourceLocation Loc, FnBodyKind BodyKind, } } -bool Sema::CheckOverridingFunctionAttributes(const CXXMethodDecl *New, +bool Sema::CheckOverridingFunctionAttributes(CXXMethodDecl *New, cjappl wro

[clang] [compiler-rt] PREVIEW: Introduce realtime sanitizer backend (PR #91529)

2024-05-08 Thread Chris Apple via cfe-commits
https://github.com/cjappl closed https://github.com/llvm/llvm-project/pull/91529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] PREVIEW: Introduce realtime sanitizer backend (PR #91529)

2024-05-08 Thread Chris Apple via cfe-commits
cjappl wrote: Sorry, premature!! https://github.com/llvm/llvm-project/pull/91529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] PREVIEW: Introduce realtime sanitizer backend (PR #91529)

2024-05-08 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/91529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] Realtime Sanitizer: Introduce RADSan backend (PR #92460)

2024-05-16 Thread Chris Apple via cfe-commits
https://github.com/cjappl edited https://github.com/llvm/llvm-project/pull/92460 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [compiler-rt] Realtime Sanitizer: Introduce RADSan backend (PR #92460)

2024-05-16 Thread Chris Apple via cfe-commits
@@ -1382,6 +1382,10 @@ collectSanitizerRuntimes(const ToolChain &TC, const ArgList &Args, StaticRuntimes.push_back("asan_cxx"); } + if (!SanArgs.needsSharedRt() && SanArgs.needsRadsanRt()) { +StaticRuntimes.push_back("radsan"); + } cjappl wrote:

  1   2   3   >