[LLVMdev] Regular Expressions

David Greene dag at cray.com
Tue Jun 9 13:18:21 PDT 2009

On Tuesday 09 June 2009 15:02, Nuno Lopes wrote:
> > On Tuesday 09 June 2009 04:35, Török Edwin wrote:
> > > On 2009-06-09 12:27, Howard Su wrote:
> > > > This change break the MSVC build since no regex by default in Windows
> > > > MSVC platform.
> > >
> > > Perhaps we should add a regex implementation to lib/System?
> >
> > That's potentially a lot of work.  I started looking at it and it would
> > involve hiding the OpenBSD library under some other lib/System facade.
> > Designing that facade takes time and we probably won't get it right
> > the first or second time.
> I guess the standard regex library is PCRE (http://pcre.org). It has its
> own api, but it also supports the POSIX interface. The regex syntax is Perl
> compatible.
> We bundle this library in the PHP core and it works pretty well. It
> compiles everywhere and the maintenance burden is close to zero.

That's a big piece of software.  The OpenBSD version is much smaller.  I have
the OpenBSD version integrated so I'll intend to use that unless someone tells
me we can't for some reason.

Testing under Linux went fine, but that's to be expected.

The main issue with pcre is that it's meant to be built as a standalone 
library.  While I agree with that architecture, it doesn't fit well into
LLVM's libSystem notion.  I don't know if we want to get into the business
of configuring and building external libraries as part of the LLVM build
process.  At least I know *I* don't want to do it.  Others should feel 
free.  :)

Really, we should be using TR1 but not all compilers are there yet.

BTW, is there a process for dropping compiler support?  Eventually most 
compilers will have TR1 except for very old versions.  It's not feasible
to support all of those crufty compilers forever.


More information about the llvm-dev mailing list