forked from OSchip/llvm-project
078aea9043
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 |
||
---|---|---|
.. | ||
Inputs | ||
amdgcn.languageOptsOpenCL.cl | ||
ast-dump-arm-attr.c | ||
ast-dump-attr.cpp | ||
ast-dump-color.cpp | ||
ast-dump-comment.cpp | ||
ast-dump-decl.c | ||
ast-dump-decl.cpp | ||
ast-dump-decl.m | ||
ast-dump-decl.mm | ||
ast-dump-invalid.cpp | ||
ast-dump-lookups.cpp | ||
ast-dump-msp430-attr.c | ||
ast-dump-pipe.cl | ||
ast-dump-stmt.c | ||
ast-dump-stmt.cpp | ||
ast-dump-stmt.m | ||
ast-dump-templates.cpp | ||
ast-dump-wchar.cpp | ||
ast-print-char-literal.cpp | ||
ast-print-objectivec.m | ||
ast-print-pragmas-xfail.cpp | ||
ast-print-pragmas.cpp | ||
attr-source-range.cpp | ||
backend-optimization-failure-nodbg.cpp | ||
backend-optimization-failure.cpp | ||
backend-resource-limit-diagnostics.cl | ||
backend-stack-frame-diagnostics-fallback.cpp | ||
backend-stack-frame-diagnostics.cpp | ||
caret-diags-macros.c | ||
caret-diags-scratch-buffer.c | ||
cc1as-asm.s | ||
dev-fd-fs.c | ||
diag-aka-types.cpp | ||
diag-format.c | ||
diag-line-wrapping.cpp | ||
diag-macro-backtrace.c | ||
diag-macro-backtrace2.c | ||
diag-mapping.c | ||
diag-mapping2.c | ||
diag-null-bytes-in-line.cpp | ||
diag-presumed.c | ||
diag-special-chars.c | ||
diag-template-diffing-color.cpp | ||
diag-template-diffing-cxx98.cpp | ||
diag-template-diffing.cpp | ||
diag-trailing-null-bytes.cpp | ||
diag-verify.cpp | ||
diagnostic-crash.cpp | ||
driver-verify.c | ||
emit-html-insert.c | ||
emit-html.c | ||
error-limit-multiple-notes.cpp | ||
error-limit.c | ||
freebsd-arm-size_t.c | ||
include-stack-for-note-flag.cpp | ||
integer-literal-printing.cpp | ||
interpreter.c | ||
languageOptsOpenCL.cl | ||
macro-backtrace.c | ||
message-length.c | ||
nvptx.languageOptsOpenCL.cl | ||
permissions.cpp | ||
predefines.c | ||
r600.languageOptsOpenCL.cl | ||
reduced-diags-macros-backtrace.cpp | ||
reduced-diags-macros.cpp | ||
remap-file.c | ||
serialized-diags-driver.c | ||
serialized-diags-frontend.c | ||
serialized-diags-no-category.c | ||
serialized-diags-no-issue.c | ||
serialized-diags-really-long-text.cpp | ||
serialized-diags-single-issue.c | ||
serialized-diags-stable.c | ||
serialized-diags.c | ||
serialized-diags.h | ||
serialized-diags.m | ||
show-diag-options.c | ||
tabstop.c | ||
target-parser.c | ||
thinlto.c | ||
unnecessary-elipses.cpp | ||
unprintable.c | ||
verify.c | ||
warn-in-system-header.c | ||
warn-in-system-header.h | ||
warn-sysheader.cpp | ||
warning-flags-enabled.c | ||
warning-flags-tree.c | ||
warning-flags.c | ||
win32-macho.c | ||
working-directory.c | ||
wrong-encoding.c | ||
wrong-encoding2.c |