summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-11-02 21:35:26 +0000
committerPavel Labath <labath@google.com>2017-11-02 21:35:26 +0000
commiteac00c3be67ffaf831bedabaeb1b558f49c4cec8 (patch)
tree708a17d065a0334fa16ece717f1acfc2ea76a418
parent1d02b13eb7758844adb9f1cec0828376f10d365a (diff)
downloadbcm5719-llvm-eac00c3be67ffaf831bedabaeb1b558f49c4cec8.tar.gz
bcm5719-llvm-eac00c3be67ffaf831bedabaeb1b558f49c4cec8.zip
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
-rw-r--r--lldb/include/lldb/Core/RangeMap.h1
-rw-r--r--lldb/source/Breakpoint/BreakpointIDList.cpp1
-rw-r--r--lldb/source/Core/FileSpecList.cpp2
-rw-r--r--lldb/source/Core/Value.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp4
-rw-r--r--lldb/source/Symbol/CompilerType.cpp2
-rw-r--r--lldb/source/Symbol/Type.cpp2
-rw-r--r--lldb/source/Target/PathMappingList.cpp1
-rw-r--r--lldb/source/Utility/UriParser.cpp2
10 files changed, 5 insertions, 14 deletions
diff --git a/lldb/include/lldb/Core/RangeMap.h b/lldb/include/lldb/Core/RangeMap.h
index e37dcd7df44..91fd409fb4e 100644
--- a/lldb/include/lldb/Core/RangeMap.h
+++ b/lldb/include/lldb/Core/RangeMap.h
@@ -975,7 +975,6 @@ public:
#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 0a704fdc918..6d610d512f3 100644
--- a/lldb/source/Breakpoint/BreakpointIDList.cpp
+++ b/lldb/source/Breakpoint/BreakpointIDList.cpp
@@ -139,7 +139,6 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
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 a69f490f9ae..d8c1151902f 100644
--- a/lldb/source/Core/FileSpecList.cpp
+++ b/lldb/source/Core/FileSpecList.cpp
@@ -49,7 +49,7 @@ void FileSpecList::Append(const FileSpec &file_spec) {
// 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 3f0f9ea576b..9eb5a491653 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -535,7 +535,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
"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 5ac6b194111..105c088b9e9 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -324,8 +324,6 @@ public:
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 f907735d8f5..e977307c565 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
@@ -85,8 +85,6 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_i386(
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 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_x86_64(
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 e3880af27f2..16bb534df42 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -997,7 +997,7 @@ bool CompilerType::ReadFromMemory(lldb_private::ExecutionContext *exe_ctx,
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 53d9c5cc96a..53bf3e85005 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -404,7 +404,7 @@ bool Type::ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t addr,
// 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 b834a3600d0..782c6e49623 100644
--- a/lldb/source/Target/PathMappingList.cpp
+++ b/lldb/source/Target/PathMappingList.cpp
@@ -85,7 +85,6 @@ void PathMappingList::Insert(const ConstString &path,
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 5023aa05d07..a6d81e7a2c8 100644
--- a/lldb/source/Utility/UriParser.cpp
+++ b/lldb/source/Utility/UriParser.cpp
@@ -22,7 +22,7 @@ using namespace lldb_private;
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);
OpenPOWER on IntegriCloud