summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/inline.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-04-28 03:13:54 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-04-28 03:13:54 +0000
commit2b680b43e9cfcdc22cbeecaedbe12687169fd744 (patch)
tree642c9c6055037c6eea7a95c291afc8c53090d145 /clang/test/CodeGen/inline.c
parent49936f76ecfe2202393dfd4ea237aff3ba29dbf0 (diff)
downloadbcm5719-llvm-2b680b43e9cfcdc22cbeecaedbe12687169fd744.tar.gz
bcm5719-llvm-2b680b43e9cfcdc22cbeecaedbe12687169fd744.zip
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
Diffstat (limited to 'clang/test/CodeGen/inline.c')
-rw-r--r--clang/test/CodeGen/inline.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/test/CodeGen/inline.c b/clang/test/CodeGen/inline.c
index 6011f42f9cf..7bdf76de19b 100644
--- a/clang/test/CodeGen/inline.c
+++ b/clang/test/CodeGen/inline.c
@@ -32,34 +32,34 @@
// RUN: grep "define void @_Z10gnu_inlinev()" %t &&
// RUN: grep "define available_externally void @_Z13gnu_ei_inlinev()" %t
-extern inline int ei() { return 123; }
+extern __inline int ei() { return 123; }
-inline int foo() {
+__inline int foo() {
return ei();
}
int bar() { return foo(); }
-inline void unreferenced1() {}
-extern inline void unreferenced2() {}
+__inline void unreferenced1() {}
+extern __inline void unreferenced2() {}
__inline __attribute((__gnu_inline__)) void gnu_inline() {}
// PR3988
-extern inline __attribute__((gnu_inline)) void gnu_ei_inline() {}
+extern __inline __attribute__((gnu_inline)) void gnu_ei_inline() {}
void (*P)() = gnu_ei_inline;
// <rdar://problem/6818429>
int test1();
-inline int test1() { return 4; }
-inline int test2() { return 5; }
-inline int test2();
+__inline int test1() { return 4; }
+__inline int test2() { return 5; }
+__inline int test2();
int test2();
void test_test1() { test1(); }
void test_test2() { test2(); }
// PR3989
-extern inline void test3() __attribute__((gnu_inline));
-inline void test3() {}
+extern __inline void test3() __attribute__((gnu_inline));
+__inline void test3() {}
OpenPOWER on IntegriCloud