This is an archive of the discontinued LLVM Phabricator instance.

Generalize future keyword compat diagnostics
ClosedPublic

Authored by hubert.reinterpretcast on May 13 2015, 8:07 AM.

Details

Summary

This, in preparation for the introduction of more new keywords in the
implementation of the C++ language, generalizes the support for future
keyword compat diagnostics (e.g., diag::warn_cxx11_keyword) by
extending the applicability of the relevant property in
IdentifierTable with appropriate renaming.

The code in the preprocessor which generates diag::warn_cxx11_keyword
is updated to choose an appropriate message based on the TokenKind
database, which has in turn been modified for easy selection of the
relevant keywords.

Diff Detail

Event Timeline

hubert.reinterpretcast retitled this revision from to Generalize future keyword compat diagnostics.
hubert.reinterpretcast updated this object.
hubert.reinterpretcast edited the test plan for this revision. (Show Details)
hubert.reinterpretcast added a subscriber: Unknown Object (MLST).
rsmith edited edge metadata.May 13 2015, 6:22 PM

LGTM with a minor tweak.

lib/Lex/Preprocessor.cpp
596–597

It would be better to use a [StringSwitch](http://llvm.org/docs/doxygen/html/classllvm_1_1StringSwitch.html) here (and generate one .Case(#NAME, diag::warn_cxx11_keyword per CXX11_KEYWORD) rather than doing an IdentifierTable lookup for each keyword.

hubert.reinterpretcast edited edge metadata.

Use StringSwitch instead of IdentifierTable lookup

rsmith accepted this revision.May 13 2015, 9:04 PM
rsmith edited edge metadata.
This revision is now accepted and ready to land.May 13 2015, 9:04 PM
rsmith closed this revision.May 13 2015, 9:04 PM

Thanks, committed as r237332.