[Lldb-commits] [lldb] r236819 - Have lldb_assert accept bool expressions

Pavel Labath labath at google.com
Fri May 8 02:53:32 PDT 2015


Author: labath
Date: Fri May  8 04:53:31 2015
New Revision: 236819

URL: http://llvm.org/viewvc/llvm-project?rev=236819&view=rev
Log:
Have lldb_assert accept bool expressions

Summary:
This changes lldb_assert to accept bool expressions as the parameter, this is because some
objects (such as std::shared_ptr) are convertible to bool, but are not convertible to int, which
leads to surprising errors.

Reviewers: granata.enrico, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9565

Modified:
    lldb/trunk/include/lldb/Utility/LLDBAssert.h
    lldb/trunk/source/Utility/LLDBAssert.cpp

Modified: lldb/trunk/include/lldb/Utility/LLDBAssert.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/LLDBAssert.h?rev=236819&r1=236818&r2=236819&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/LLDBAssert.h (original)
+++ lldb/trunk/include/lldb/Utility/LLDBAssert.h Fri May  8 04:53:31 2015
@@ -20,7 +20,7 @@
 
 namespace lldb_private {
     void
-    lldb_assert (int expression,
+    lldb_assert (bool expression,
                  const char* expr_text,
                  const char* func,
                  const char* file,

Modified: lldb/trunk/source/Utility/LLDBAssert.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/LLDBAssert.cpp?rev=236819&r1=236818&r2=236819&view=diff
==============================================================================
--- lldb/trunk/source/Utility/LLDBAssert.cpp (original)
+++ lldb/trunk/source/Utility/LLDBAssert.cpp Fri May  8 04:53:31 2015
@@ -17,7 +17,7 @@ using namespace llvm;
 using namespace lldb_private;
 
 void
-lldb_private::lldb_assert (int expression,
+lldb_private::lldb_assert (bool expression,
                            const char* expr_text,
                            const char* func,
                            const char* file,





More information about the lldb-commits mailing list