[CIL users] Looking for help maintaining CIL

2018-06-22 Thread Gabriel Kerneis
o the Github project. Just let me know, -- Gabriel Kerneis -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.lin

Re: [CIL users] cilly merge file problem

2015-11-04 Thread Gabriel Kerneis
Le 2015-11-02 13:40, liaoyuehua a écrit : > /usr/local/bin/cilly.native --out ./demo.cil.c --verbose ./demo.o > ./foo.o --mergedout ./demo_comb.c Cilly hanging reminds me of a bug involving Obj.magic. > but it could not stop while doing last command until I type > ctrl+c.also there is no demo_com

Re: [CIL users] Parsing coreutils

2015-10-06 Thread Gabriel Kerneis
Le 2015-10-06 20:55, ThanhVu (Vu) Nguyen a écrit : > _Static_assert ((SIZEOF (backup_args) / SIZEOF *(backup_args)) == > (SIZEOF (backup_types) / SIZEOF *(backup_types)) + 1, "verify (" > "ARRAY_CARDINALITY (backup_args) == ARRAY_CARDINALITY (backup_types) > + > 1" ")"); _Static_assert seems to b

Re: [CIL users] deprecated functions vs. oldest supported OCaml version

2015-09-28 Thread Gabriel Kerneis
Le 2015-09-22 02:17, Ben Liblit a écrit : > Does commit il-project/cil/commit/6b3638fc5e79fe82e51fb19d4a909345419225ff> [Fix > Pretty module for OCaml 4.02], later revised in > -project/cil/commit/681f17e618282436b8168278af4464036623aaf1> [Safer >

Re: [CIL users] CIL with SPEC CPU 2006 benchmark

2015-09-07 Thread Gabriel Kerneis
Le 2015-09-07 12:06, priyanka a écrit : > src/lq_complex.h[30:14-22] : syntax error > Parsing errorFatal error: exception Frontc.ParseError("Parse error") > > The line mentioned in error contains extern function declaration > whose > return type is #defined. I am quite new to CIL, so can't figure

Re: [CIL users] CIL-OCaml Linux Driver testing - usbkbd.c and usbmouse.c

2015-07-06 Thread Gabriel Kerneis
Le 2015-07-01 16:14, Iyer,Naveen R a écrit : > /home/naveen/linux-3.13.0/arch/x86/include/asm/cpufeature.h[396:7-7] > : syntax error > Parsing errorFatal error: exception Frontc.ParseError("Parse error") > make[1]: *** [drivers/hid/usbhid/hid-core.o] Error 2 > make: *** [_module_drivers/hid/usb

Re: [CIL users] tut2 interesting error

2015-04-13 Thread Gabriel Kerneis
Le 2015-04-11 20:02, Xiaoyang Zhong a écrit : > I am new to CIL and I am going through the tutorials. I have > successfully ran tut2 according to the tutorial, however, when I did > some simple modification to main.ml [1] and tut2.c, the code seems > not > working. […] > I am very confused about t

Re: [CIL users] copyFunction and slocals

2015-02-05 Thread Gabriel Kerneis
Le 2015-02-05 14:59, Benjamin Ylvisaker a écrit : >> On Feb 5, 2015, at 3:52 AM, Gabriel Kerneis >> wrote: >> >> On Wed, Feb 04, 2015 at 11:04:38AM -0700, Benjamin Ylvisaker wrote: >>> I was recently looking at copyFunction because I need something >>>

Re: [CIL users] copyFunction and slocals

2015-02-05 Thread Gabriel Kerneis
On Wed, Feb 04, 2015 at 11:04:38AM -0700, Benjamin Ylvisaker wrote: > I was recently looking at copyFunction because I need something similar. > I was surprised to not find any changes to slocals. Is that a bug or am > I misunderstanding the role of slocals. I'm not sure I understand what you mea

[CIL users] Short-term plans for CIL (was: bug fixed: added missing __atomic_* builtins)

2014-12-30 Thread Gabriel Kerneis
Dear CIL users, On Tue, Dec 02, 2014 at 10:24:19AM -0600, Ben Liblit wrote: > On 11/11/2014 01:50 PM, I wrote: > >Please consider making a new CIL 1.7.4 release with this fix as well. > > Gabriel, are you still around? I assume you'd be the one to post a new > release. Can you please make that

Re: [CIL users] Using monads in CIL?

2014-12-23 Thread Gabriel Kerneis
Le 2014-12-22 15:30, Alex Susu a écrit : > Did anybody consider using monads in CIL? CIL is a large piece of software, relying very heavily on mutation and object-oriented paradigm (with the visitor pattern). This is sometimes painful, because the nice CIL AST is a leaky abstraction when mu

Re: [CIL users] Out of memory error when compiling linux 2.6 using CIL

2014-09-02 Thread Gabriel Kerneis
On Tue, Sep 02, 2014 at 11:05:19PM +0200, Gabriel Kerneis wrote: > On Tue, Sep 02, 2014 at 02:19:12AM -0700, Ahmad Nouralizadeh wrote: > > And after that memory usage started to increase until I ran out of memory! > > Only a guess: try adding the switch --useLogicalOpera

Re: [CIL users] Out of memory error when compiling linux 2.6 using CIL

2014-09-02 Thread Gabriel Kerneis
On Tue, Sep 02, 2014 at 02:19:12AM -0700, Ahmad Nouralizadeh wrote: > And after that memory usage started to increase until I ran out of memory! Only a guess: try adding the switch --useLogicalOperators, it avoids expansion of switch range statements. Best, -- Gabriel --

Re: [CIL users] Compile a single file in kernel source

2014-08-24 Thread Gabriel Kerneis
Le 2014-08-24 14:35, Ahmad Nouralizadeh a écrit : > asm goto("1: jmp %l[t_no]\n" > > So how is it possible to use cil on kernel source? It's on my TODO list: https://github.com/kerneis/cil/issues/12 At the moment, though, there is no way to work-around this. Best, -- Gabriel -

Re: [CIL users] Compile a single file in kernel source

2014-08-24 Thread Gabriel Kerneis
Le 2014-08-24 14:19, Ahmad Nouralizadeh a écrit : > I receive the following error: > > /usr/src/linux-headers-3.2.0-23-generic-pae/arch/x86/include/asm/cpufeature.h[341:0-0] > : syntax error This is likely a gcc syntax extension that CIL does not support. Could you copy/paste the content of cpuf

Re: [CIL users] ISO/ANSI C standard supported by CIL

2014-08-23 Thread Gabriel Kerneis
On Fri, Aug 22, 2014 at 09:20:16PM +0300, Alex Susu wrote: > As far as I see CIL is C99 compliant. Please correct me if I'm wrong. Mostly, but a few parts are not supported (complex numbers I believe, maybe something else). Best, -- Gabriel --

Re: [CIL users] CIL issues with functions and prototypes

2014-08-15 Thread Gabriel Kerneis
On Fri, Aug 15, 2014 at 09:50:41PM +0200, Gabriel Kerneis wrote: > This is a bug. Could you please submit it on github or sourceforge so > that I don't forget about it? Well, maybe it's not in fact. I'll have to check the standard. But I would appreciate a report anyway.

Re: [CIL users] CIL issues with functions and prototypes

2014-08-15 Thread Gabriel Kerneis
On Fri, Aug 15, 2014 at 06:10:45PM +0200, Oliver Schwahn wrote: > input: > -- > int foo(int a, int b) > { > return a + b; > } > int foo(int aa, int bb); > -- > > CIL output > -- > int foo(int aa , int bb ) > { > { > retu

Re: [CIL users] Passing parameters across modules

2014-08-05 Thread Gabriel Kerneis
On Tue, Aug 05, 2014 at 11:27:18AM +0530, Swapnil Mahajan wrote: > I am using multiple modules while compiling using CIL. I want to pass a > string to all the modules as a parameter. Is there any way of passing it > across the modules instead of explicitly passing it to all the modules ? Untested:

Re: [CIL users] parser error for asm goto with CIL version 1.7.3

2014-07-23 Thread Gabriel Kerneis
On Wed, Jul 23, 2014 at 04:36:41PM -0700, hitesh padekar wrote: > Could somebody tell me how can I resolve this parser error for CIL > compilation. I am getting : syntax error > Parsing errorFatal error: exception Frontc.ParseError("Parse error") Known limitation: https://github.com/kerneis/cil/is

[CIL users] [cil:bugs] #144 C11 static union implicit initialization

2014-03-10 Thread Gabriel Kerneis
--- ** [bugs:#144] C11 static union implicit initialization** **Status:** closed-wont-fix **Group:** Bug **Created:** Mon Mar 10, 2014 10:10 AM UTC by Gabriel Kerneis **Last Updated:** Mon Mar 10, 2014 10:10 AM UTC **Owner:** Gabriel Kerneis C99 says the following about static union implicit

Re: [CIL users] GCC __int128 type

2014-02-26 Thread Gabriel Kerneis
On Tue, Feb 25, 2014 at 11:30:41PM +0100, Jan Smets wrote: > Can CIL support this GCC extension? Not currently. It would be possible to add in principle, but… > file.h[80:9-17] : syntax error > Parsing errorFatal error: exception Frontc.ParseError("Parse error") > > If it can't be supported, is

Re: [CIL users] Adding a directive to a cil file, getting vars in scope, and keep track of statement

2014-01-25 Thread Gabriel Kerneis
Le 2014-01-22 20:24, ThanhVu (Vu) Nguyen a écrit : > Hi, I am playing with Cil and have several questions  > > 1. How do I add a directive to a cil file (of type Cil.fil), e.g., > add > #include "mylib.h"  to a c file  file.globals <- (GText "mylib.h") :: file.globals > 2. I want to get all the

Re: [CIL users] Saving modified C version

2014-01-03 Thread Gabriel Kerneis
On Fri, Jan 03, 2014 at 06:33:53PM -0700, ThanhVu (Vu) Nguyen wrote: > is there a way, like passing a flag to cilly, that allows me to get the > modified C version ? the flag --save-temps gives the .i file but it > doesn't contain these modifications. Use --save-temps and look at .cil.c. More p

Re: [CIL users] some problems about CIL

2013-12-10 Thread Gabriel Kerneis
On Mon, Dec 09, 2013 at 08:05:45PM +0800, 陈群辉 wrote: > I hope you can help me to deal with some problems about CIL. You > know, CIL can transform c language to control flow graph and get > data flow infomation . it has lots of modules to achieve its function. > In the document on (http://www.cs.b

Re: [CIL users] OSX problem

2013-12-08 Thread Gabriel Kerneis
On Sun, Dec 08, 2013 at 01:07:27PM +0900, Christian Collberg wrote: > In the past, I've had similar problems with apple macros, > hence the > -U__BLOCKS__ > switch. However, They are so annoying... > -U__OSX_AVAILABLE_STARTING > doesn't seem to do it. > > Any ideas? Maybe -D__OSX_AVAILABLE

Re: [CIL users] sizeof evaluation

2013-11-23 Thread Gabriel Kerneis
On Fri, Nov 22, 2013 at 08:11:27AM -0600, dagr...@rockwellcollins.com wrote: > I have an example for which CIL produced the following code fragment: > > unsigned long *x; > ... > if (sizeof(*x) < 4UL) { > } > > Would it be possible for CIL to evaluate this expression and eliminate the > "if" ?

Re: [CIL users] About CIL on Linux Kernel Compilation

2013-11-19 Thread Gabriel Kerneis
On Tue, Nov 19, 2013 at 12:31:27AM -0500, Qi Alfred Chen wrote: > Hi all, I am new to CIL and I plan to work on a project requiring analysing > TCP code in Linux using program analysis tool. I only need to parse one > file in the kernel, but it turns out that I need to add lots of headers in > CIL

Re: [CIL users] CIL Inliner

2013-11-13 Thread Gabriel Kerneis
On Wed, Nov 13, 2013 at 10:26:42PM +0200, Christian Collberg wrote: > I would love for the inliner to be available by default. Note that "by default", I only mean that do not need to explicitly load it. You can use --load=inliner. -- Gabriel -

Re: [CIL users] CIL Inliner

2013-11-13 Thread Gabriel Kerneis
Hi Jonathan, On Tue, Nov 12, 2013 at 11:38:08PM -0800, Jonathan Kotker wrote: > This is more a question out of curiosity, but is there a reason that the > inliner, available in src/ext, is not included in the default features of > CIL? I use it as part of GameTime, and currently, when a user insta

Re: [CIL users] How to change Binops to function calls?

2013-10-16 Thread Gabriel Kerneis
On Wed, Oct 16, 2013 at 09:19:36PM +0800, tsuletgo wrote: > If you carefully read the definition of CALL instruction, you will > find function can be regarded as an Cil.exp. So it's not difficult to > solve your problem. Take it as a clue. I'm sorry Ting, but what you said makes no sense. Mehrdad

Re: [CIL users] How to change Binops to function calls?

2013-10-16 Thread Gabriel Kerneis
On Wed, Oct 16, 2013 at 12:58:01PM +0330, Mehrdad Abdi wrote: > I want to change all my binary operations to functions. for example > transform expression `b + c * d` to `my_add(b,my_multp(c,d))`. You cannot have nested function calls in CIL. > The problem is function call is a instruction and b

Re: [CIL users] A wish for 2.0

2013-10-15 Thread Gabriel Kerneis
Dear Pietro, On Tue, Oct 15, 2013 at 01:23:46PM +0200, Pietro Braione wrote: > How far is CIL from this ideal? Would be happy to hear that we are > already there. Not that far away. Let's imagine for a second that Simplify is split in a series of simpler passes with well defined interfaces (.mli

Re: [CIL users] New feature: CIL plugins

2013-10-12 Thread Gabriel Kerneis
On Fri, Oct 11, 2013 at 07:49:27PM -0700, Jonathan Kotker wrote: > Fatal error: exception Failure("Config file not found - neither > /usr/etc/findlib > .conf nor the directory /usr/etc/findlib.conf.d") I thought findlib would fail gracefully if there is no findlib.conf file, but it looks like I wa

Re: [CIL users] loop unrolling

2013-10-11 Thread Gabriel Kerneis
On Fri, Oct 11, 2013 at 06:06:54PM +0530, son...@iitk.ac.in wrote: > Is there any inbuilt feature for loop unrolling? I don't think so. > I am trying to implement loop unrolling, if i copy all the statements one > by one then the location remains same for the particular statement. I'm not sur

Re: [CIL users] New feature: CIL plugins

2013-10-10 Thread Gabriel Kerneis
On Thu, Oct 10, 2013 at 10:03:49AM -0700, Jonathan Kotker wrote: > I used to use --load, but then one of my beta-testers informed me that he > seemed to have needed findlib, which spawned off my question to you. I suspect the following happened: - cilly did not find the cma/cmxs (--load was buggy,

Re: [CIL users] New feature: CIL plugins

2013-10-10 Thread Gabriel Kerneis
On Thu, Oct 10, 2013 at 09:29:56AM -0700, Jonathan Kotker wrote: > Since I am using Python to execute the Cilly driver, I managed to find a > way to dynamically set the environment variable OCAMLPATH (albeit > temporarily) from within my Python script, and it works beautifully once > the OCaml code

Re: [CIL users] New feature: CIL plugins

2013-10-09 Thread Gabriel Kerneis
On Wed, Oct 09, 2013 at 10:07:49AM -0700, Jonathan Kotker wrote: > Looking at your commands below, it looks like the 'MYLIBDIR' environment > variable is being hardwired to a location on my computer. Would this > transmute appropriately on other machines? Or does it not matter? So, all you need is

Re: [CIL users] New feature: CIL plugins

2013-10-09 Thread Gabriel Kerneis
On Tue, Oct 08, 2013 at 10:48:36PM -0700, Jonathan Kotker wrote: > I have another question regarding the new system of CIL plugins. Prior to > the current system, all I would have to do is distribute a compiled Cilly > driver (with the license, of course), with my plugins as part of the > compilati

Re: [CIL users] Projects using CIL

2013-10-08 Thread Gabriel Kerneis
Alex, On Tue, Oct 08, 2013 at 05:18:33PM +0300, Alex Susu wrote: > I updated the list of projects using CIL: you can find it at > https://sites.google.com/site/alexsusu/home/cil . > Again, please feel free to add or make corrections to the list. Thanks for your list. Could you please

Re: [CIL users] CIL Semantics / etc.

2013-09-21 Thread Gabriel Kerneis
On Fri, Sep 20, 2013 at 10:26:18PM +0300, Alex Susu wrote: > Would it be a good idea to add CCured to CIL's repo? Not unless a maintainer steps in. Feel free to host a copy of the archive on github or your own website if you wish, to make it more easy to get for other people (assuming it's fr

Re: [CIL users] CIL Semantics / etc.

2013-09-18 Thread Gabriel Kerneis
On Wed, Sep 18, 2013 at 03:58:46PM -0400, Edward Schwartz wrote: > Are the CIL semantics formally defined anywhere? I am aware of > http://www.cs.berkeley.edu/~necula/Papers/cil_cc02.pdf but it seems > incomplete. Alternatively, is there a concrete evaluator for CIL? I > am particularly interest

Re: [CIL users] Dead code elimination

2013-09-18 Thread Gabriel Kerneis
Christoph, On Wed, Sep 18, 2013 at 09:33:21AM +0200, Christoph Spiel wrote: > (3) Precise pointer analysis turned out to be > crucial. The default `Olf' module is much > to imprecise, but you can simply replace it > with `Golf' at the top of "ptranal.ml". > Golf returns _much_ sma

Re: [CIL users] New feature: CIL plugins

2013-09-16 Thread Gabriel Kerneis
On Mon, Sep 16, 2013 at 01:59:40PM -0700, Jonathan Kotker wrote: > Chances are that I may just have to write a replacement batch script for my > own purposes. For what it's worth, I got rid of cilly.bat and .exe extensions because they seemed unnecessary on modern Windows versions. But if anyone h

Re: [CIL users] New feature: CIL plugins

2013-09-16 Thread Gabriel Kerneis
On Mon, Sep 16, 2013 at 01:12:34PM -0700, Jonathan Kotker wrote: > Do you have any suggestions on why this might be the case, or how I might be > able to get the installation to generate a batch script or an executable? cilly.bat has indeed disappeared, but I have tested on cygwin the new pattern

Re: [CIL users] New feature: CIL plugins

2013-09-13 Thread Gabriel Kerneis
On Tue, Aug 27, 2013 at 04:57:36PM +0100, Gabriel Kerneis wrote: > I have just merged my work on CIL plugins into the "develop" branch of > the git repository. This is of interest to anybody who writes his own > CIL features (previously configured using EXTRA_FEATURES). N

[CIL users] [cil:bugs] #140 C99 VLA in structures and initialisers

2013-09-07 Thread Gabriel Kerneis
--- ** [bugs:#140] C99 VLA in structures and initialisers** **Status:** open **Created:** Sat Sep 07, 2013 05:00 PM UTC by Gabriel Kerneis **Last Updated:** Sat Sep 07, 2013 05:00 PM UTC **Owner:** Gabriel Kerneis There is a bug with the initialisers of variable-length arrays in structures

Re: [CIL users] New feature: CIL plugins

2013-09-05 Thread Gabriel Kerneis
On Tue, Aug 27, 2013 at 04:57:36PM +0100, Gabriel Kerneis wrote: > In the meantime, I have published a small "gist" containing a README and > a sample CIL plugin: > > https://gist.github.com/kerneis/6353215#file-readme-md If you are interested in a larger example, includi

Re: [CIL users] New feature: CIL plugins

2013-09-04 Thread Gabriel Kerneis
Pietro, On Wed, Sep 04, 2013 at 05:55:23PM +0200, Pietro Braione wrote: > $ ocamlbuild -use-ocamlfind -package cil foo.cma foo.cmxs > + /usr/bin/ocamlfind ocamlc -c -package cil -o foo.cmo foo.ml > File "foo.ml", line 23, characters 10-27: > Error: Unbound module Simplemem > Command exited with co

Re: [CIL users] New feature: CIL plugins

2013-09-04 Thread Gabriel Kerneis
Hi Pietro, On Wed, Sep 04, 2013 at 05:55:23PM +0200, Pietro Braione wrote: > $ ocamlbuild -use-ocamlfind -package cil foo.cma foo.cmxs > + /usr/bin/ocamlfind ocamlc -c -package cil -o foo.cmo foo.ml > File "foo.ml", line 23, characters 10-27: > Error: Unbound module Simplemem > Command exited with

Re: [CIL users] CIL 1.7.3 Fedora, CentOS and openSUSE packages

2013-09-03 Thread Gabriel Kerneis
On Sat, Aug 31, 2013 at 09:42:38PM +0100, Gabriel Kerneis wrote: > I'll clean the build process as much as possible in the next few days and then > submit patches for Fedora Thanks to Richard Jones, the package will be available in Fedora 20 and Rawhide: https://apps.fedoraproject.o

[CIL users] CIL 1.7.3 Fedora, CentOS and openSUSE packages

2013-08-31 Thread Gabriel Kerneis
Dear all, On Thu, Aug 29, 2013 at 12:08:03PM +0100, Gabriel Kerneis wrote: > I am aware that Fedora packages are outdated (1.4.0). This is the next bullet > on my TODO list. RPM packages of CIL 1.7.3 are now available at the same url for CentOS 6, Fedora 18 and 19, and openSUSE Factory.

[CIL users] CIL Debian and Ubuntu packages

2013-08-29 Thread Gabriel Kerneis
Dear all, I've started working on Debian and Ubuntu packages for CIL. A preliminary package for CIL 1.7.3 is available on OBS (openSUSE Build Service): https://build.opensuse.org/package/show/home:kerneis/ocaml-cil To install it, follow the instructions on: http://software.opensuse.org/do

[CIL users] New feature: CIL plugins

2013-08-27 Thread Gabriel Kerneis
Dear all, I have just merged my work on CIL plugins into the "develop" branch of the git repository. This is of interest to anybody who writes his own CIL features (previously configured using EXTRA_FEATURES). The CIL documentation has not been updated yet. It will of course be updated before the

Re: [CIL users] Global Initializers

2013-08-25 Thread Gabriel Kerneis
On Sun, Aug 25, 2013 at 01:26:08AM -0700, Jonathan Kotker wrote: > Apologies for reviving an old thread, but I'm revisiting this issue, trying > to see if I can patch a way around it, without having to constant-fold > floating point numbers. > > Looking at the suggested line (line 2656 of src/cil.

Re: [CIL users] Signal 127

2013-08-21 Thread Gabriel Kerneis
On Wed, Aug 21, 2013 at 11:10:45AM +0100, Colin Adams wrote: > Should I have done something different? (the commit I pulled was > 2c84963..4994a6e) Pull again ;-) https://github.com/kerneis/cil/commit/88b007e0253652a04abdf34e9a10745a70d29eca I pushed to sourceforge only by mistake. You probably

Re: [CIL users] Signal 127

2013-08-21 Thread Gabriel Kerneis
On Wed, Aug 21, 2013 at 10:58:25AM +0100, Colin Adams wrote: > I'd just found out about ocamldebug, but it seems to insist on a bytecode > file, and there doesn't seem to be an option to compile cil to byte code. The latest version in the develop branch should build both native and bytecode versio

Re: [CIL users] Signal 127

2013-08-21 Thread Gabriel Kerneis
On Wed, Aug 21, 2013 at 10:44:12AM +0100, Colin Adams wrote: > I can't find the word "received" in the source code, so I guess it is > coming from the ocaml runtime. I've never done any ocaml programming, so i > don't know how to go about debugging this - is there a debugger one can use? lib/App/C

Re: [CIL users] Compilation error: Unbound value .feature from v1.7.1 up

2013-08-17 Thread Gabriel Kerneis
On Sat, Aug 17, 2013 at 01:36:07AM +0200, Mihai T. Lazarescu wrote: > I get this error: > > File "feature_config.ml", line 6, characters 3-19: > Error: Unbound value Partools.feature > Command exited with code 2. > make[1]: *** [_build/src/cil.cma] Error 10 > > when I try to compi

Re: [CIL users] Make failing with unknown ocaml option

2013-08-15 Thread Gabriel Kerneis
On Thu, Aug 15, 2013 at 10:09:01AM +0100, Colin Adams wrote: > CIL version CIL_VERSION1.6.0 Could you please try with the latest version from git? 1.6.0 is very old and completely unsupported nowadays. git clone https://github.com/kerneis/cil If it still fails, send c

Re: [CIL users] Make failing with unknown ocaml option

2013-08-15 Thread Gabriel Kerneis
On Thu, Aug 15, 2013 at 09:28:03AM +0100, Colin Adams wrote: > Now I have configure working, but make is failing: > > ocamlc.opt: unknown warning option+. > > I don't know ocaml at all, and googling fails to find this particular text > (with the plus sign). > > (this is on windows - cygwin). Gr

Re: [CIL users] Portability issues when folding floating-point constants [was: Global Initializers]

2013-08-07 Thread Gabriel Kerneis
On Wed, Aug 07, 2013 at 04:43:33PM +0200, Christoph Spiel wrote: > Back then someone (probably more knowledgeable) > convinced me that folding floats and doubles > involves all kinds of non-portability issues, > and therefore is potentially dangerous. Oh, having supervised the "Floating-Point Comp

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Wed, Aug 07, 2013 at 07:13:17AM +0100, Gabriel Kerneis wrote: > You could try and patch src/cil.ml around line 2570 to handle that case Line 2656 and following actually (constFoldBinOp). -- Gabriel -- Get

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Tue, Aug 06, 2013 at 11:03:00PM -0700, Jonathan Kotker wrote: > Is there a way to do this without having to preserve the ternary operator? > The conversion of the ternary operator is useful for easier analysis. No, the conversion basically calls Cil.constFold which fails on anything but ints an

Re: [CIL users] Global Initializers

2013-08-06 Thread Gabriel Kerneis
On Tue, Aug 06, 2013 at 03:55:02PM -0700, Jonathan Kotker wrote: > int a = (int)((3.0 > 2.0) ? 1.0 : 4.0); > > CIL does not seem to like this code, complaining about global initializers > on the first line. However, this is not a problem if the constants are > integers. Is there any way to stop /

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 09:39:26AM +0100, Gabriel Kerneis wrote: > I have no idea why and I don't have the time to check CIL code right now, but > using ChangeDoChildrenPost instead of DoChildren makes your code behave > correctly. I got it: this should be told explicitely in th

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 03:46:51PM +0800, tsuletgo wrote: > Ok. i changed the code. > See the attached. Thanks. I have no idea why and I don't have the time to check CIL code right now, but using ChangeDoChildrenPost instead of DoChildren makes your code behave correctly: open Cil let function_i

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 03:35:34PM +0800, tsuletgo wrote: > Hi, Gabriel > I find some building error about your code snippet: > > method vfunc = function > > | GFun _ -> DoChildren > > | _ -> SkipChildren Hmm, vfunc should be vglob, sorry. -- Gabriel

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
Oops, I didn't clean the code before sending it. It should have been: > class myVisitor = object(self) >inherit nopCilVisitor > >method vfunc = function >| GFun _ -> DoChildren >| _ -> SkipChildren > >method vstmt st = > let df_fun = Cil.emptyFunction "df_stmt_monitor"

Re: [CIL users] A problem about 'queueInstr'

2013-07-26 Thread Gabriel Kerneis
On Fri, Jul 26, 2013 at 11:07:42AM +0800, tsuletgo wrote: > Bug: Visitor's instruction queue is not empty. > You should only use queueInstr inside a function body! > Fatal error: exception Errormsg.Error > Could anyone give me some suggestions ? I'm not sure exactly why this fails, but I gu

[CIL users] ANNOUNCE: CIL 1.7.3

2013-07-24 Thread Gabriel Kerneis
Dear all, CIL 1.7.3 is available from http://sourceforge.net/projects/cil/files/cil/cil-1.7.3.tar.gz http://sourceforge.net/projects/cil/files/cil/cil-1.7.3.tar.gz.asc This release fixes an installation issues which broke compilation of programs using the CIL library (again, thanks to Zachar

Re: [CIL users] A Question about the usedef module in CIL

2013-07-17 Thread Gabriel Kerneis
On Wed, Jul 17, 2013 at 03:32:51PM +0800, tsuletgo wrote: > Luckily, i find there is a variable in usedef.ml which may treat some variable > as a definition: > (** Say if you want to consider a variable def *) > let considerVariableDef: (varinfo -> bool) ref = > ref (fun _ -> true) > Am i misun

Re: [CIL users] cil array init. problem

2013-07-13 Thread Gabriel Kerneis
Hi Dany, > We have a piece of code with a global var. looking like : > > tSiaTableField tmnxRadProxSrvTableLeafOvr[] = > { > { .leafId = LEAF_tmnxRadProxSrvRowStatus , .node.ranges = > ROWSTATUS_RESTRICTED, }, > { .leafId = LEAF_tmnxRadProxSrvAdminState, .node.ranges = > ADMINSTATE_NO

Re: [CIL users] How to use Reaching Defition module?

2013-07-07 Thread Gabriel Kerneis
On Mon, Jul 08, 2013 at 01:20:51PM +0800, Sahana V P wrote: > it did not give any output even though it compiled > without any errors. I have never used this module, but the reason why your program doesn't print anything is because you "ignore(...)" the statements instead of printing them. Instea

Re: [CIL users] Access to Parent Structure

2013-07-03 Thread Gabriel Kerneis
On Wed, Jul 03, 2013 at 03:59:10PM +0300, Alex Susu wrote: > A suggestion (this is actually the main reason I wrote this email): the > ChangeDoChildrenPost is a very useful feature - I used it to build and > update at the end of the visit the stackStmt. Now I wonder if it is > worthy to have a simp

Re: [CIL users] ANNOUNCE: CIL 1.7.2

2013-06-27 Thread Gabriel Kerneis
On Thu, Jun 27, 2013 at 01:24:20PM +0100, Gabriel Kerneis wrote: > This release fixes two build and installation issues Unfortunately, a third one is still here. Sorry about that. It looks like people are finding bugs in CIL at a high rate currently (Charlie Shepherd and Stefan Hajno

[CIL users] ANNOUNCE: CIL 1.7.2

2013-06-27 Thread Gabriel Kerneis
Dear all, CIL 1.7.2 is available from http://sourceforge.net/projects/cil/files/cil/cil-1.7.2.tar.gz http://sourceforge.net/projects/cil/files/cil/cil-1.7.2.tar.gz.asc This release fixes two build and installation issues which broke compilation of programs using the CIL library (thanks to Za

Re: [CIL users] ANNOUNCE: CIL 1.7.1

2013-06-18 Thread Gabriel Kerneis
On Tue, Jun 18, 2013 at 04:53:41PM +0100, Gabriel Kerneis wrote: > As a result, an updated opam package should be available http://opam.ocamlpro.com/pkg/cil.1.7.1.html -- Gabriel -- This SF.net email is sponsored

[CIL users] ANNOUNCE: CIL 1.7.1

2013-06-18 Thread Gabriel Kerneis
Dear all, CIL 1.7.1 is available from http://sourceforge.net/projects/cil/files/cil/cil-1.7.1.tar.gz http://sourceforge.net/projects/cil/files/cil/cil-1.7.1.tar.gz.asc This release is focused on an improved build and installation system. You can now install CIL without root permission (using

Re: [CIL users] ANNOUNCE: CIL 1.7.0

2013-06-03 Thread Gabriel Kerneis
Hi Pietro, On Mon, Jun 03, 2013 at 09:11:52PM +0200, Pietro Braione wrote: > >cilly is now installed as a proper perl script. > > Does this mean that now the cilly script can be relocated, or that there is > an install procedure for CIL? It means that: - perl package dependencies will be ch

[CIL users] ANNOUNCE: CIL 1.7.0

2013-06-03 Thread Gabriel Kerneis
Dear all, CIL 1.7.0 is available from http://sourceforge.net/projects/cil/files/cil/cil-1.7.0.tar.gz http://sourceforge.net/projects/cil/files/cil/cil-1.7.0.tar.gz.asc This release adds support for C99 flexible array members and GCC’s "case range" extension (disabled by default, enabled with

[CIL users] POLL: do you use bin/patcher?

2013-05-31 Thread Gabriel Kerneis
Dear all, I'm currently cleaning up old perl scripts and other obsolete stuff is CIL. Does anybody still uses bin/patcher nowadays? Best regards, -- Gabriel -- Get 100% visibility into Java/.NET code with AppDynamics L

Re: [CIL users] Projects using CIL

2013-05-17 Thread Gabriel Kerneis
On Fri, May 17, 2013 at 10:30:03AM +0300, Alex Susu wrote: > A few weeks ago I looked a bit and wrote down a list with projects using it > at: https://sites.google.com/site/alexsusu/home/cil . Please note that the CIL tutorial is by Zachary Anderson; you should link directly to his page: https://b

Re: [CIL users] Searching with CIL interpreted deconstructors

2013-05-17 Thread Gabriel Kerneis
On Fri, May 17, 2013 at 10:29:34AM +0300, Alex Susu wrote: > Should I send you the new grammar with some explanation on your personal > email? Please, just send a patch on this mailing-list. In case you are not familiar with git, doing something like this should be enough: $ git clone git://gith

Re: [CIL users] Searching with CIL interpreted deconstructors

2013-05-11 Thread Gabriel Kerneis
On Sat, May 11, 2013 at 08:55:02AM +0300, Alex Susu wrote: >I am starting now to experience with the grammar in > formatparse.mly - will let you know of the outcome. I'm still not sure if it's a good idea or not, but please do send a patch and we'll discuss it. My main concern is that the nam

Re: [CIL users] Regarding inserting printf function

2013-04-07 Thread Gabriel Kerneis
On Sun, Apr 07, 2013 at 11:02:23PM +0530, son...@iitk.ac.in wrote: > > I have attached the code that is working now from the code the statement > inserted is of form: > printf("value of if count \n", __cil_tmp4); > > but i want something like > printf("value of if count %d\n", __cil_tmp4); You

Re: [CIL users] Regarding inserting printf function

2013-04-07 Thread Gabriel Kerneis
Hi Sonam, On Sun, Apr 07, 2013 at 07:37:28PM +0530, son...@iitk.ac.in wrote: > my code contains following: > > (TFun(voidType, Some [("format", charPtrType, [])], > true, [])) in > > following is the statement i am writing to create printf statement: > let pos

Re: [CIL users] builtin_types_compatible_p

2013-04-03 Thread Gabriel Kerneis
On Fri, Mar 29, 2013 at 11:01:30AM -0500, dagr...@rockwellcollins.com wrote: > I suspect that CIL is not evaluating builtin_types_compatible_p > correctly/at all. This is now fixed in the develop branch: https://github.com/kerneis/cil/commit/d4f1f1252d3b3471602d9156392c92e09190ba18 Many thanks f

Re: [CIL users] Instrumenting a program with a call to function in external file

2013-03-31 Thread Gabriel Kerneis
On Sun, Mar 31, 2013 at 01:37:33PM +0530, son...@iitk.ac.in wrote: > If i have wrapped varinfos in record type as below: > > type type = { > mutable one : varinfo; > mutable two : varinfo; > } > > how can i use this varinfo values? > Also how can i make use of varinfo returned from find

Re: [CIL users] builtin_types_compatible_p

2013-03-31 Thread Gabriel Kerneis
On Sat, Mar 30, 2013 at 11:55:53AM +, Gabriel Kerneis wrote: > Attached is a quick and dirty patch to fix the case of arrays, making your > example compile, but I'm afraid something more complete about type > compatibility would need to be written. Please ignore this patch, it

Re: [CIL users] builtin_types_compatible_p

2013-03-30 Thread Gabriel Kerneis
On Fri, Mar 29, 2013 at 11:01:30AM -0500, dagr...@rockwellcollins.com wrote: > I suspect that CIL is not evaluating builtin_types_compatible_p > correctly/at all. It is evaluating it, but not correctly: it tests for type equality, not compatibility. The gcc doc explains roughly the difference, b

Re: [CIL users] reconstructing existing block

2013-03-29 Thread Gabriel Kerneis
On Fri, Mar 29, 2013 at 07:01:48PM +0530, son...@iitk.ac.in wrote: > (Block (mkBlock [ mkStmtOneInstr s; tb.bstmts ])) > > so, how can i achieve the same? You need to append your new statement in front of the list: (Block (mkBlock ((mkStmtOneInstr s) :: tb.bstmts))) Similarly, you coul

Re: [CIL users] Is there any API to transform the switch/case statements to if statements

2013-03-23 Thread Gabriel Kerneis
On Sat, Mar 23, 2013 at 12:33:29PM -0700, Amin Alipour wrote: > I am wondering if there is any Cil API or visitor to transform the > switch/case statements to if statements. Yes, and this will probably become a FAQ soon ;-) http://article.gmane.org/gmane.comp.compilers.cil.user/813/ You can searc

[CIL users] ANNOUNCE: CIL 1.6.0

2013-03-22 Thread Gabriel Kerneis
Dear all, CIL 1.6.0 is available from http://sourceforge.net/projects/cil/files/cil/cil-1.6.0.tar.gz http://sourceforge.net/projects/cil/files/cil/cil-1.6.0.tar.gz.asc This release adds support for static local variables and GCC’s "computed gotos" (or "labels as values"). For more details, p

Re: [CIL users] Translate CIL to C

2013-03-22 Thread Gabriel Kerneis
On Fri, Mar 22, 2013 at 05:49:08PM +1100, SHI, Yao wrote: > I am using CIL for some optimizations. The main page said that CIL can do > source-to-source C code transformation. Does it mean that we can translate > CIL back to C code (regardless the program is readable) ? I'm afraid I don't understa

Re: [CIL users] A CIL Tutorial & project template

2013-03-21 Thread Gabriel Kerneis
Hi Zach, On Tue, Jan 08, 2013 at 12:07:46PM +0100, Zachary Anderson wrote: > On Jan 8, 2013, at 11:58 AM, Gabriel Kerneis wrote: > > Thank you very much for sharing this Zachary. Would you like me to add a > > link > > to your tutorial from the CIL homepage, or documentat

Re: [CIL users] Searching with CIL Interpreted deconstructors

2013-03-21 Thread Gabriel Kerneis
Hi Alex, On Tue, Mar 12, 2013 at 12:04:26PM +0200, Alex Susu wrote: > As far as I understand, interpreted constructors allow more general patterns > than deconstructors - see end of Section 6.2 for example of big constructor > pattern. On the other hand, I was able only to specify types for > deco

Re: [CIL users] failed configure on cygwin with Visual C++

2013-03-21 Thread Gabriel Kerneis
Hi Pietro, > > On Wed, Feb 27, 2013 at 02:10:11PM +0100, Pietro Braione wrote: > >> ocamlutil/Makefile.ocaml:276: *** Recursive variable `CAMLDEP' references > >> itself (eventually). Stop. > >> make[1]: Leaving directory `/cygdrive/e/Pietro/arc/cil' > >> Makefile:11: recipe for target `cil' fai

Re: [CIL users] Initializing fundec type

2013-03-15 Thread Gabriel Kerneis
On Fri, Mar 15, 2013 at 06:47:25PM +0530, son...@iitk.ac.in wrote: > M confused regrading how can i intialize a fundec type with some dummy > value? Cil.dummyFundec? -- Gabriel -- Everyone hates slow websites. So do we

Re: [CIL users] Problem on linking cil and ocaml-sqlite library

2013-03-08 Thread Gabriel Kerneis
On Fri, Mar 08, 2013 at 10:07:59AM +0800, tsuletgo wrote: > But, when compiling its native code, it ran into the following error: > From the log, it seems that when compiling its asm code, it failed to link > "pthread" library. > Q: > So how to configure CIL by adding this link (by modifying "Ma

  1   2   3   4   >