[Lldb-commits] [lldb] r216304 - Fix a couple of potential issues in the lexer where we were ignoring the putback data

Randy Smith rdsmith at chromium.org
Sat Aug 23 10:36:45 PDT 2014


Enrico: This is failing in my compile (Linux, using gcc 4.8) with:

/usr/local/google/home/rdsmith/Sandboxen/llvm/tools/lldb/source/Utility/StringLexer.cpp:
In member function ‘bool
lldb_utility::StringLexer::HasAny(lldb_utility::StringLexer::Character)’:
/usr/local/google/home/rdsmith/Sandboxen/llvm/tools/lldb/source/Utility/StringLexer.cpp:75:9:
error: ‘find’ is not a member of ‘std’
     if (std::find(begin, end, c) != end)
         ^

I presume it's just a missing include file; certainly "#include
<algorithm>" at the top of StringLexer.cpp fixes it.  (To answer the
obvious question: I'm not an lldb committer, so I can't just fix
this.)

-- Randy


On Fri, Aug 22, 2014 at 8:11 PM, Enrico Granata <egranata at apple.com> wrote:
> Author: enrico
> Date: Fri Aug 22 19:11:38 2014
> New Revision: 216304
>
> URL: http://llvm.org/viewvc/llvm-project?rev=216304&view=rev
> Log:
> Fix a couple of potential issues in the lexer where we were ignoring the putback data
>
> Modified:
>     lldb/trunk/source/Utility/StringLexer.cpp
>
> Modified: lldb/trunk/source/Utility/StringLexer.cpp
> URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringLexer.cpp?rev=216304&r1=216303&r2=216304&view=diff
> ==============================================================================
> --- lldb/trunk/source/Utility/StringLexer.cpp (original)
> +++ lldb/trunk/source/Utility/StringLexer.cpp Fri Aug 22 19:11:38 2014
> @@ -55,7 +55,9 @@ StringLexer::Next ()
>  bool
>  StringLexer::HasAtLeast (Size s)
>  {
> -    return m_data.size()-m_position >= s;
> +    auto in_m_data = m_data.size()-m_position;
> +    auto in_putback = m_putback_data.size();
> +    return (in_m_data + in_putback >= s);
>  }
>
>
> @@ -68,6 +70,10 @@ StringLexer::PutBack (Character c)
>  bool
>  StringLexer::HasAny (Character c)
>  {
> +    const auto begin(m_putback_data.begin());
> +    const auto end(m_putback_data.end());
> +    if (std::find(begin, end, c) != end)
> +        return true;
>      return m_data.find(c, m_position) != std::string::npos;
>  }
>
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list