<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Hi Duncan,<div> </div><div>Thanks for your prompt reply. Good to know that GCC ADA front end supports this. Since I need to compile a huge c++ project, I am in need of a c++ compiler supporting thread local storage for non POD types. Intel's c++ compiler does but its non commercial license does not suit my research work. If you know any other c++ compiler kindly let me know.</div>
<div><br></div><div>Note: apologies as I replied to your personal id instead of group</div><div><br></div><div>Thanks for your time,</div><div>karthik</div></span><br><div class="gmail_quote">On Wed, May 4, 2011 at 2:54 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Karthik,<br>
<div class="im"><br>
> I am new to llvm. Does llvm has support for openmp directives like #pragma<br>
> openmp threadprivate(var)?<br>
<br>
</div>LLVM has no special support for openmp.  The LLVM front-ends that support<br>
openmp, namely llvm-gcc and dragonegg, lower openmp constructs down to<br>
library calls the same way GCC does.  This is no coincidence: both of those<br>
front-ends are based on GCC and just let the GCC machinery take care of openmp.<br>
The clang front-end does not support openmp.<br>
<div class="im"><br>
  If so does the variable 'var' can be class objects<br>
> instead of Plain Old Datatypes (POD) like int, float etc. g++ allows the #pragma<br>
> openmp threadprivate(var) primitive only for the POD type. Please check the bug<br>
> link at <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27557" target="_blank">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27557</a> . Please let me know.<br>
<br>
</div>You are out of luck: if GCC rejects this then so will llvm-gcc and dragonegg.<br>
That said, the GCC Ada front-end does support thread-local storage non-POD<br>
types, so it can be done - but it jumps through a lot of hoops and the result<br>
is not very efficient.  There's a big comment in gcc/ada/a-tasatt.adb explaining<br>
how it is done and why that scheme was chosen.  You may enjoy these lines from<br>
the start of the comment:<br>
<br>
   The following notes are provided in case someone decides the implementation<br>
   of this package is too complicated, or too slow. Please read this before<br>
   making any "simplifications".<br>
<br>
Ciao, Duncan.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br>