-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[clang] Remove Diag parameter from Expr::EvaluateKnownConstInt #159512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If it's truly a known const int, it won't emit any diagnostics anyway. And if it did, we wouldn't notice because the parameter was never set to anything.
@llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) ChangesIf it's truly a known const int, it won't emit any diagnostics anyway. And if it did, we wouldn't notice because no call site passed something non-null. Full diff: https://github.com/llvm/llvm-project/pull/159512.diff 2 Files Affected:
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 7554089810336..d99d683d66eab 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -715,9 +715,7 @@ class Expr : public ValueStmt {
/// EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded
/// integer. This must be called on an expression that constant folds to an
/// integer.
- llvm::APSInt EvaluateKnownConstInt(
- const ASTContext &Ctx,
- SmallVectorImpl<PartialDiagnosticAt> *Diag = nullptr) const;
+ llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx) const;
llvm::APSInt EvaluateKnownConstIntCheckOverflow(
const ASTContext &Ctx,
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 12e4e25bd29c4..6b304ebfdba07 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -17863,14 +17863,12 @@ bool Expr::isEvaluatable(const ASTContext &Ctx, SideEffectsKind SEK) const {
!hasUnacceptableSideEffect(Result, SEK);
}
-APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx,
- SmallVectorImpl<PartialDiagnosticAt> *Diag) const {
+APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx) const {
assert(!isValueDependent() &&
"Expression evaluator can't be called on a dependent expression.");
ExprTimeTraceScope TimeScope(this, Ctx, "EvaluateKnownConstInt");
EvalResult EVResult;
- EVResult.Diag = Diag;
EvalInfo Info(Ctx, EVResult, EvaluationMode::IgnoreSideEffects);
Info.InConstantContext = true;
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/16220 Here is the relevant piece of the build log for the reference
|
…159512) If it's truly a known const int, it won't emit any diagnostics anyway. And if it did, we wouldn't notice because no call site passed something non-null.
If it's truly a known const int, it won't emit any diagnostics anyway. And if it did, we wouldn't notice because no call site passed something non-null.