[cfe-dev] [PATCH] add regex/globbing to -verify diagnostics

mike mikem.llvm at gmail.com
Sat Apr 24 22:57:13 PDT 2010


The other day someone on IRC asked if -verify supported regex; attached is a patch for regex and glob-style matching. They're selected by using one of '-', '~' or '*' for string, regex and glob matching. Maybe '?' would be better for glob? Here's a few pertinent lines from the header docs:

/// Alternative matching modes may be specified via the first character which
/// follows 'expected'. The following modes are supported:
///
///   - standard string matching, case-sensitive
///   ~ regular-expression matching
///   * glob-style matching
///
/// Examples: match error "variable has incomplete type 'struct s'"
///
///   // expected-error {{variable has incomplete type 'struct s'}}
///   // expected-error {{variable has incomplete type}}
///
///   // expected~error {{variable has has type 'struct .'}}
///   // expected~error {{variable has has type 'struct .*'}}
///   // expected~error {{variable has has type 'struct (.*)'}}
///
///   // expected*error {{variable has incomplete type 'struct ?'}}
///   // expected*error {{variable has incomplete type 'struct [stuv]'}}
///   // expected*error {{variable has incomplete type 'struct [!abcd]'}}
///   // expected*error {{variable has incomplete type 'struct *'}}

--mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verify.regex0.patch
Type: application/octet-stream
Size: 21669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100425/a169e08a/attachment.obj>


More information about the cfe-dev mailing list