diff mbox series

[2/4] builtin: allow linearization to fail

Message ID 20200905111211.82199-3-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series builtin: teach sparse to linearize __builtin_fma() | expand

Commit Message

Luc Van Oostenryck Sept. 5, 2020, 11:12 a.m. UTC
Allow the linearization of builtins to fail and continue with
the normal linearization of OP_CALLs. The motivation for this
is for the linearization of target specific builtins.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 linearize.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/linearize.c b/linearize.c
index 1a2677713123..bf55045bcbce 100644
--- a/linearize.c
+++ b/linearize.c
@@ -1513,8 +1513,11 @@  static pseudo_t linearize_call_expression(struct entrypoint *ep, struct expressi
 	fntype = fn->ctype;
 
 	// handle builtins
-	if (fntype->op && fntype->op->linearize)
-		return fntype->op->linearize(ep, expr);
+	if (fntype->op && fntype->op->linearize) {
+		retval = fntype->op->linearize(ep, expr);
+		if (retval)
+			return retval;
+	}
 
 	ctype = &fntype->ctype;
 	if (fntype->type == SYM_NODE)