Fix some warnings found by ToT clang

These fall into two categories:
- unused variables
- (uint8_t *)NULL + X -- changed to reinterpret_cast(X)

llvm-svn: 317270
diff --git a/lldb/include/lldb/Core/RangeMap.h b/lldb/include/lldb/Core/RangeMap.h
index e37dcd7..91fd409 100644
--- a/lldb/include/lldb/Core/RangeMap.h
+++ b/lldb/include/lldb/Core/RangeMap.h
@@ -975,7 +975,6 @@
 #endif
 
     if (!m_entries.empty()) {
-      typename Collection::const_iterator pos;
       for (const auto &entry : m_entries) {
         if (entry.Contains(addr))
           indexes.push_back(entry.data);
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp
index 0a704fd..6d610d5 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -139,7 +139,6 @@
       return;
     }
 
-    llvm::StringRef range_expr;
     Status error;
 
     std::tie(range_from, range_to) =
diff --git a/lldb/source/Core/FileSpecList.cpp b/lldb/source/Core/FileSpecList.cpp
index a69f490..d8c1151 100644
--- a/lldb/source/Core/FileSpecList.cpp
+++ b/lldb/source/Core/FileSpecList.cpp
@@ -49,7 +49,7 @@
 // contained a copy of "file_spec".
 //------------------------------------------------------------------
 bool FileSpecList::AppendIfUnique(const FileSpec &file_spec) {
-  collection::iterator pos, end = m_files.end();
+  collection::iterator end = m_files.end();
   if (find(m_files.begin(), end, file_spec) == end) {
     m_files.push_back(file_spec);
     return true;
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 3f0f9ea..9eb5a49 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -535,7 +535,7 @@
             "trying to read from host address of 0.");
         return error;
       }
-      memcpy(dst, (uint8_t *)NULL + address, byte_size);
+      memcpy(dst, reinterpret_cast<uint8_t *>(address), byte_size);
     } else if ((address_type == eAddressTypeLoad) ||
                (address_type == eAddressTypeFile)) {
       if (file_so_addr.IsValid()) {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
index 5ac6b19..105c088 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -324,8 +324,6 @@
 
     clang::ASTContext &ast_ctx(interface_decl->getASTContext());
 
-    clang::QualType return_qual_type;
-
     const bool isInstance = instance;
     const bool isVariadic = false;
     const bool isSynthesized = false;
diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
index f907735..e977307 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
@@ -85,8 +85,6 @@
   if (process == NULL)
     return 0;
 
-  std::pair<lldb::addr_t, lldb::addr_t> fp_pc_pair;
-
   struct Frame_i386 {
     uint32_t fp;
     uint32_t pc;
@@ -179,8 +177,6 @@
 
   StackFrame *first_frame = exe_ctx.GetFramePtr();
 
-  std::pair<lldb::addr_t, lldb::addr_t> fp_pc_pair;
-
   struct Frame_x86_64 {
     uint64_t fp;
     uint64_t pc;
diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp
index e3880af..16bb534 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -997,7 +997,7 @@
       if (addr == 0)
         return false;
       // The address is an address in this process, so just copy it
-      memcpy(dst, (uint8_t *)nullptr + addr, byte_size);
+      memcpy(dst, reinterpret_cast<uint8_t *>(addr), byte_size);
       return true;
     } else {
       Process *process = nullptr;
diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp
index 53d9c5c..53bf3e8 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -404,7 +404,7 @@
       // The address is an address in this process, so just copy it
       if (addr == 0)
         return false;
-      memcpy(dst, (uint8_t *)nullptr + addr, byte_size);
+      memcpy(dst, reinterpret_cast<uint8_t *>(addr), byte_size);
       return true;
     } else {
       if (exe_ctx) {
diff --git a/lldb/source/Target/PathMappingList.cpp b/lldb/source/Target/PathMappingList.cpp
index b834a36..782c6e4 100644
--- a/lldb/source/Target/PathMappingList.cpp
+++ b/lldb/source/Target/PathMappingList.cpp
@@ -85,7 +85,6 @@
 bool PathMappingList::Replace(const ConstString &path,
                               const ConstString &replacement, uint32_t index,
                               bool notify) {
-  iterator insert_iter;
   if (index >= m_pairs.size())
     return false;
   ++m_mod_id;
diff --git a/lldb/source/Utility/UriParser.cpp b/lldb/source/Utility/UriParser.cpp
index 5023aa0..a6d81e7 100644
--- a/lldb/source/Utility/UriParser.cpp
+++ b/lldb/source/Utility/UriParser.cpp
@@ -22,7 +22,7 @@
 bool UriParser::Parse(llvm::StringRef uri, llvm::StringRef &scheme,
                       llvm::StringRef &hostname, int &port,
                       llvm::StringRef &path) {
-  llvm::StringRef tmp_scheme, tmp_hostname, tmp_port, tmp_path;
+  llvm::StringRef tmp_scheme, tmp_hostname, tmp_path;
 
   const llvm::StringRef kSchemeSep("://");
   auto pos = uri.find(kSchemeSep);