[PATCH] Improve diagnostics of number-reading preprocessor directives

Michael Ilseman milseman at apple.com
Mon Apr 8 17:31:38 PDT 2013


Attached is a patch to improve the diagnostics of number-reading preprocessor directives. For example, the digit directive was sharing number-reading code with the #line directive, however some of the errors and warnings generated were written for the #line directive.

#line 11foo1 ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "#line directive requires a simple digit sequence"

This patch parameterizes the error/warning so that the caller can specify their own directive to report:

#line 11foo1 ==> "#line directive requires a simple digit sequence"
# 11foo1       ==> "digit directive requires a simple digit sequence"

Test case in patch.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: digit_directive_line_diag.patch
Type: application/octet-stream
Size: 5614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130408/f6d667b8/attachment.obj>


More information about the cfe-commits mailing list