Skip to content

Commit a4225f1

Browse files
committed
[clang] Remove Diag parameter from Expr::EvaluateKnownConstInt
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.
1 parent d8e1c20 commit a4225f1

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

clang/include/clang/AST/Expr.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,7 @@ class Expr : public ValueStmt {
715715
/// EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded
716716
/// integer. This must be called on an expression that constant folds to an
717717
/// integer.
718-
llvm::APSInt EvaluateKnownConstInt(
719-
const ASTContext &Ctx,
720-
SmallVectorImpl<PartialDiagnosticAt> *Diag = nullptr) const;
718+
llvm::APSInt EvaluateKnownConstInt(const ASTContext &Ctx) const;
721719

722720
llvm::APSInt EvaluateKnownConstIntCheckOverflow(
723721
const ASTContext &Ctx,

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17863,14 +17863,12 @@ bool Expr::isEvaluatable(const ASTContext &Ctx, SideEffectsKind SEK) const {
1786317863
!hasUnacceptableSideEffect(Result, SEK);
1786417864
}
1786517865

17866-
APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx,
17867-
SmallVectorImpl<PartialDiagnosticAt> *Diag) const {
17866+
APSInt Expr::EvaluateKnownConstInt(const ASTContext &Ctx) const {
1786817867
assert(!isValueDependent() &&
1786917868
"Expression evaluator can't be called on a dependent expression.");
1787017869

1787117870
ExprTimeTraceScope TimeScope(this, Ctx, "EvaluateKnownConstInt");
1787217871
EvalResult EVResult;
17873-
EVResult.Diag = Diag;
1787417872
EvalInfo Info(Ctx, EVResult, EvaluationMode::IgnoreSideEffects);
1787517873
Info.InConstantContext = true;
1787617874

0 commit comments

Comments
 (0)