[Lldb-commits] [lldb] r342804 - Change type of m_user_expression_start_pos to size_t

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Sat Sep 22 06:33:08 PDT 2018


Author: teemperor
Date: Sat Sep 22 06:33:08 2018
New Revision: 342804

URL: http://llvm.org/viewvc/llvm-project?rev=342804&view=rev
Log:
Change type of m_user_expression_start_pos to size_t

AbsPosToLineColumnPos is the only reader of m_user_expression_start_pos
and actually treats it like a size_t. Also the value we store in
m_user_expression_start_pos is originally a size_t, so it makes sense
to change the type of this variable to size_t.

Modified:
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=342804&r1=342803&r2=342804&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Sat Sep 22 06:33:08 2018
@@ -620,7 +620,7 @@ bool ClangUserExpression::Parse(Diagnost
 ///     The column in the line that contains the absolute position.
 ///     The first character in a line is indexed as 0.
 //------------------------------------------------------------------
-static void AbsPosToLineColumnPos(unsigned abs_pos, llvm::StringRef code,
+static void AbsPosToLineColumnPos(size_t abs_pos, llvm::StringRef code,
                                   unsigned &line, unsigned &column) {
   // Reset to code position to beginning of the file.
   line = 0;

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h?rev=342804&r1=342803&r2=342804&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h Sat Sep 22 06:33:08 2018
@@ -204,7 +204,7 @@ private:
   /// The absolute character position in the transformed source code where the
   /// user code (as typed by the user) starts. If the variable is empty, then we
   /// were not able to calculate this position.
-  llvm::Optional<unsigned> m_user_expression_start_pos;
+  llvm::Optional<size_t> m_user_expression_start_pos;
   ResultDelegate m_result_delegate;
 };
 




More information about the lldb-commits mailing list