Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for unsupported code in MSVC.

llvm-svn: 190924
This commit is contained in:
Virgile Bello 2013-09-18 08:09:31 +00:00
parent 591f15411a
commit d0c5c776bc
5 changed files with 24 additions and 3 deletions

View File

@ -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::CloseCommandPipe ()
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 (uint32_t timeout_usec, Error *error_pt
// 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;

View File

@ -1330,6 +1330,9 @@ DumpAPInt (Stream *s, const DataExtractor &data, lldb::offset_t offset, lldb::of
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

View File

@ -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)
{

View File

@ -149,7 +149,7 @@ RegisterContextMacOSXFrameBackchain::ReadRegister (const RegisterInfo *reg_info,
// 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))
{

View File

@ -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;