Reid Kleckner
078aea9043
Store decls in prototypes on the declarator instead of in the AST
...
This saves two pointers from FunctionDecl that were being used for some
rare and questionable C-only functionality. The DeclsInPrototypeScope
ArrayRef was added in r151712 in order to parse this kind of C code:
enum e {x, y};
int f(enum {y, x} n) {
return x; // should return 1, not 0
}
The challenge is that we parse 'int f(enum {y, x} n)' it its own
function prototype scope that gets popped before we build the
FunctionDecl for 'f'. The original change was doing two questionable
things:
1. Saving all tag decls introduced in prototype scope on a TU-global
Sema variable. This is problematic when you have cases like this, where
'x' and 'y' shouldn't be visible in 'f':
void f(void (*fp)(enum { x, y } e)) { /* no x */ }
This patch fixes that, so now 'f' can't see 'x', which is consistent
with GCC.
2. Storing the decls in FunctionDecl in ActOnFunctionDeclarator so that
they could be used in ActOnStartOfFunctionDef. This is just an
inefficient way to move information around. The AST lives forever, but
the list of non-parameter decls in prototype scope is short lived.
Moving these things to the Declarator solves both of these issues.
Reviewers: rsmith
Subscribers: jmolloy, cfe-commits
Differential Revision: https://reviews.llvm.org/D27279
llvm-svn: 289225
2016-12-09 17:14:05 +00:00
..
2014-02-21 21:41:23 +00:00
2015-04-28 22:58:25 +00:00
2016-05-09 08:52:33 +00:00
2015-07-26 09:02:26 +00:00
2013-12-08 18:49:05 +00:00
2013-12-08 22:22:31 +00:00
2013-12-08 22:22:31 +00:00
2013-12-08 22:22:31 +00:00
2014-04-17 12:51:36 +00:00
2014-04-17 12:51:36 +00:00
2016-11-18 21:00:08 +00:00
2016-05-11 18:38:21 +00:00
2012-10-19 12:44:48 +00:00
2016-08-17 06:52:15 +00:00
2016-11-14 08:53:27 +00:00
2015-01-21 01:30:40 +00:00
2014-10-02 21:21:25 +00:00
2012-10-19 12:44:48 +00:00
2015-04-21 17:26:18 +00:00
2013-08-08 19:53:46 +00:00
2015-01-21 10:54:38 +00:00
2013-02-01 08:25:07 +00:00
2013-07-30 01:31:03 +00:00
2014-10-20 23:26:58 +00:00
2015-04-11 01:53:13 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2014-08-22 06:05:21 +00:00
2014-07-23 12:57:31 +00:00
2016-07-12 17:38:50 +00:00
2014-08-26 12:48:11 +00:00
2016-04-28 11:29:08 +00:00
2013-12-08 15:24:55 +00:00
2014-08-05 11:07:26 +00:00
2016-09-15 08:55:41 +00:00
2012-10-19 12:44:48 +00:00
2015-06-23 21:10:24 +00:00
2014-06-17 13:11:27 +00:00
2016-04-29 15:03:32 +00:00
2016-11-18 21:00:08 +00:00
2015-07-14 20:08:49 +00:00
2014-10-20 23:26:58 +00:00
2013-07-16 07:14:18 +00:00
2015-12-11 21:28:55 +00:00
2016-02-03 11:32:08 +00:00
2012-10-19 12:44:48 +00:00
2015-04-11 01:53:13 +00:00
2015-06-09 14:30:17 +00:00
2016-03-18 21:35:59 +00:00
2015-08-19 21:33:54 +00:00
2014-07-21 18:01:53 +00:00
2016-11-23 16:57:03 +00:00
2013-05-28 17:37:39 +00:00
2016-04-11 07:48:59 +00:00
2016-03-02 06:48:47 +00:00
2013-07-23 19:37:19 +00:00
2015-03-03 18:28:38 +00:00
2015-11-02 21:14:48 +00:00
2013-12-18 23:30:06 +00:00
2016-06-28 20:55:30 +00:00
2016-05-06 21:04:01 +00:00
2015-11-02 21:14:48 +00:00
2016-08-16 17:44:11 +00:00
2014-10-27 12:37:26 +00:00
2015-09-29 16:24:18 +00:00
2013-12-18 23:30:06 +00:00
2015-11-10 21:28:44 +00:00
2013-12-18 23:30:06 +00:00
2016-04-27 19:53:03 +00:00
2015-11-13 00:42:21 +00:00
2013-09-09 12:57:20 +00:00
2015-10-08 06:31:22 +00:00
2015-02-19 22:32:33 +00:00
2016-04-11 10:16:37 +00:00
2015-06-29 17:29:50 +00:00
2012-11-01 23:55:47 +00:00
2016-02-02 13:50:39 +00:00
2015-11-19 10:13:11 +00:00
2016-05-09 08:52:33 +00:00
2014-10-27 12:37:26 +00:00
2016-09-13 07:02:02 +00:00
2015-02-03 22:35:58 +00:00
2016-06-16 00:42:36 +00:00
2014-02-22 16:59:24 +00:00
2013-07-23 19:30:11 +00:00
2014-10-27 12:37:26 +00:00
2013-07-23 19:30:11 +00:00
2015-11-10 21:28:44 +00:00
2016-01-03 15:55:40 +00:00
2016-06-28 20:55:30 +00:00
2013-07-30 14:10:17 +00:00
2013-07-23 19:30:11 +00:00
2016-11-11 16:51:40 +00:00
2016-08-18 18:45:07 +00:00
2015-09-04 21:49:21 +00:00
2016-10-12 18:59:24 +00:00
2015-06-12 20:13:50 +00:00
2013-07-30 01:31:03 +00:00
2016-12-01 17:52:39 +00:00
2013-07-23 19:30:11 +00:00
2013-12-26 17:30:44 +00:00
2013-09-09 15:08:57 +00:00
2013-01-16 23:11:15 +00:00
2016-01-15 04:06:31 +00:00
2015-11-12 21:42:39 +00:00
2014-07-23 12:57:31 +00:00
2016-02-19 11:23:28 +00:00
2016-05-16 17:22:25 +00:00
2012-10-19 12:44:48 +00:00
2016-08-05 02:39:30 +00:00
2013-06-08 18:51:21 +00:00
2015-04-11 01:53:13 +00:00
2014-07-11 20:53:51 +00:00
2012-10-19 12:44:48 +00:00
2015-08-19 21:33:54 +00:00
2012-10-19 12:44:48 +00:00
2016-10-31 18:07:57 +00:00
2014-09-26 05:04:30 +00:00
2015-04-06 13:22:01 +00:00
2016-02-15 10:44:27 +00:00
2014-04-17 12:51:42 +00:00
2015-06-29 21:00:05 +00:00
2016-06-15 16:08:13 +00:00
2016-06-27 19:40:41 +00:00
2016-10-14 20:43:37 +00:00
2014-04-17 12:51:36 +00:00
2014-07-02 12:56:02 +00:00
2014-08-13 19:18:20 +00:00
2014-07-02 12:56:02 +00:00
2013-10-29 12:32:58 +00:00
2016-06-17 00:59:41 +00:00
2012-10-19 12:44:48 +00:00
2014-04-16 08:06:33 +00:00
2015-10-29 20:48:01 +00:00
2015-03-30 19:40:59 +00:00
2016-10-12 17:28:44 +00:00
2016-09-23 04:48:31 +00:00
2014-10-02 20:53:50 +00:00
2016-07-21 23:03:43 +00:00
2014-07-02 07:07:20 +00:00
2014-12-12 23:41:25 +00:00
2016-05-17 17:33:31 +00:00
2015-11-25 09:24:26 +00:00
2013-08-30 04:39:01 +00:00
2013-08-30 04:39:01 +00:00
2015-01-28 20:24:52 +00:00
2013-05-09 19:17:11 +00:00
2015-10-08 07:45:35 +00:00
2012-11-02 01:40:23 +00:00
2013-05-29 21:50:46 +00:00
2012-10-19 12:44:48 +00:00
2013-03-15 21:50:10 +00:00
2013-02-02 02:14:45 +00:00
2015-02-04 21:50:20 +00:00
2012-10-19 12:44:48 +00:00
2016-10-31 21:56:26 +00:00
2012-10-19 12:44:48 +00:00
2015-12-08 03:21:47 +00:00
2012-10-19 12:44:48 +00:00
2014-07-07 15:53:44 +00:00
2012-10-19 12:44:48 +00:00
2016-09-23 08:27:24 +00:00
2014-07-24 14:51:23 +00:00
2014-04-07 16:32:54 +00:00
2013-09-18 03:29:45 +00:00
2013-12-08 22:37:30 +00:00
2015-04-25 20:20:04 +00:00
2012-10-19 12:44:48 +00:00
2016-01-07 09:04:46 +00:00
2016-12-09 17:14:05 +00:00
2014-05-19 18:15:42 +00:00
2014-11-03 21:56:03 +00:00
2013-11-13 06:57:53 +00:00
2015-06-10 00:27:52 +00:00
2016-07-15 20:41:10 +00:00
2016-11-29 22:31:00 +00:00
2014-01-14 19:35:09 +00:00
2013-06-08 13:29:58 +00:00
2016-02-18 06:49:31 +00:00
2016-08-12 04:12:31 +00:00
2013-08-08 01:50:23 +00:00
2012-10-19 12:44:48 +00:00
2015-10-08 06:31:22 +00:00
2013-02-02 02:14:45 +00:00
2014-12-17 21:57:17 +00:00
2014-12-17 21:57:17 +00:00
2015-11-11 02:02:15 +00:00
2016-01-28 01:38:18 +00:00
2016-07-22 18:49:43 +00:00
2015-09-15 00:21:56 +00:00
2013-08-13 18:18:50 +00:00
2016-05-09 08:52:33 +00:00
2015-10-08 08:28:09 +00:00
2012-10-19 12:44:48 +00:00
2014-07-19 01:39:17 +00:00
2014-07-19 01:39:17 +00:00
2014-05-31 04:12:14 +00:00
2016-08-20 16:51:33 +00:00
2014-07-16 15:12:48 +00:00
2016-03-15 20:56:38 +00:00
2016-04-26 23:19:00 +00:00
2014-09-07 04:03:21 +00:00
2014-09-07 03:03:51 +00:00
2014-07-16 15:12:48 +00:00
2014-07-19 01:39:17 +00:00
2016-03-29 18:38:44 +00:00
2013-02-20 22:28:41 +00:00
2016-09-22 00:00:26 +00:00
2013-09-16 23:59:35 +00:00
2015-10-08 08:28:09 +00:00
2015-01-28 14:48:39 +00:00
2016-09-02 13:45:40 +00:00
2013-01-17 00:26:13 +00:00
2014-08-16 08:29:27 +00:00
2013-09-18 23:23:17 +00:00
2012-10-26 07:02:46 +00:00
2015-03-25 10:38:50 +00:00
2014-01-15 09:08:07 +00:00
2014-07-11 20:53:51 +00:00
2016-01-06 14:35:46 +00:00
2014-04-02 05:48:29 +00:00
2016-09-14 21:19:43 +00:00
2016-10-04 22:29:49 +00:00
2016-07-18 20:37:06 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2013-07-16 22:40:53 +00:00
2016-10-20 00:01:36 +00:00
2015-02-04 00:27:13 +00:00
2015-11-19 22:11:58 +00:00
2015-07-14 18:08:50 +00:00
2015-07-20 12:08:00 +00:00
2014-08-22 06:05:21 +00:00
2016-07-14 22:22:58 +00:00
2012-10-19 12:44:48 +00:00
2016-04-11 20:37:04 +00:00
2015-11-10 21:28:44 +00:00
2016-05-11 18:38:21 +00:00
2013-02-07 18:32:25 +00:00
2014-05-11 16:06:11 +00:00
2012-10-19 12:44:48 +00:00
2016-05-04 21:08:13 +00:00
2016-05-04 21:08:13 +00:00
2014-01-16 02:37:08 +00:00
2014-01-23 15:05:00 +00:00
2012-10-19 12:44:48 +00:00
2015-04-02 22:10:06 +00:00
2013-01-30 01:12:44 +00:00
2012-11-29 16:09:03 +00:00
2015-02-26 19:43:46 +00:00
2012-10-05 19:46:32 +00:00
2015-07-26 01:48:59 +00:00
2013-05-22 23:25:32 +00:00
2016-09-03 03:25:22 +00:00
2013-10-24 01:07:54 +00:00
2013-01-16 17:10:28 +00:00
2015-11-27 18:03:44 +00:00
2012-10-19 12:44:48 +00:00
2015-07-14 20:08:49 +00:00
2013-08-30 04:39:01 +00:00
2015-08-19 22:42:36 +00:00
2015-08-19 22:42:36 +00:00
2012-10-19 12:44:48 +00:00
2013-01-24 20:24:34 +00:00
2015-05-26 19:44:52 +00:00
2013-12-03 06:13:01 +00:00
2013-12-14 01:07:05 +00:00
2016-08-16 09:45:36 +00:00
2013-09-16 18:07:35 +00:00
2014-03-29 15:09:45 +00:00
2013-04-17 21:05:20 +00:00
2012-09-26 09:02:07 +00:00
2016-10-28 08:28:42 +00:00
2015-10-09 00:17:57 +00:00
2016-06-15 05:18:39 +00:00
2013-02-27 00:46:06 +00:00
2016-11-10 23:28:17 +00:00
2013-07-16 07:14:18 +00:00
2013-05-15 00:44:06 +00:00
2013-06-07 22:07:20 +00:00
2016-09-02 22:59:57 +00:00
2012-10-19 12:44:48 +00:00
2015-12-13 05:41:41 +00:00
2014-10-28 04:37:34 +00:00
2016-09-02 22:59:57 +00:00
2012-11-27 02:58:49 +00:00
2015-07-16 01:06:17 +00:00
2012-11-15 01:21:59 +00:00
2015-03-12 14:28:38 +00:00
2016-02-10 11:23:48 +00:00
2016-09-16 17:42:02 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2015-06-08 21:59:59 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2013-04-17 08:06:46 +00:00
2015-05-26 19:44:52 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2012-10-19 12:44:48 +00:00
2012-10-04 02:36:51 +00:00
2014-01-16 02:37:08 +00:00
2015-04-01 23:32:03 +00:00
2014-07-18 00:13:16 +00:00
2015-12-03 11:37:28 +00:00
2016-06-16 21:39:55 +00:00
2016-03-16 18:00:46 +00:00
2015-01-13 10:14:57 +00:00
2015-07-17 04:21:51 +00:00
2016-06-10 21:51:18 +00:00
2014-04-03 23:06:35 +00:00
2012-10-19 12:44:48 +00:00
2014-03-07 07:14:36 +00:00
2014-09-06 00:24:58 +00:00
2014-11-13 23:19:36 +00:00
2016-08-12 11:22:12 +00:00
2015-10-08 08:28:09 +00:00
2015-01-06 20:34:47 +00:00
2015-04-20 20:00:49 +00:00
2014-08-27 04:59:42 +00:00
2013-04-03 09:46:04 +00:00
2014-02-26 02:36:06 +00:00
2012-10-05 19:46:32 +00:00
2014-10-24 17:42:17 +00:00
2015-06-10 15:18:23 +00:00
2013-05-15 11:03:04 +00:00
2014-12-15 20:22:33 +00:00
2012-10-19 12:44:48 +00:00
2015-07-14 20:08:49 +00:00
2014-05-14 07:54:17 +00:00
2015-12-03 16:03:34 +00:00
2012-10-19 12:44:48 +00:00
2015-12-08 03:21:47 +00:00
2014-08-04 00:40:48 +00:00
2012-08-28 04:13:54 +00:00
2014-06-18 23:26:25 +00:00
2015-08-27 18:49:15 +00:00
2015-07-14 20:52:32 +00:00
2014-05-01 23:19:06 +00:00
2012-10-19 12:44:48 +00:00
2016-10-06 09:47:29 +00:00
2012-10-19 12:44:48 +00:00
2014-04-25 20:41:38 +00:00
2013-12-18 23:30:06 +00:00
2015-07-14 20:08:49 +00:00
2016-07-29 00:55:40 +00:00
2013-01-24 20:50:13 +00:00
2013-01-24 20:50:46 +00:00
2013-02-15 20:09:55 +00:00
2012-09-12 05:53:43 +00:00
2012-10-19 12:44:48 +00:00
2013-01-12 00:54:16 +00:00
2016-03-07 22:44:55 +00:00
2012-10-19 12:44:48 +00:00
2015-07-14 20:08:49 +00:00
2013-01-08 01:50:40 +00:00
2015-09-17 20:55:33 +00:00
2015-09-17 20:55:33 +00:00
2016-04-24 13:30:21 +00:00
2016-09-15 18:07:51 +00:00
2012-10-19 12:44:48 +00:00
2014-03-18 17:55:18 +00:00
2016-10-19 12:06:10 +00:00
2014-04-25 20:41:38 +00:00
2016-09-30 22:19:38 +00:00
2014-04-25 20:41:38 +00:00
2014-04-25 20:41:38 +00:00
2013-06-25 22:37:05 +00:00
2015-04-07 22:08:51 +00:00
2014-07-11 20:53:51 +00:00
2015-11-15 03:04:34 +00:00
2012-08-17 20:23:06 +00:00
2014-05-20 17:31:11 +00:00
2016-11-30 19:42:03 +00:00
2014-11-21 21:03:10 +00:00
2014-07-16 15:12:48 +00:00
2016-01-03 15:55:40 +00:00
2015-03-17 18:03:42 +00:00
2016-10-25 10:06:11 +00:00
2016-08-25 17:09:33 +00:00
2013-06-24 04:41:32 +00:00
2016-04-29 17:44:29 +00:00
2013-04-07 14:10:40 +00:00
2015-08-14 14:13:29 +00:00
2012-10-19 12:44:48 +00:00
2015-08-19 21:33:54 +00:00
2014-07-02 12:55:58 +00:00
2016-11-29 01:35:17 +00:00
2015-04-23 16:12:42 +00:00
2012-12-18 01:29:20 +00:00
2014-01-16 02:37:08 +00:00
2014-02-11 17:53:22 +00:00
2013-12-05 23:06:53 +00:00
2015-10-01 18:47:52 +00:00
2012-07-25 07:26:32 +00:00
2013-10-08 00:03:41 +00:00
2013-10-08 00:03:41 +00:00
2015-03-26 21:37:49 +00:00
2013-03-29 21:43:21 +00:00
2015-09-24 01:34:27 +00:00
2016-12-07 10:52:18 +00:00
2016-12-07 10:52:18 +00:00
2015-05-20 23:29:18 +00:00
2014-07-16 15:12:48 +00:00
2015-05-20 23:29:18 +00:00
2015-09-29 15:25:51 +00:00
2013-01-02 21:12:03 +00:00
2013-11-25 18:50:49 +00:00
2012-11-03 16:07:49 +00:00
2014-05-05 19:53:42 +00:00
2014-12-03 21:00:20 +00:00
2015-06-18 21:09:24 +00:00
2013-11-15 22:45:29 +00:00
2013-07-04 16:16:58 +00:00
2014-12-17 21:57:17 +00:00
2013-03-28 21:46:45 +00:00
2013-10-22 21:56:29 +00:00
2013-01-23 20:02:51 +00:00
2016-05-16 17:22:25 +00:00
2012-10-19 12:44:48 +00:00
2015-07-08 01:00:30 +00:00
2015-02-07 01:37:09 +00:00
2016-07-13 22:32:15 +00:00
2016-07-13 22:32:15 +00:00
2015-08-15 15:23:14 +00:00