[LLVMdev] Regular Expression lib support

Daniel Dunbar daniel at zuster.org
Sun Aug 23 14:56:20 PDT 2009


We would like to have access to some kind of regular expression
library inside LLVM. For example, we need this to extend the FileCheck
test case checking tool to support regular expressions.

There are three obvious options:
  1. Roll our own library. Multiple unnamed individuals may even
already have implementations lying around! :)

  2. Use POSIX regcomp facilities. This implies importing some
implementation of this interface, e.g., Windows. On Linux, BSD, etc.
we would try to use the platform version if available (and non-buggy).

  3. Import a more heavy weight library such as PCRE, and use it universally.

My personal preference is #2, and I may work on this in the near-term,
but I wanted to check for conflicting opinions first.

My main reasons for preferring #2 is to use a standard interface and
language, and it should be relatively easy to implement and maintain
(I'm assuming there is some nice BSD implementation out their we can
snarf, I haven't actually validated this assumption).

The main downside of #2 vs #1 or #3 is that if we wanted fancier
regexp features we would be somewhat stuck, but I don't think this is
a significant concern.

Ok?

 - Daniel



More information about the llvm-dev mailing list