aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-01 23:15:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-01 23:15:13 +0000
commit9ea9bdbc14374f7bacdb50d3e52c664ff12150ff (patch)
tree26b4cdeaef74f71025025825a4f13b5fef0d9b44 /lib/CodeGen/Mangle.cpp
parent7bf3600f56342dc434dad994d0c71068e5d3b5c7 (diff)
Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we had a single set of maps in Sema (for the function) along with a stack of block scopes. However, this lead to funky behavior with nested functions, e.g., in the member functions of local classes. The explicit-stack approach is far cleaner, and we retain a 1-element cache so that we're not malloc/free'ing every time we enter a function. Fixes PR6382. Also, tweaked the unused-variable warning suppression logic to look at errors within a given Scope rather than within a given function. The prior code wasn't looking at the right number-of-errors count when dealing with blocks, since the block's count would be deallocated before we got to ActOnPopScope. This approach works with nested blocks/functions, and gives tighter error recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
0 files changed, 0 insertions, 0 deletions