[Lldb-commits] [lldb] r189934 - Remove <windows.h> from lldb-types.h.

Malea, Daniel daniel.malea at intel.com
Wed Sep 4 16:36:52 PDT 2013


Hi Virgile,


This commit introduces a dependency in the LLDB API on the LLVM headers,
which is not ideal because users of the LLDB API shouldn't be required to
have LLVM headers around IMHO.

Specifically, the api unit tests are now broken on the GCC buildbot.
Here's the include hierarchy that is problematic:

/home/baldrick/llvm/tools/lldb/test/../include/lldb/Utility/SharingPtr.h:15
:33: fatal error: llvm/Support/Atomic.h: No such file or directory
compilation terminated.
In file included from
/home/baldrick/llvm/tools/lldb/test/../include/lldb/lldb-forward.h:15:0,
                 from
/home/baldrick/llvm/tools/lldb/test/../include/lldb/lldb-types.h:14,
                 from
/home/baldrick/llvm/tools/lldb/test/../include/lldb/lldb-defines.h:13,
                 from
/home/baldrick/llvm/tools/lldb/test/../include/lldb/API/SBDefines.h:18,
                 from
/home/baldrick/llvm/tools/lldb/test/../include/lldb/API/LLDB.h:17,
                 from lldb-headers.h:8,



Can we use something other than llvm/Support/Atomic.h in
lldb/Utility/SharingPtr.h? Maybe std::atomic_fetch_add if it's appropriate
to use C++11 in the public headers?


Cheers,
Dan


On 2013-09-04 9:56 AM, "Virgile Bello" <virgile.bello at gmail.com> wrote:

>Modified: lldb/trunk/include/lldb/Utility/SharingPtr.h
>URL: 
>http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/Sharin
>gPtr.h?rev=189934&r1=189933&r2=189934&view=diff
>==========================================================================
>====
>--- lldb/trunk/include/lldb/Utility/SharingPtr.h (original)
>+++ lldb/trunk/include/lldb/Utility/SharingPtr.h Wed Sep  4 08:56:11 2013
>@@ -12,6 +12,7 @@
>#include <algorithm>
>#include <memory>
>+#include "llvm/Support/Atomic.h"
>//#define ENABLE_SP_LOGGING 1 // DON'T CHECK THIS LINE IN UNLESS
>COMMENTED OUT
>#if defined (ENABLE_SP_LOGGING)
>@@ -28,14 +29,14 @@ template <class T>
>inline T
>increment(T& t)
>{
>-    return __sync_add_and_fetch(&t, 1);
>+    return llvm::sys::AtomicIncrement((llvm::sys::cas_flag*)&t);
>}
>template <class T>
>inline T
>decrement(T& t)
>{
>-    return __sync_add_and_fetch(&t, -1);
>+    return llvm::sys::AtomicDecrement((llvm::sys::cas_flag*)&t);
>}
>class shared_count
>





More information about the lldb-commits mailing list