<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">If the hash value of the module is different then most likely something else is going on -- are you passing any special flags or defines as part of the compiler command? If you run the same command from swiftc on the command line do you see the same behavior?<div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 29, 2016, at 2:08 PM, Ramakrishna Mallireddy &lt;<a href="mailto:ramakrishna.malli@gmail.com" class="">ramakrishna.malli@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Every-time I run swift frontend the clang creates a new cachedir with modulecache path hash(on every run the hash value is different for the same input string) as the name of the dir and generates default cocoa framework pcm files inside it.<div class=""><br class=""></div><div class="">I am using the swift front-end c++ api's to compile a simple swift file.</div><div class="">If I set the -fdisable-module-hash, then pcm files are generated without the hash as required under the ModuleCache Dir.</div><div class="">so problem is solved as clang now see the existing pcm files, but now I hit the next hurdle.</div><div class=""><br class=""></div><div class="">Now the pcm files are there in the cache, when I run the frontend again, I assume clang will load the AST from the pcm files but clang <b class="">ReadAST </b>returns with<b class="">&nbsp;</b><b class="">ASTReader::OutOfDate </b>and as usual it calls<b class="">&nbsp;</b><b class="">compileAndLoadModule </b>which I want to avoid in the first place<b class="">.</b></div><div class=""><br class=""></div><div class=""><span class="">Call to <b class="">CLang</b>::</span><b class="">CompilerInstance</b>::<span class=""><b class="">ModuleManager</b></span><span class="">-&gt;</span><span class=""><b class="">ReadAST</b></span><span class="">(ModuleFileName,</span></div>







<div class=""><p class=""><span class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span class="">serialization</span><span class="">::</span><span class="">MK_ImplicitModule</span><span class="">,</span></p><p class=""><span class="">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImportLoc, ARRFlags)&nbsp;</span><span class="">return with&nbsp;</span><b class="">ASTReader::OutOfDate</b></p><p class=""><span class="">as&nbsp;</span><span class=""><b class="">ReadASTCore</b>(FileName, Type, ImportLoc,&nbsp;</span><span class="">&nbsp;</span><span class="">/*ImportedBy=*/</span><span class="">nullptr</span><span class="">, Loaded,&nbsp;</span><span class="">0</span><span class="">, </span><span class="">0</span><span class="">, </span><span class="">0</span><span class="">,&nbsp;</span>ClientLoadCapabilities) returns with&nbsp;<b class="">OutOfDate.</b></p><p class="">These files are generated just few minutes ago, how can it be OutOfDate I don't have any idea.</p><p class="">File<b class=""> modules.timestamp</b>&nbsp;under the ModuleCache Dir is 0 bytes.</p><p class="">Thanks</p><p class="">Ramakrishna</p>































</div>







</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 29, 2016 at 9:15 PM, Daniel Dunbar <span dir="ltr" class="">&lt;<a href="mailto:daniel_dunbar@apple.com" target="_blank" class="">daniel_dunbar@apple.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Clang will cache these automatically, can you give more details on exactly what you are seeing?<br class="">
<br class="">
&nbsp;- Daniel<br class="">
<div class=""><div class="h5"><br class="">
&gt; On Apr 28, 2016, at 10:50 PM, Ramakrishna Mallireddy via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt; I have these precompiled module files generated every-time I run the swift compiler.<br class="">
&gt;<br class="">
&gt; _Builtin_stddef_max_align_t-1LMTETLX3WNFT.pcm<br class="">
&gt; CFNetwork-1UTIO6DPB9R5P.pcm<br class="">
&gt; CoreFoundation-CF8BGN41VJ11.pcm<br class="">
&gt; CoreGraphics-3SDFP08OX46EF.pcm<br class="">
&gt; CoreImage-3SDFP08OX46EF.pcm<br class="">
&gt; Darwin-4F8STAM1KXDF.pcm<br class="">
&gt; Foundation-2LQ7EQYFLQOP.pcm<br class="">
&gt; ...etc<br class="">
&gt;<br class="">
&gt; How can I make the swift compiler to use these cache rather than compiling the libraries again.<br class="">
&gt;<br class="">
&gt; Thanks<br class="">
&gt; Ramakrishna<br class="">
</div></div>&gt; _______________________________________________<br class="">
&gt; swift-users mailing list<br class="">
&gt; <a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>