Ran the sources through the compiler with -Wshadow warnings
authorJason Molenda <jmolenda@apple.com>
Thu, 4 Oct 2012 22:47:07 +0000 (22:47 +0000)
committerJason Molenda <jmolenda@apple.com>
Thu, 4 Oct 2012 22:47:07 +0000 (22:47 +0000)
commitccd41e55f1cd1a2a99bd357076638954f419429a
tree7093042eeeef422e29e4448976973272005341ca
parentbfeb28087ae76b6c241a6dc1727429fe8f6f76a7
Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing

        Mutex::Locker(m_map_mutex);

This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately.  Instead,

        Mutex::Locker locker(m_map_mutex);

does what is intended.  For some reason -Wshadow happened to
highlight these as shadowed variables.

I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>

llvm-svn: 165269
17 files changed:
lldb/include/lldb/Core/FormatManager.h
lldb/include/lldb/Core/FormatNavigator.h
lldb/include/lldb/Core/ValueObject.h
lldb/source/API/SBDebugger.cpp
lldb/source/API/SBProcess.cpp
lldb/source/Breakpoint/BreakpointResolverName.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Core/Communication.cpp
lldb/source/Core/DataBufferMemoryMap.cpp
lldb/source/Core/FormatManager.cpp
lldb/source/Core/StreamCallback.cpp
lldb/source/Expression/ClangExpressionDeclMap.cpp
lldb/source/Interpreter/OptionValueFileSpecLIst.cpp
lldb/source/Interpreter/OptionValuePathMappings.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
lldb/source/Target/Process.cpp
lldb/source/Target/StopInfo.cpp