llvm-project/clang/test/Preprocessor
Eli Friedman 2b680b43e9 Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more 
readable, and also reflects what we want to consider as an extension 
more accurately.  Specifically, it makes the "what is a keyword" 
determination accurately reflect whether the keyword is a GNU or 
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful 
because the classification of the aliases is mostly unrelated to the 
classification of the original keyword.

This patch treats anything that's in the implementation 
namespace (prefixed with "__", or "_X" where "X" is any upper-case 
letter) as a keyword without marking it as an extension.  This is 
consistent with the standards in that an implementation is allowed to define 
arbitrary extensions in the implementation namespace without violating 
the standard. This gets rid of all the nasty "extension used" warnings 
for stuff like __attribute__ in -pedantic mode.  We still warn for 
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we 
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option; 
such an extension isn't supported on any other C implementation, so I 
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we 
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up 
commit.

llvm-svn: 70281
2009-04-28 03:13:54 +00:00
..
_Pragma-dependency.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
_Pragma-location.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
_Pragma-physloc.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
_Pragma-syshdr.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
_Pragma-syshdr2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
assembler-with-cpp.c fix rdar://6804322 by wiring up -fdollars-in-identifiers 2009-04-19 07:00:02 +00:00
builtin_line.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
c90.c this is really just a recommendation, not a requirement. 2009-04-18 02:25:14 +00:00
c99-6_10_3_3_p4.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
c99-6_10_3_4_p5.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
c99-6_10_3_4_p6.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
c99-6_10_3_4_p7.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
c99-6_10_3_4_p9.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
clang_headers.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
comment_save.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
comment_save_if.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
comment_save_macro.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_and.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_bitand.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_bitor.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_compl.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_not.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_not_eq.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_oper_keyword.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_oper_spelling.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_or.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_true.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
cxx_xor.cpp Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
disabled-cond-diags.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
dump-options.c Implement support for GCC's -dD mode, which dumps -E output *and* 2009-04-12 01:56:53 +00:00
dump_macros.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
dumptokens_phyloc.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
expr_comma.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
expr_invalid_tok.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
expr_liveness.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
expr_usual_conversions.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
extension-warning.c Simplify the scheme used for keywords, and change the classification 2009-04-28 03:13:54 +00:00
file_to_include.h utility file 2006-06-18 07:18:04 +00:00
function_macro_file.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
function_macro_file.h Correctly respect C99 5.1.1.2p4 when searching for the first '(' of 2007-07-19 00:07:36 +00:00
hash_line.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
hash_space.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
header_lookup1.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
if_warning.c Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo 2009-04-19 22:07:21 +00:00
ifdef-recover.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
import_self.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
include-directive1.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
include-directive2.c Fix two problems from PR3916, and one problem I noticed while hacking 2009-04-17 23:56:52 +00:00
include-directive3.c use doug's new %S thing to make this work when run from different locations. 2009-04-10 16:51:32 +00:00
include-macros.c use doug's new %S thing to make this work when run from different locations. 2009-04-10 16:51:32 +00:00
include-pth.c Pull clang-cc code for generating PTH files based on the input type. 2009-04-01 05:09:09 +00:00
indent_macro.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
line-directive.c Change our silencing of C typedef redefinition handling to what we had 2009-04-27 01:46:12 +00:00
macro-multiline.c implement rdar://6762183. I'm not sure if it is more insane that 2009-04-07 06:02:44 +00:00
macro_arg_keyword.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_disable.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_disable2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_disable3.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_disable4.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_expand.c fix PR3927 by being more careful about the pp test for identifier. 2009-04-18 06:44:18 +00:00
macro_expandloc.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_expandloc2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn.c fix rdar://6816766 - Crash with function-like macro test at end of directive. 2009-04-24 07:15:46 +00:00
macro_fn_comma_swallow.c fix PR3880, fixing a comma swallowing bug handling macros that only take 2009-03-25 21:08:24 +00:00
macro_fn_disable_expand.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_lparen_scan.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_lparen_scan2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_placemarker.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_preexpand.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_varargs_iso.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_fn_varargs_named.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_misc.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_not_define.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_bad.c move token paste poisoning diagnostics to after the instantiation loc 2009-04-19 20:29:42 +00:00
macro_paste_bcpl_comment.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_c_block_comment.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_commaext.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_empty.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_hard.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_hashhash.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_mscomment.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_none.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_simple.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_paste_spacing.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_rescan.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_rescan2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_rescan_varargs.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_rparen_scan.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_rparen_scan2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
macro_space.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
mi_opt.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
mi_opt.h Fix a nasty corner case that Neil noticed in PR1900, where we would 2008-01-07 19:50:27 +00:00
objc-pp.m pick a smaller header, one that we control to test this. 2009-04-19 20:18:57 +00:00
optimize.c More fixes to builtin preprocessor defines. 2009-04-08 18:03:55 +00:00
output_paste_avoid.c apply Eli's patch to fix PR4008, with a testcase. Thanks Eli! 2009-04-21 23:28:41 +00:00
pic.c Force triple for these tests. 2009-04-08 23:02:51 +00:00
pr2086.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
pr2086.h Fix PR2086. 2008-02-25 19:03:15 +00:00
pragma_microsoft.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
pragma_poison.c rename test for consistency with other pragma test. 2009-04-19 20:16:27 +00:00
pragma_unknown.c Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't 2009-04-19 21:55:32 +00:00
print_line_track.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
skipping_unclean.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
stringize_misc.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
stringize_space.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
stringize_space2.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
undef-error.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00
unterminated.c Rename clang to clang-cc. 2009-03-24 02:24:46 +00:00