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. Another option is to just provide the OpenBSD regex code as an optional library that gets compiled and linked for MSVC systems. I'm not at all familiar with MSVC build procedures so I don't know how involved that is. The advantage to the second approach is that we keep the POSIX interfaces in the rest of the LLVM code, we don't have to design another set of interfaces and we just use the OpenBSD library when we have to. Thoughts? -Dave
On Tue, Jun 9, 2009 at 12:00 PM, David Greene<dag at cray.com> 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. > > Another option is to just provide the OpenBSD regex code as an optional > library that gets compiled and linked for MSVC systems. I'm not at all > familiar with MSVC build procedures so I don't know how involved that is. > > The advantage to the second approach is that we keep the POSIX interfaces > in the rest of the LLVM code, we don't have to design another set of > interfaces and we just use the OpenBSD library when we have to.<http://www.laurikari.net/tre/> looks somewhat promising as a POSIX-compatible regex library with a suitable license. deep
Can you describe what problem you're trying to solve here? Does it really need Regular Expressions? Dan
On Tuesday 09 June 2009 14:12, Sandeep Patel wrote: r with MSVC build procedures so I don't know how involved that is.> > > > The advantage to the second approach is that we keep the POSIX interfaces > > in the rest of the LLVM code, we don't have to design another set of > > interfaces and we just use the OpenBSD library when we have to. > > <http://www.laurikari.net/tre/> looks somewhat promising as a > POSIX-compatible regex library with a suitable license.We've talked about http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/regex/ as well. Is there any reason to prefer one over the other? I'm testing an integration of the OpenBSD code right now. I can't test a Windows build, though. So how should we go about doing that? I have the autoconf and (I think) cmake work done, but I have no way of fully testing it. Should I just check it in and let Windows users give it a try? -Dave
On Tuesday 09 June 2009 14:34, Dan Gohman wrote:> Can you describe what problem you're trying to solve here? Does it > really need Regular Expressions?Yes. I want TableGen to be able to infer lots of stuff programmatically. This helps tremendously when specifying things like, oh, AVX. :) We could invent our own pattern matching syntax, but why? -Dave
> 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. Nuno
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. -Dave