remove trailing whitespace + remove some useless comments

llvm-svn: 212411
diff --git a/lldb/source/Expression/IRMemoryMap.cpp b/lldb/source/Expression/IRMemoryMap.cpp
index 3e6ef3b..9239e08 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -28,11 +28,11 @@
 IRMemoryMap::~IRMemoryMap ()
 {
     lldb::ProcessSP process_sp = m_process_wp.lock();
-    
+
     if (process_sp)
     {
         AllocationMap::iterator iter;
-        
+
         Error err;
 
         while ((iter = m_allocations.begin()) != m_allocations.end())
@@ -51,25 +51,25 @@
 {
     lldb::TargetSP target_sp = m_target_wp.lock();
     lldb::ProcessSP process_sp = m_process_wp.lock();
-        
+
     lldb::addr_t ret = LLDB_INVALID_ADDRESS;
-    
+
     if (process_sp && process_sp->CanJIT() && process_sp->IsAlive())
     {
         Error alloc_error;
-        
+
         ret = process_sp->AllocateMemory(size, lldb::ePermissionsReadable | lldb::ePermissionsWritable, alloc_error);
-        
+
         if (!alloc_error.Success())
             return LLDB_INVALID_ADDRESS;
         else
             return ret;
     }
-    
+
     for (int iterations = 0; iterations < 16; ++iterations)
     {
         lldb::addr_t candidate = LLDB_INVALID_ADDRESS;
-        
+
         switch (target_sp->GetArchitecture().GetAddressByteSize())
         {
         case 4:
@@ -90,15 +90,15 @@
                 break;
             }
         }
-        
+
         if (IntersectsAllocation(candidate, size))
             continue;
-                
+
         ret = candidate;
-            
+
         return ret;
     }
-    
+
     return ret;
 }
 
@@ -107,9 +107,9 @@
 {
     if (addr == LLDB_INVALID_ADDRESS)
         return m_allocations.end();
-    
+
     AllocationMap::iterator iter = m_allocations.lower_bound (addr);
-    
+
     if (iter == m_allocations.end() ||
         iter->first > addr)
     {
@@ -117,10 +117,10 @@
             return m_allocations.end();
         iter--;
     }
-    
+
     if (iter->first <= addr && iter->first + iter->second.m_size >= addr + size)
         return iter;
-    
+
     return m_allocations.end();
 }
 
@@ -129,9 +129,9 @@
 {
     if (addr == LLDB_INVALID_ADDRESS)
         return false;
-    
+
     AllocationMap::const_iterator iter = m_allocations.lower_bound (addr);
-    
+
     // Since we only know that the returned interval begins at a location greater than or
     // equal to where the given interval begins, it's possible that the given interval
     // intersects either the returned interval or the previous interval.  Thus, we need to
@@ -171,15 +171,15 @@
 IRMemoryMap::GetByteOrder()
 {
     lldb::ProcessSP process_sp = m_process_wp.lock();
-    
+
     if (process_sp)
         return process_sp->GetByteOrder();
-    
+
     lldb::TargetSP target_sp = m_target_wp.lock();
-    
+
     if (target_sp)
         return target_sp->GetArchitecture().GetByteOrder();
-    
+
     return lldb::eByteOrderInvalid;
 }
 
@@ -187,15 +187,15 @@
 IRMemoryMap::GetAddressByteSize()
 {
     lldb::ProcessSP process_sp = m_process_wp.lock();
-    
+
     if (process_sp)
         return process_sp->GetAddressByteSize();
-    
+
     lldb::TargetSP target_sp = m_target_wp.lock();
-    
+
     if (target_sp)
         return target_sp->GetArchitecture().GetAddressByteSize();
-    
+
     return UINT32_MAX;
 }
 
@@ -203,15 +203,15 @@
 IRMemoryMap::GetBestExecutionContextScope() const
 {
     lldb::ProcessSP process_sp = m_process_wp.lock();
-    
+
     if (process_sp)
         return process_sp.get();
-    
+
     lldb::TargetSP target_sp = m_target_wp.lock();
-    
+
     if (target_sp)
         return target_sp.get();
-    
+
     return NULL;
 }
 
@@ -251,7 +251,7 @@
 {
     lldb_private::Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
     error.Clear();
-    
+
     lldb::ProcessSP process_sp;
     lldb::addr_t    allocation_address  = LLDB_INVALID_ADDRESS;
     lldb::addr_t    aligned_address     = LLDB_INVALID_ADDRESS;
@@ -263,7 +263,7 @@
         allocation_size = alignment;
     else
         allocation_size = (size & alignment_mask) ? ((size + alignment) & (~alignment_mask)) : size;
-    
+
     switch (policy)
     {
     default:
@@ -328,8 +328,8 @@
         }
         break;
     }
-    
-    
+
+
     lldb::addr_t mask = alignment - 1;
     aligned_address = (allocation_address + mask) & (~mask);
 
@@ -339,11 +339,11 @@
                                                 permissions,
                                                 alignment,
                                                 policy);
-    
+
     if (log)
     {
         const char * policy_string;
-        
+
         switch (policy)
         {
         default:
@@ -359,7 +359,7 @@
             policy_string = "eAllocationPolicyMirror";
             break;
         }
-        
+
         log->Printf("IRMemoryMap::Malloc (%" PRIu64 ", 0x%" PRIx64 ", 0x%" PRIx64 ", %s) -> 0x%" PRIx64,
                     (uint64_t)allocation_size,
                     (uint64_t)alignment,
@@ -367,7 +367,7 @@
                     policy_string,
                     aligned_address);
     }
-    
+
     return aligned_address;
 }
 
@@ -375,16 +375,16 @@
 IRMemoryMap::Leak (lldb::addr_t process_address, Error &error)
 {
     error.Clear();
-    
+
     AllocationMap::iterator iter = m_allocations.find(process_address);
-    
+
     if (iter == m_allocations.end())
     {
         error.SetErrorToGenericError();
         error.SetErrorString("Couldn't leak: allocation doesn't exist");
         return;
     }
-    
+
     Allocation &allocation = iter->second;
 
     allocation.m_leak = true;
@@ -394,18 +394,18 @@
 IRMemoryMap::Free (lldb::addr_t process_address, Error &error)
 {
     error.Clear();
-    
+
     AllocationMap::iterator iter = m_allocations.find(process_address);
-    
+
     if (iter == m_allocations.end())
     {
         error.SetErrorToGenericError();
         error.SetErrorString("Couldn't free: allocation doesn't exist");
         return;
     }
-    
+
     Allocation &allocation = iter->second;
-        
+
     switch (allocation.m_policy)
     {
     default:
@@ -417,7 +417,7 @@
                 if (process_sp->CanJIT() && process_sp->IsAlive())
                     process_sp->DeallocateMemory(allocation.m_process_alloc); // FindSpace allocated this for real
             }
-    
+
             break;
         }
     case eAllocationPolicyMirror:
@@ -428,15 +428,15 @@
                 process_sp->DeallocateMemory(allocation.m_process_alloc);
         }
     }
-    
+
     if (lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
-    {        
+    {
         log->Printf("IRMemoryMap::Free (0x%" PRIx64 ") freed [0x%" PRIx64 "..0x%" PRIx64 ")",
                     (uint64_t)process_address,
                     iter->second.m_process_start,
                     iter->second.m_process_start + iter->second.m_size);
     }
-    
+
     m_allocations.erase(iter);
 }
 
@@ -444,28 +444,28 @@
 IRMemoryMap::WriteMemory (lldb::addr_t process_address, const uint8_t *bytes, size_t size, Error &error)
 {
     error.Clear();
-    
+
     AllocationMap::iterator iter = FindAllocation(process_address, size);
-    
+
     if (iter == m_allocations.end())
     {
         lldb::ProcessSP process_sp = m_process_wp.lock();
-        
+
         if (process_sp)
         {
             process_sp->WriteMemory(process_address, bytes, size, error);
             return;
         }
-        
+
         error.SetErrorToGenericError();
         error.SetErrorString("Couldn't write: no allocation contains the target range and the process doesn't exist");
         return;
     }
-    
+
     Allocation &allocation = iter->second;
-    
+
     uint64_t offset = process_address - allocation.m_process_start;
-    
+
     lldb::ProcessSP process_sp;
 
     switch (allocation.m_policy)
@@ -509,9 +509,9 @@
         }
         break;
     }
-    
+
     if (lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
-    {        
+    {
         log->Printf("IRMemoryMap::WriteMemory (0x%" PRIx64 ", 0x%" PRIx64 ", 0x%" PRId64 ") went to [0x%" PRIx64 "..0x%" PRIx64 ")",
                     (uint64_t)process_address,
                     (uint64_t)bytes,
@@ -525,10 +525,10 @@
 IRMemoryMap::WriteScalarToMemory (lldb::addr_t process_address, Scalar &scalar, size_t size, Error &error)
 {
     error.Clear();
-    
+
     if (size == UINT32_MAX)
         size = scalar.GetByteSize();
-    
+
     if (size > 0)
     {
         uint8_t buf[32];
@@ -555,9 +555,9 @@
 IRMemoryMap::WritePointerToMemory (lldb::addr_t process_address, lldb::addr_t address, Error &error)
 {
     error.Clear();
-    
+
     Scalar scalar(address);
-    
+
     WriteScalarToMemory(process_address, scalar, GetAddressByteSize(), error);
 }
 
@@ -565,46 +565,46 @@
 IRMemoryMap::ReadMemory (uint8_t *bytes, lldb::addr_t process_address, size_t size, Error &error)
 {
     error.Clear();
-    
+
     AllocationMap::iterator iter = FindAllocation(process_address, size);
-    
+
     if (iter == m_allocations.end())
     {
         lldb::ProcessSP process_sp = m_process_wp.lock();
-        
+
         if (process_sp)
         {
             process_sp->ReadMemory(process_address, bytes, size, error);
             return;
         }
-        
+
         lldb::TargetSP target_sp = m_target_wp.lock();
-        
+
         if (target_sp)
         {
             Address absolute_address(process_address);
             target_sp->ReadMemory(absolute_address, false, bytes, size, error);
             return;
         }
-        
+
         error.SetErrorToGenericError();
         error.SetErrorString("Couldn't read: no allocation contains the target range, and neither the process nor the target exist");
         return;
     }
-    
+
     Allocation &allocation = iter->second;
-    
+
     uint64_t offset = process_address - allocation.m_process_start;
-    
+
     if (offset > allocation.m_size)
     {
         error.SetErrorToGenericError();
         error.SetErrorString("Couldn't read: data is not in the allocation");
         return;
     }
-    
+
     lldb::ProcessSP process_sp;
-    
+
     switch (allocation.m_policy)
     {
     default:
@@ -656,7 +656,7 @@
         }
         break;
     }
-    
+
     if (lldb_private::Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS))
     {
         log->Printf("IRMemoryMap::ReadMemory (0x%" PRIx64 ", 0x%" PRIx64 ", 0x%" PRId64 ") came from [0x%" PRIx64 "..0x%" PRIx64 ")",
@@ -672,19 +672,19 @@
 IRMemoryMap::ReadScalarFromMemory (Scalar &scalar, lldb::addr_t process_address, size_t size, Error &error)
 {
     error.Clear();
-    
+
     if (size > 0)
     {
         DataBufferHeap buf(size, 0);
         ReadMemory(buf.GetBytes(), process_address, size, error);
-        
+
         if (!error.Success())
             return;
-        
+
         DataExtractor extractor(buf.GetBytes(), buf.GetByteSize(), GetByteOrder(), GetAddressByteSize());
-        
+
         lldb::offset_t offset = 0;
-        
+
         switch (size)
         {
         default:
@@ -709,15 +709,15 @@
 IRMemoryMap::ReadPointerFromMemory (lldb::addr_t *address, lldb::addr_t process_address, Error &error)
 {
     error.Clear();
-    
+
     Scalar pointer_scalar;
     ReadScalarFromMemory(pointer_scalar, process_address, GetAddressByteSize(), error);
-    
+
     if (!error.Success())
         return;
-    
+
     *address = pointer_scalar.ULongLong();
-    
+
     return;
 }
 
@@ -725,20 +725,20 @@
 IRMemoryMap::GetMemoryData (DataExtractor &extractor, lldb::addr_t process_address, size_t size, Error &error)
 {
     error.Clear();
-    
+
     if (size > 0)
     {
         AllocationMap::iterator iter = FindAllocation(process_address, size);
-        
+
         if (iter == m_allocations.end())
         {
             error.SetErrorToGenericError();
             error.SetErrorStringWithFormat("Couldn't find an allocation containing [0x%" PRIx64 "..0x%" PRIx64 ")", process_address, process_address + size);
             return;
         }
-        
+
         Allocation &allocation = iter->second;
-        
+
         switch (allocation.m_policy)
         {
         default:
@@ -788,5 +788,3 @@
         return;
     }
 }
-
-