Re: [Lldb-commits] [lldb] r205769 - Improve demangler to compile with MSVC.

2014-04-09 Thread Virgile Bello
Sorry about that, I'll check into a different way to work around it.
On Apr 9, 2014 2:15 AM, Ed Maste ema...@freebsd.org wrote:

 On 8 April 2014 10:46, Virgile Bello virgile.be...@gmail.com wrote:
  Author: xen2
  Date: Tue Apr  8 09:46:44 2014
  New Revision: 205769
 
  URL: http://llvm.org/viewvc/llvm-project?rev=205769view=rev
  Log:
  Improve demangler to compile with MSVC.

 I reverted this as it breaks the build on FreeBSD:
 error: declaration of constexpr static data member 'spec' requires an
 initializer

 I'm not sure if there's going to be an easy solution other than some
 #ifdef hackery, unfortunately.

___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r205769 - Improve demangler to compile with MSVC.

2014-04-08 Thread Virgile Bello
Author: xen2
Date: Tue Apr  8 09:46:44 2014
New Revision: 205769

URL: http://llvm.org/viewvc/llvm-project?rev=205769view=rev
Log:
Improve demangler to compile with MSVC.

Modified:
lldb/trunk/source/Core/Mangled.cpp

Modified: lldb/trunk/source/Core/Mangled.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=205769r1=205768r2=205769view=diff
==
--- lldb/trunk/source/Core/Mangled.cpp (original)
+++ lldb/trunk/source/Core/Mangled.cpp Tue Apr  8 09:46:44 2014
@@ -11,7 +11,13 @@
 // FreeBSD9-STABLE requires this to know about size_t in cxxabi.h
 #include cstddef
 #if defined(_MSC_VER) 
-// Cannot enable the builtin demangler on msvc as it does not support the 
cpp11 within the implementation.
+#define LLDB_USE_BUILTIN_DEMANGLER
+// MSVC doesn't support constexpr, alignas, __attribute__ and noexcept yet
+#define constexpr
+#define alignas(X)
+#define __attribute__(X)
+#define noexcept
+#define snprintf _snprintf
 #elif defined (__FreeBSD__)
 #define LLDB_USE_BUILTIN_DEMANGLER
 #else
@@ -173,30 +179,30 @@ struct float_datafloat
 {
 static const size_t mangled_size = 8;
 static const size_t max_demangled_size = 24;
-static constexpr const char* spec = %af;
+static constexpr const char* spec;
 };
 
-constexpr const char* float_datafloat::spec;
+constexpr const char* float_datafloat::spec = %af;
 
 template 
 struct float_datadouble
 {
 static const size_t mangled_size = 16;
 static const size_t max_demangled_size = 32;
-static constexpr const char* spec = %a;
+static constexpr const char* spec;
 };
 
-constexpr const char* float_datadouble::spec;
+constexpr const char* float_datadouble::spec = %a;
 
 template 
 struct float_datalong double
 {
 static const size_t mangled_size = 20;  // May need to be adjusted to 16 
or 24 on other platforms
 static const size_t max_demangled_size = 40;
-static constexpr const char* spec = %LaL;
+static constexpr const char* spec;
 };
 
-constexpr const char* float_datalong double::spec;
+constexpr const char* float_datalong double::spec = %LaL;
 
 template class Float, class C
 const char*


___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r205769 - Improve demangler to compile with MSVC.

2014-04-08 Thread Ed Maste
On 8 April 2014 10:46, Virgile Bello virgile.be...@gmail.com wrote:
 Author: xen2
 Date: Tue Apr  8 09:46:44 2014
 New Revision: 205769

 URL: http://llvm.org/viewvc/llvm-project?rev=205769view=rev
 Log:
 Improve demangler to compile with MSVC.

I reverted this as it breaks the build on FreeBSD:
error: declaration of constexpr static data member 'spec' requires an
initializer

I'm not sure if there's going to be an easy solution other than some
#ifdef hackery, unfortunately.
___
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits