[PATCH] Allow regexes in all verifier directives: drop the expected-(error|warning|note)-re, variants
Alp Toker
alp at nuanti.com
Wed Dec 11 23:05:10 PST 2013
On 12/12/2013 04:53, Hans Wennborg wrote:
> Hi rsmith,
>
> As suggested by Richard in http://llvm-reviews.chandlerc.com/D2388?id=6039#inline-12744, let's just allow regexes in all verifier directives and drop -re variants to simplify things.
Hi Hans,
This is a good idea, but I'd really like to see your new regex blocks
use a character other than curly braces.
The problem is that {{}} for regular expressions conflicts visually and
syntactically with the outer {{}} in a way that makes it quite difficult
to see what's going on.
A secondary concern is that it looks a bit like FileCheck syntax but in
fact works on a different level with different inputs and outputs is
rather confusing.
So instead of:
|// expected-error {{message {{[^']+}}}}|||
||
How about this syntax?
|// expected-error {{message ~/[^']+/}}|
It's instantly recognisable and has a regular grammar that enables code
editors do syntax highlighting, regex completion etc.
Alp.
>
> The only thing this doesn't simplify is the constexpr-printing.cpp test, but perhaps we can live with that.
>
> http://llvm-reviews.chandlerc.com/D2392
>
> Files:
> include/clang/Basic/DiagnosticFrontendKinds.td
> include/clang/Frontend/VerifyDiagnosticConsumer.h
> lib/Frontend/VerifyDiagnosticConsumer.cpp
> test/Analysis/analyzer-stats.c
> test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
> test/CXX/drs/dr14xx.cpp
> test/CXX/special/class.copy/implicit-move.cpp
> test/Lexer/hexfloat.cpp
> test/Misc/verify.c
> test/Parser/attributes.mm
> test/Sema/format-strings-scanf.c
> test/Sema/ms-wchar.c
> test/Sema/thread-specifier.c
> test/SemaCXX/addr-of-overloaded-function.cpp
> test/SemaCXX/constexpr-printing.cpp
> test/SemaCXX/member-expr.cpp
> test/SemaCXX/nested-name-spec.cpp
> test/SemaCXX/operator-arrow-depth.cpp
> test/SemaCXX/pr13394-crash-on-invalid.cpp
> test/SemaCXX/qualified-id-lookup.cpp
> test/SemaCXX/typo-correction-pt2.cpp
> test/SemaCXX/typo-correction.cpp
> test/SemaTemplate/dependent-names.cpp
> test/SemaTemplate/ms-lookup-template-base-classes.cpp
> test/SemaTemplate/typename-specifier.cpp
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
--
http://www.nuanti.com
the browser experts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131212/14ed7ec1/attachment.html>
More information about the cfe-commits
mailing list