[Lldb-commits] [lldb] r190924 - Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for unsupported code in MSVC.

Virgile Bello virgile.bello at gmail.com
Wed Sep 18 01:09:32 PDT 2013


Author: xen2
Date: Wed Sep 18 03:09:31 2013
New Revision: 190924

URL: http://llvm.org/viewvc/llvm-project?rev=190924&view=rev
Log:
Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for unsupported code in MSVC.

Modified:
    lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
    lldb/trunk/source/Core/DataExtractor.cpp
    lldb/trunk/source/Core/Mangled.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h

Modified: lldb/trunk/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ConnectionFileDescriptor.cpp?rev=190924&r1=190923&r2=190924&view=diff
==============================================================================
--- lldb/trunk/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/trunk/source/Core/ConnectionFileDescriptor.cpp Wed Sep 18 03:09:31 2013
@@ -42,6 +42,7 @@
 
 // C++ Includes
 // Other libraries and framework includes
+#include "llvm/Support/ErrorHandling.h"
 #if defined(__APPLE__)
 #include "llvm/ADT/SmallVector.h"
 #endif
@@ -178,13 +179,21 @@ ConnectionFileDescriptor::CloseCommandPi
 
     if (m_pipe_read != -1)
     {
+#ifdef _MSC_VER
+        llvm_unreachable("pipe close unsupported in MSVC");
+#else
         close (m_pipe_read);
+#endif
         m_pipe_read = -1;
     }
     
     if (m_pipe_write != -1)
     {
+#ifdef _MSC_VER
+        llvm_unreachable("pipe close unsupported in MSVC");
+#else
         close (m_pipe_write);
+#endif
         m_pipe_write = -1;
     }
 }
@@ -879,7 +888,9 @@ ConnectionFileDescriptor::BytesAvailable
         // If this assert fires off on MacOSX, we will need to switch to using
         // libdispatch to read from file descriptors because poll() is causing
         // kernel panics and if we exceed FD_SETSIZE we will have no choice...
+#ifndef _MSC_VER
         assert (data_fd < FD_SETSIZE);
+#endif
         
         const bool have_pipe_fd = pipe_fd >= 0;
         

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=190924&r1=190923&r2=190924&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Wed Sep 18 03:09:31 2013
@@ -1330,6 +1330,9 @@ DumpAPInt (Stream *s, const DataExtracto
 
 static float half2float (uint16_t half)
 {
+#ifdef _MSC_VER
+    llvm_unreachable("half2float not implemented for MSVC");
+#else
     union{ float       f; uint32_t    u;}u;
     int32_t v = (int16_t) half;
     
@@ -1342,6 +1345,7 @@ static float half2float (uint16_t half)
     v <<= 13;
     u.u = v | 0x70000000U;
     return u.f * ldexpf(1, -112);
+#endif
 }
 
 lldb::offset_t

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=190924&r1=190923&r2=190924&view=diff
==============================================================================
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Wed Sep 18 03:09:31 2013
@@ -10,7 +10,9 @@
 
 // FreeBSD9-STABLE requires this to know about size_t in cxxabi.h
 #include <cstddef>
+#ifndef _MSC_VER
 #include <cxxabi.h>
+#endif
 
 
 #include "llvm/ADT/DenseMap.h"
@@ -199,7 +201,11 @@ Mangled::GetDemangledName () const
             {
                 // We didn't already mangle this name, demangle it and if all goes well
                 // add it to our map.
+#if !defined(_MSC_VER)
                 char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
+#else
+                char *demangled_name = 0;
+#endif
 
                 if (demangled_name)
                 {

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp?rev=190924&r1=190923&r2=190924&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp Wed Sep 18 03:09:31 2013
@@ -149,7 +149,7 @@ RegisterContextMacOSXFrameBackchain::Rea
 
             // TOOD: need a better way to detect when "long double" types are 
             // the same bytes size as "double"
-#if !defined(__arm__)
+#if !defined(__arm__) && !defined(_MSC_VER)
         case sizeof (long double):
             if (sizeof (long double) == sizeof(uint32_t))
             {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h?rev=190924&r1=190923&r2=190924&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h Wed Sep 18 03:09:31 2013
@@ -13,7 +13,7 @@
 #include "SymbolFileDWARF.h"
 #include <string>
 #include <vector>
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L || defined(_MSC_VER)
 #include <unordered_map>
 #else
 #include <ext/hash_map>
@@ -87,7 +87,7 @@ protected:
 
     dw_offset_t     m_offset;
     Header          m_header;
-#if __cplusplus >= 201103L
+#if __cplusplus >= 201103L || defined(_MSC_VER)
     typedef std::unordered_multimap<const char*, uint32_t, std::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap;
 #else
     typedef __gnu_cxx::hash_multimap<const char*, uint32_t, __gnu_cxx::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap;





More information about the lldb-commits mailing list