Clean-up warnings on Linux/GCC

llvm-svn: 217862
This commit is contained in:
David Majnemer 2014-09-16 06:34:29 +00:00
parent 76e251c03b
commit 8faf9370fa
7 changed files with 17 additions and 10 deletions

View File

@ -52,8 +52,6 @@ class BreakpointLocation :
public StoppointLocation public StoppointLocation
{ {
public: public:
friend class BreakpointLocationList;
~BreakpointLocation (); ~BreakpointLocation ();
//------------------------------------------------------------------ //------------------------------------------------------------------

View File

@ -301,6 +301,7 @@ IRExecutionUnit::GetRunnableInfo(Error &error,
.setErrorStr(&error_string) .setErrorStr(&error_string)
.setRelocationModel(relocModel) .setRelocationModel(relocModel)
.setJITMemoryManager(new MemoryManager(*this)) .setJITMemoryManager(new MemoryManager(*this))
.setCodeModel(codeModel)
.setOptLevel(llvm::CodeGenOpt::Less); .setOptLevel(llvm::CodeGenOpt::Less);
llvm::StringRef mArch; llvm::StringRef mArch;

View File

@ -28,12 +28,12 @@ ThisThread::SetName(llvm::StringRef name, int max_length)
// off leads to a lot of similar named threads. Go through the thread name // off leads to a lot of similar named threads. Go through the thread name
// and search for the last dot and use that. // and search for the last dot and use that.
if (max_length > 0 && truncated_name.length() > max_length) if (max_length > 0 && truncated_name.length() > static_cast<size_t>(max_length))
{ {
// First see if we can get lucky by removing any initial or final braces. // First see if we can get lucky by removing any initial or final braces.
std::string::size_type begin = truncated_name.find_first_not_of("(<"); std::string::size_type begin = truncated_name.find_first_not_of("(<");
std::string::size_type end = truncated_name.find_last_not_of(")>."); std::string::size_type end = truncated_name.find_last_not_of(")>.");
if (end - begin > max_length) if (end - begin > static_cast<size_t>(max_length))
{ {
// We're still too long. Since this is a dotted component, use everything after the last // We're still too long. Since this is a dotted component, use everything after the last
// dot, up to a maximum of |length| characters. // dot, up to a maximum of |length| characters.

View File

@ -113,6 +113,7 @@ NativeThreadLinux::GetStopReason (ThreadStopInfo &stop_info)
} }
return false; return false;
} }
llvm_unreachable("unhandled StateType!");
} }
lldb_private::NativeRegisterContextSP lldb_private::NativeRegisterContextSP

View File

@ -1789,7 +1789,7 @@ ClangASTType::GetMemberFunctionAtIndex (size_t idx,
{ {
auto method_iter = cxx_record_decl->method_begin(); auto method_iter = cxx_record_decl->method_begin();
auto method_end = cxx_record_decl->method_end(); auto method_end = cxx_record_decl->method_end();
if (idx < std::distance(method_iter, method_end)) if (idx < static_cast<size_t>(std::distance(method_iter, method_end)))
{ {
std::advance(method_iter, idx); std::advance(method_iter, idx);
auto method_decl = method_iter->getCanonicalDecl(); auto method_decl = method_iter->getCanonicalDecl();

View File

@ -251,7 +251,8 @@ AllocatedBlock::ReserveBlock (uint32_t size)
{ {
m_offset_to_chunk_size[0] = needed_chunks; m_offset_to_chunk_size[0] = needed_chunks;
if (log) if (log)
log->Printf ("[1] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks", this, size, size, 0, needed_chunks, m_chunk_size); log->Printf("[1] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks", (void *)this,
size, size, 0, needed_chunks, m_chunk_size);
addr = m_addr; addr = m_addr;
} }
else else
@ -269,7 +270,9 @@ AllocatedBlock::ReserveBlock (uint32_t size)
{ {
m_offset_to_chunk_size[last_offset] = needed_chunks; m_offset_to_chunk_size[last_offset] = needed_chunks;
if (log) if (log)
log->Printf ("[2] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - num_chunks %lu", this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size()); log->Printf("[2] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - "
"num_chunks %lu",
(void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
addr = m_addr + last_offset; addr = m_addr + last_offset;
break; break;
} }
@ -285,7 +288,9 @@ AllocatedBlock::ReserveBlock (uint32_t size)
{ {
m_offset_to_chunk_size[last_offset] = needed_chunks; m_offset_to_chunk_size[last_offset] = needed_chunks;
if (log) if (log)
log->Printf ("[3] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - num_chunks %lu", this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size()); log->Printf("[3] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - "
"num_chunks %lu",
(void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
addr = m_addr + last_offset; addr = m_addr + last_offset;
break; break;
} }
@ -346,7 +351,7 @@ AllocatedBlock::ReserveBlock (uint32_t size)
} }
if (log) if (log)
log->Printf ("AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => 0x%16.16" PRIx64, this, size, size, (uint64_t)addr); log->Printf("AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => 0x%16.16" PRIx64, (void *)this, size, size, (uint64_t)addr);
return addr; return addr;
} }
@ -363,7 +368,8 @@ AllocatedBlock::FreeBlock (addr_t addr)
} }
Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE)); Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
if (log) if (log)
log->Printf ("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %lu", this, (uint64_t)addr, success, m_offset_to_chunk_size.size()); log->Printf("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %lu", (void *)this, (uint64_t)addr,
success, m_offset_to_chunk_size.size());
return success; return success;
} }

View File

@ -541,6 +541,7 @@ RecurseCopy_Callback (void *baton,
return FileSpec::eEnumerateDirectoryResultQuit; // got an error, bail out return FileSpec::eEnumerateDirectoryResultQuit; // got an error, bail out
break; break;
} }
llvm_unreachable("Unhandled FileSpec::FileType!");
} }
Error Error