Go to file
Reid Kleckner c2fd352963 [Sema] Make getCurFunction() return null outside function parsing
Summary:
Before this patch, Sema pre-allocated a FunctionScopeInfo and kept it in
the first, always present element of the FunctionScopes stack. This
meant that Sema::getCurFunction would return a pointer to this
pre-allocated object when parsing code outside a function body. This is
pretty much always a bug, so this patch moves the pre-allocated object
into a separate unique_ptr. This should make bugs like PR36536 a lot
more obvious.

As you can see from this patch, there were a number of places that
unconditionally assumed they were always called inside a function.
However, there are also many places that null checked the result of
getCurFunction(), so I think this is a reasonable direction.

Reviewers: rsmith

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D44039

llvm-svn: 326965
2018-03-08 00:14:34 +00:00
clang [Sema] Make getCurFunction() return null outside function parsing 2018-03-08 00:14:34 +00:00
clang-tools-extra [Documentation] Fix Clang-tidy checks list broken in r326909. 2018-03-07 22:30:50 +00:00
compiler-rt [sanitizer] Fix SANITIZER_INTERCEPT_MMAP and SANITIZER_INTERCEPT_MMAP64 values 2018-03-07 19:43:50 +00:00
debuginfo-tests [Darwin] Specify DWARF 2/4 when running apple accelerator tests. 2018-02-26 20:56:45 +00:00
libclc lgamma_r: Move code from .inc to .cl file 2018-03-06 17:48:47 +00:00
libcxx Include <system_error> since we use it. Thanks to Andrey Maksimov for the catch. 2018-03-07 22:51:16 +00:00
libcxxabi [demangler] Fix a mistake in r326797. 2018-03-07 04:29:33 +00:00
libunwind [libunwind][MIPS]: Add support for unwinding in N32 processes. 2018-02-27 21:24:02 +00:00
lld [ELF] Update test/ELF/eh-frame-hdr-augmentation.s 2018-03-07 21:25:58 +00:00
lldb [lldbtestsuite] llvm-objcopy is now required to run the lit tests. 2018-03-07 18:06:12 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm Fix build broken by r326959 2018-03-08 00:07:26 +00:00
openmp [OpenMP] Remove implicit data sharing using device shared memory from libomptarget 2018-03-07 22:10:10 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [Polly][CMake] Fix lit setup for building the in the mono repo 2018-03-05 14:43:04 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.