[Lldb-commits] [PATCH] D23883: Remove MIUtilParse (no longer used)

Michał Górny via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 25 10:33:57 PDT 2016


mgorny created this revision.
mgorny added a reviewer: dawn.
mgorny added a subscriber: lldb-commits.
Herald added a subscriber: ki.stfu.

Remove MIUtilParse once https://reviews.llvm.org/D23882 is accepted.

https://reviews.llvm.org/D23883

Files:
  tools/lldb-mi/CMakeLists.txt
  tools/lldb-mi/MIUtilParse.cpp

Index: tools/lldb-mi/MIUtilParse.cpp
===================================================================
--- tools/lldb-mi/MIUtilParse.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-//===-- MIUtilParse.cpp ----------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
- 
-// Third party headers:
-#include <memory>
-
-// In-house headers:
-#include "MIUtilParse.h"
- 
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser constructor.
-// Type:    Method.
-// Args:    regexStr - Pointer to the regular expression to compile.
-// Return:  None.
-// Throws:  None.
-//--
-MIUtilParse::CRegexParser::CRegexParser(const char *regexStr)
-    : m_isValid(llvm_regcomp(&m_emma, regexStr, REG_EXTENDED) == 0)
-{
-}
- 
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser destructor.
-// Type:    Method.
-// Args:    None.
-// Return:  None.
-// Throws:  None.
-//--
-MIUtilParse::CRegexParser::~CRegexParser()
-{
-    // Free up memory held within regex.
-    if (m_isValid)
-        llvm_regfree(&m_emma);
-}
- 
-//++ ------------------------------------------------------------------------------------
-// Details: CRegexParser regex executer.
-//          Match the input against the regular expression.  Return an error
-//          if the number of matches is less than minMatches.  If the default
-//          minMatches value of 0 is passed, an error will be returned if
-//          the number of matches is less than the maxMatches value used to
-//          initialize Match.
-// Type:    Method.
-// Args:    input (R) - Pointer to UTF8 text data to be parsed.
-//          match (RW) - Reference to Match class.
-//          minMatches (R) - Minimum number of regex matches expected.
-// Return:  bool - True = minimum matches were met,
-//                 false = minimum matches were not met or regex failed.
-// Throws:  None.
-//--
-bool
-MIUtilParse::CRegexParser::Execute(const char *input, Match& match, size_t minMatches)
-{
-    if (!m_isValid)
-        return false;
- 
-    std::unique_ptr<llvm_regmatch_t[]> matches(new llvm_regmatch_t[match.m_maxMatches]); // Array of matches
-   
-    if (llvm_regexec(&m_emma, input, match.m_maxMatches, matches.get(), 0) != 0)
-        return false;
- 
-    size_t i;
-    for (i = 0; i < match.m_maxMatches && matches[i].rm_so >= 0; i++)
-    {
-        const int n = matches[i].rm_eo - matches[i].rm_so;
-        match.m_matchStrs[i].assign(input + matches[i].rm_so, n);
-    }
-    return i >= minMatches;
-}
Index: tools/lldb-mi/CMakeLists.txt
===================================================================
--- tools/lldb-mi/CMakeLists.txt
+++ tools/lldb-mi/CMakeLists.txt
@@ -65,7 +65,6 @@
   MIDriverBase.cpp
   MIDriverMain.cpp
   MIDriverMgr.cpp
-  MIUtilParse.cpp
   MIUtilDateTimeStd.cpp
   MIUtilDebug.cpp
   MIUtilFileStd.cpp


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23883.69268.patch
Type: text/x-patch
Size: 3176 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160825/34eda95b/attachment.bin>


More information about the lldb-commits mailing list