[cfe-dev] [patch] Microsoft Extension - #pragma message

Chris Lattner clattner at apple.com
Tue Jun 22 22:52:41 PDT 2010


On Jun 19, 2010, at 6:25 AM, Michael Spencer wrote:

> I implemented this rather simple extension to get more familiar with
> the code base. It differs from the MSVC implementation because of the
> way clang handles diagnostics. MSVC simply prints _exactly_ what's in
> the quoted string to the standard output with a new line at the end.
> Because this behavior does not fit in well with the way clang handles
> diagnostics, I added a new warning that prints out the quoted string.
> This should not {a,e}ffect the correctness of any code, but still
> provides the intended functionality.

Hi Michael,

Thanks for working on this.  This looks good with two minor changes: 

1) please drop the testcase into the Lex directory instead of making a new MicrosoftExtensions directory for it.  The MS testcases can be found by grepping for ms-extensions.

2) Though it almost certainly isn't a performance issue, for code cleanliness, please change "PragmaMessage" to take a StringRef by value instead of taking a std::string.  This will allow PP::HandlePragmaMessage to pass the string directly from the literal parser instead of indirecting through the std::string.

Thanks again,

-Chris



More information about the cfe-dev mailing list