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

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 12:54:06 PDT 2024


================
@@ -15074,6 +15012,106 @@ class Sema final : public SemaBase {
   std::string getFixItZeroLiteralForType(QualType T, SourceLocation Loc) const;
 
   ///@}
+
+  //
+  //
+  // -------------------------------------------------------------------------
+  //
+  //
+
+  /// \name Function Effects
+  /// Implementations are in SemaFunctionEffects.cpp
+  ///@{
+public:
+  struct FunctionEffectDiff {
+    enum class Kind { Added, Removed, ConditionMismatch };
+
+    FunctionEffect::Kind EffectKind;
+    Kind DiffKind;
+    FunctionEffectWithCondition Old; // invalid when Kind is Added.
+    FunctionEffectWithCondition New; // invalid when Kind is Removed.
----------------
Sirraide wrote:

```suggestion
    FunctionEffectWithCondition Old; // Invalid when 'Kind' is 'Added'.
    FunctionEffectWithCondition New; // Invalid when 'Kind' is 'Removed'.
```
Nit

(added the quotes because I was confused for a second as to why we’d be ‘adding a kind’ to a `FunctionEffectDiff`, because I didn’t realise that the field is literally called `Kind` and the enumerator `Added`)

https://github.com/llvm/llvm-project/pull/99656


More information about the cfe-commits mailing list