forked from OSchip/llvm-project
[Utility] Remove unused function 'GetMatchSpanningIndices'
llvm-svn: 368243
This commit is contained in:
parent
11538f0afa
commit
b78c8a0a35
|
@ -83,10 +83,6 @@ public:
|
|||
bool GetMatchAtIndex(llvm::StringRef s, uint32_t idx,
|
||||
llvm::StringRef &match_str) const;
|
||||
|
||||
bool GetMatchSpanningIndices(llvm::StringRef s, uint32_t idx1,
|
||||
uint32_t idx2,
|
||||
llvm::StringRef &match_str) const;
|
||||
|
||||
protected:
|
||||
std::vector<regmatch_t>
|
||||
m_matches; ///< Where parenthesized subexpressions results are stored
|
||||
|
|
|
@ -126,23 +126,6 @@ bool RegularExpression::Match::GetMatchAtIndex(
|
|||
return false;
|
||||
}
|
||||
|
||||
bool RegularExpression::Match::GetMatchSpanningIndices(
|
||||
llvm::StringRef s, uint32_t idx1, uint32_t idx2,
|
||||
llvm::StringRef &match_str) const {
|
||||
if (idx1 < m_matches.size() && idx2 < m_matches.size()) {
|
||||
if (m_matches[idx1].rm_so == m_matches[idx2].rm_eo) {
|
||||
// Matched the empty string...
|
||||
match_str = llvm::StringRef();
|
||||
return true;
|
||||
} else if (m_matches[idx1].rm_so < m_matches[idx2].rm_eo) {
|
||||
match_str = s.substr(m_matches[idx1].rm_so,
|
||||
m_matches[idx2].rm_eo - m_matches[idx1].rm_so);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns true if the regular expression compiled and is ready for execution.
|
||||
bool RegularExpression::IsValid() const { return m_comp_err == 0; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue