summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-01-29 04:11:27 +0000
committerbors <bors@rust-lang.org>2023-01-29 04:11:27 +0000
commit17369f324c79bd4aa1bc5735b337df6bdc83341c (patch)
treede2f7e750fff90cac42bd2f0469c02d3e86246f2 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent79475f56ec305f88049c35346d3a2f5082aec2c2 (diff)
parent520814b71395105f83f5c6444589cf3c2b311e2a (diff)
downloadrust-17369f324c79bd4aa1bc5735b337df6bdc83341c.tar.gz
rust-17369f324c79bd4aa1bc5735b337df6bdc83341c.zip
Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions