Skip to content

[Const Evaluator] Fix a minor bug in the deletion of copy constructor of ConstExprStepEvaluator #24780

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

Merged
merged 1 commit into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/swift/SILOptimizer/Utils/ConstExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class ConstExprStepEvaluator {
/// evaluation.
SmallPtrSet<SILBasicBlock *, 8> visitedBlocks;

ConstExprStepEvaluator(const ConstExprEvaluator &) = delete;
void operator=(const ConstExprEvaluator &) = delete;
ConstExprStepEvaluator(const ConstExprStepEvaluator &) = delete;
void operator=(const ConstExprStepEvaluator &) = delete;

public:
/// Constructs a step evaluator given an allocator and a non-null pointer to a
Expand Down
5 changes: 2 additions & 3 deletions lib/SILOptimizer/Utils/ConstExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1590,9 +1590,8 @@ void ConstExprEvaluator::computeConstantValues(

ConstExprStepEvaluator::ConstExprStepEvaluator(SymbolicValueAllocator &alloc,
SILFunction *fun)
: evaluator(ConstExprEvaluator(alloc)),
internalState(
new ConstExprFunctionState(evaluator, fun, {}, stepsEvaluated)) {
: evaluator(alloc), internalState(new ConstExprFunctionState(
evaluator, fun, {}, stepsEvaluated)) {
assert(fun);
}

Expand Down