- (with-ir1-environment call
- (let* ((*lexenv* (functional-lexenv fun))
- (won nil)
- (res (catch 'local-call-lossage
- (prog1
- (ir1-convert-lambda
- (functional-inline-expansion fun)
- :debug-name (debug-namify "local inline ~A"
- (leaf-debug-name fun)))
- (setq won t)))))
- (cond (won
- (change-ref-leaf ref res)
- res)
- (t
- (let ((*compiler-error-context* call))
- (compiler-note "couldn't inline expand because expansion ~
- calls this LET-converted local function:~
- ~% ~S"
- (leaf-debug-name res)))
- fun))))
- fun))
+ (multiple-value-bind (losing-local-functional converted-lambda)
+ (catch 'locall-already-let-converted
+ (with-ir1-environment-from-node call
+ (let ((*lexenv* (functional-lexenv original-functional)))
+ (values nil
+ (ir1-convert-lambda
+ (functional-inline-expansion original-functional)
+ :debug-name (debug-namify
+ "local inline ~A"
+ (leaf-debug-name
+ original-functional)))))))
+ (cond (losing-local-functional
+ (let ((*compiler-error-context* call))
+ (compiler-note "couldn't inline expand because expansion ~
+ calls this LET-converted local function:~
+ ~% ~S"
+ (leaf-debug-name losing-local-functional)))
+ original-functional)
+ (t
+ (change-ref-leaf ref converted-lambda)
+ converted-lambda)))
+ original-functional))