[Lldb-commits] [PATCH] Don't truncate the target triple when initializing clang

Zachary Turner zturner at google.com
Tue Jun 24 16:45:13 PDT 2014


Responding to this manually since the mailing list doesn't seem to be
pushing this email out  (it shows up in the archive, but it hasn't been
pushed to email subscribers).


On Tue, Jun 24, 2014 at 3:47 PM, Zachary Turner <zturner at google.com> wrote:

> Hi tfiala,
>
> Don't truncate the target triple when initializing clang.
>
> Target triples support an optional 4th component, the environment.  Clang
> on Windows uses this 4th component to make various decisions when looking
> for header file includes, so truncating it leads to crashes on Windows when
> performing simple expression evaluation.
>
> http://reviews.llvm.org/D4282
>
> Files:
>   source/Expression/ClangExpressionParser.cpp
>
> Index: source/Expression/ClangExpressionParser.cpp
> ===================================================================
> --- source/Expression/ClangExpressionParser.cpp
> +++ source/Expression/ClangExpressionParser.cpp
> @@ -129,19 +129,6 @@
>      if (target_sp && target_sp->GetArchitecture().IsValid())
>      {
>          std::string triple =
> target_sp->GetArchitecture().GetTriple().str();
> -
> -        int dash_count = 0;
> -        for (size_t i = 0; i < triple.size(); ++i)
> -        {
> -            if (triple[i] == '-')
> -                dash_count++;
> -            if (dash_count == 3)
> -            {
> -                triple.resize(i);
> -                break;
> -            }
> -        }
> -
>          m_compiler->getTargetOpts().Triple = triple;
>      }
>      else
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140624/b65a83df/attachment.html>


More information about the lldb-commits mailing list