<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - IRForTarget"
   href="https://llvm.org/bugs/show_bug.cgi?id=26790">26790</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>IRForTarget
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>luke.drummond@codeplay.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It looks like the recent changes committed in r260768 have caused regressions
when trying to call functions that take any arguments whose typename is the
result of a `typedef` involving untagged struct types.

e.g

```c++
typedef {
    float f;
    int i;
} mystruct;

mystruct s;
void somefunc(mystruct *s){}


int $__lldb_expr()
{
    ;
    somefunc(&s);
}
```

lldb versions previous to r260768 resolved the anonymous struct without a
problem, though r260768 and later fail to match the function instead failing
with the following error:

<span class="quote">> "error: Couldn't lookup symbols:
>    multiply($_0*)</span >
.

It seems that calling functions through pointers returned by
`IRForTarget::ResolveFunctionPointers` has been removed in favor of direct
calls through the function by name. That function previously called
IRForTarget::GetFunctionAddress` to resolve a function, and seems to have had
more robust lookups for matching functions did symbol/type resolution through.

I've attached a diff for a failing testcase, that I think would be helpful to
catch this regression in future. I haven't committed this test to the lldb
source tree yet, as I understand this may unduly upset the buildbots.

Apologies for the delay here, but it was a few days after this change went in
that we got this change locally.

Let me know if there's anything I can do to help test this, as I'm keen to get
this resolved as soon as possible - therwise it seems like the best course of
action is to revert r260768 as it seems there might still be some teething
problems with this commit (<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Expression evaluation broken for__attribute__((overloadable))"
   href="show_bug.cgi?id=26694">https://llvm.org/bugs/show_bug.cgi?id=26694</a>

FindCodeSymbolInContext</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>