mirror of
https://github.com/imjasonh/nescript
synced 2026-07-18 14:45:58 +00:00
Analyzer: W0101 warn on expensive multiply/divide
Emits W0101 on \`a * b\`, \`a / b\`, \`a % b\` expressions where both operands are non-constant (neither is an integer literal). These lower to calls into the software multiply/divide routines and can blow the 6502 cycle budget. Multiplying by a constant is still silent because the optimizer can strength-reduce power-of-2 cases to shifts and small factors to add chains. https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
This commit is contained in:
parent
4e05c008ce
commit
1e4e384501
3 changed files with 67 additions and 2 deletions
|
|
@ -42,7 +42,6 @@ pub enum ErrorCode {
|
|||
E0505, // multiple start declarations
|
||||
|
||||
// W01xx: Warnings
|
||||
#[allow(dead_code)]
|
||||
W0101, // expensive multiply/divide operation
|
||||
W0102, // loop without break or wait_frame
|
||||
W0103, // unused variable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue