Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] Simplifying branches
- Subject: [Frama-c-discuss] Simplifying branches
- From: djs at adelard.com (Daniel Sheridan)
- Date: Wed, 17 Aug 2011 16:26:33 +0100
- In-reply-to: <4E4BD3B9.2030304@inria.fr>
- References: <1313591386.20010.50.camel@coquet> <4E4BD3B9.2030304@inria.fr>
On Wed, 2011-08-17 at 16:44 +0200, Anne Pacalet wrote: > Le 17/08/2011 16:29, Daniel Sheridan a ?crit : > > Is it possible to access this simplification step from a plugin, or do I > > need to write my own visitor-based implementation of it? > > Maybe you should have a look at the file [src/misc/filter.ml]. > It is used by both the [sparecode] and the [slicing] plug-ins > to filter out the unwanted parts. Maybe you can use the provided > functor directly, or at least get inspiration of how to use a [frama_c_visitor]. > In the second case, I think that the function [optim_if] > is what you are looking for. Thanks for the pointer. As I am using sparecode as one of the steps in my plugin, I would expect to get this for free. However, I see that optim_if is never called in such a way that it interprets constant 1 -- it only eliminates the if statement if there is no condition, which seems to occur if the if statement itself is set to non-visible. I see that I could use the functor to get the result that I want. But I wonder whether this would be a useful enhancement, either in filter.ml or in sparecode? Dan.
- Follow-Ups:
- [Frama-c-discuss] Simplifying branches
- From: anne.pacalet at inria.fr (Anne Pacalet)
- [Frama-c-discuss] Simplifying branches
- References:
- [Frama-c-discuss] Simplifying branches
- From: djs at adelard.com (Daniel Sheridan)
- [Frama-c-discuss] Simplifying branches
- From: anne.pacalet at inria.fr (Anne Pacalet)
- [Frama-c-discuss] Simplifying branches
- Prev by Date: [Frama-c-discuss] Simplifying branches
- Next by Date: [Frama-c-discuss] Simplifying branches
- Previous by thread: [Frama-c-discuss] Simplifying branches
- Next by thread: [Frama-c-discuss] Simplifying branches
- Index(es):