<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 --- - Function pointer type in struct converted to {}*"
href="https://llvm.org/bugs/show_bug.cgi?id=25009">25009</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Function pointer type in struct converted to {}*
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tarunprabhu@gmail.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>Input code:
struct BaseT {
void (*f)(struct BaseT** pot);
};
void foo(struct BaseT** in) {
}
When I emit llvm for this code, I get the following definition for struct BaseT
%struct.BaseT = type { {}* }
If I change the double pointer (BaseT**) in the definition of foo() to a single
pointer i.e.
void foo(BaseT*) {
}
then I get the expected output which is:
%struct.BaseT = type { void (%struct.BaseT**)* }
As far as I can tell, the code for the function bodies (in the complete code
which I have not provided) is correct because all the casts are added
correctly. However, I am writing an LLVM-based tool which needs to know the
types of the various user-defined structs and it breaks because the function
pointer in the type disappears and is replaced with what looks like an empty
anonymous struct.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>