llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

We emit these diagnostics a lot, but we almost never see them. Try to 
short-circuit these functions if nobody will see the diagnostics anyway.

---
Full diff: https://github.com/llvm/llvm-project/pull/224333.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/Interp.cpp (+5) 


``````````diff
diff --git a/clang/lib/AST/ByteCode/Interp.cpp 
b/clang/lib/AST/ByteCode/Interp.cpp
index cf0f0d0d337df..b6975f250b3c1 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -1095,6 +1095,8 @@ bool CheckInit(InterpState &S, CodePtr OpPC, const 
Pointer &Ptr) {
 
 static bool diagnoseCallableDecl(InterpState &S, CodePtr OpPC,
                                  const FunctionDecl *DiagDecl) {
+  if (!S.diagnosing())
+    return false;
   // Bail out if the function declaration itself is invalid.  We will
   // have produced a relevant diagnostic while parsing it, so just
   // note the problematic sub-expression.
@@ -1212,6 +1214,9 @@ bool CheckThis(InterpState &S, CodePtr OpPC) {
   if (S.Current->hasThisPointer())
     return true;
 
+  if (!S.diagnosing())
+    return false;
+
   const Expr *E = S.Current->getExpr(OpPC);
   if (S.getLangOpts().CPlusPlus11) {
     bool IsImplicit = false;

``````````

</details>


https://github.com/llvm/llvm-project/pull/224333
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to