[LLVMdev] Utilizing gperf for TableGen

Wilhansen Li krad at crammerz-inc.net
Thu Jan 3 17:50:25 PST 2008

I'm a bit familiar with the algorithm behind gperf (though I still
have to actually study the source code since they added something
after publishing the paper about gperf). So, is it possible to
reimplement that algorithm in the TableGen of LLVM? That would
eliminate the dependency to gperf however, since gperf is GPLv2'ed,
will the licenses be compatible? AFAIK, yes.

OT: Sorry for my multiple sends to the mailing list, been wrestling
with GMail having two mail accounts.

On 1/3/08, Reid Spencer <rspencer at reidspencer.com> wrote:
> FYI, gperf is a very good perfect hash utility written originally by Doug Schmidt (of ACE fame). I used it in XPS for speeding up XML parsing by hashing all the element and attribute names.  Unfortunately, its a code generator, which we're trying to get rid of in LLVM. Still, I recommend the tool highly.
> Reid.
> On Tue, 1 Jan 2008 13:04:57 -0800
>  Chris Lattner <sabre at nondot.org> wrote:
> >
> >On Jan 1, 2008, at 1:51 AM, Wilhansen Li wrote:
> >
> >> The output of TableGen (intrinsics.gen) seems a bit too clunky
> >> specifically the switching parts (input the string, output the enum).
> >> Moreover, the code makes MSVC barf due to its nesting limit which even
> >> applices to if-else statements.
> >
> >Right, fixing the VC++ issue is straight-forward.  I will do it in the
> >next couple of days if noone beats me to it.
> >
> >
> >> One one hand, gperf
> >> (http://www.gnu.org/software/gperf/manual/gperf.html) offers a way to
> >> map strings to records without much difficulty (and it does its job
> >> efficiently).
> >>
> >> My point is, are there plans to utilize gperf for table generation?
> >
> >Not that I know of.  Anton is working on a better and more aggressive
> >implementation of this code in question though,
> >
> >-Chris
> >
> >_______________________________________________
> >LLVM Developers mailing list
> >LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> >http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Life is too short for dial-up.

More information about the llvm-dev mailing list