[all-commits] [llvm/llvm-project] cebaf0: [clang] Make the `AnalyzerOptions` reference count...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Mon Apr 28 12:42:24 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cebaf0cea1f2cf9d71b4d965104e08a7ff6c89c4
      https://github.com/llvm/llvm-project/commit/cebaf0cea1f2cf9d71b4d965104e08a7ff6c89c4
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2025-04-28 (Mon, 28 Apr 2025)

  Changed paths:
    M clang/include/clang/Frontend/CompilerInvocation.h
    M clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h
    M clang/lib/Frontend/CompilerInvocation.cpp

  Log Message:
  -----------
  [clang] Make the `AnalyzerOptions` reference count non-intrusive (#137680)

This PR makes `CompilerInvocation` the sole owner of the
`AnalyzerOptions` instance. Clients can no longer become co-owners by
doing something like this:

```c++
void shareOwnership(CompilerInvocation &CI) {
  IntrusiveRefCntPtr Shared = &CI.getAnalyzerOpts();
}
```

The motivation for this is given here:
https://github.com/llvm/llvm-project/pull/133467#issuecomment-2762065443



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list