<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello all,<br>
<br>
In the process of porting the Polly plug-in to Windows we
encountered a couple of issues stemming from the use (within Polly)
of global data from LLVM.<br>
<br>
By far the most common occurrence of this is the definition by a
class of a publicly accessible static ID, the address of which is
used to uniquely identify the class. For example<br>
<blockquote><tt>class AliasAnalysis {</tt><tt><br>
</tt><tt><br>
</tt><tt>public:</tt><tt><br>
</tt><tt> static char ID; // Class identification, replacement
for typeinfo</tt><tt><br>
</tt><tt><br>
</tt><tt>};</tt><br>
</blockquote>
<br>
This turns out to be problematic on Windows for two reasons:<br>
<br>
1) We found that Visual Studio actually defines two copies of the
ID, one within the clang executable and another within the Polly
library. This results in Polly being unable to identify LLVM passes.
(This seems like a bug in Visual Studio, but we could not find a
resolution other than changing LLVM as noted below).<br>
2) We chose to use delay loading for symbols imported by Polly from
clang. This allows the Polly dll to be loaded into any executable
that provides the required symbols. However delay loading precludes
the importing of data[1].<br>
<br>
We would like to resolve these issues by replacing public access of
the ID with a getter:<br>
<blockquote><tt>class AliasAnalysis {</tt><tt><br>
</tt>
<tt><br>
</tt><tt>private:<br>
static char ID; // Class identification, replacement for
typeinfo</tt><tt><br>
</tt><tt>
</tt><tt><br>
</tt><tt>
<tt>public:</tt><tt><br>
</tt><tt>
</tt> static const void *getClassPassID();</tt><tt><br>
</tt><tt>};</tt><tt><br>
</tt></blockquote>
<br>
Thoughts? <br>
<br>
Matthew Curtis<br>
<br>
[1] <a class="moz-txt-link-freetext" href="http://msdn.microsoft.com/en-us/library/yx1x886y.aspx">http://msdn.microsoft.com/en-us/library/yx1x886y.aspx</a><br>
<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</pre>
</body>
</html>