<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Yep, <a href="https://gist.github.com/ben-ng/6a75ef5b8e931c2458bf625704bb4087">here’s a gist</a>.</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
Ben Ng
<div><a href="https://benng.me/">https://benng.me</a><br /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On Apr 6, 2017, 9:00 PM -0400, Michael Gottesman &lt;mgottesman@apple.com&gt;, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;"><br class="" />
<div>
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">On Apr 6, 2017, at 5:07 PM, Ben Ng &lt;<a href="mailto:me@benng.me" class="">me@benng.me</a>&gt; wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">It doesn’t look like it:
<div class=""><br class="" /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class="">
<div class="">swift (LLVM option parsing): Unknown command line argument '-assume-parsing-unqualified-ownership-sil'. &#160;Try: 'swift (LLVM option parsing) -help'</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<div><br class="" /></div>
<div>I misunderstood what you said before (I thought you said that it didn't work as a frontend flag). My bad.</div>
<br class="" />
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class=""></blockquote>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
Ben Ng
<div class=""><a href="https://benng.me/" class="">https://benng.me</a><br class="" /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
On Apr 4, 2017, 11:37 PM -0400, Michael Gottesman &lt;<a href="mailto:mgottesman@apple.com" class="">mgottesman@apple.com</a>&gt;, wrote:<br class="" />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class="">I think it is an -Xllvm option.<br class="" />
<div class="">
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div class="">On Apr 4, 2017, at 7:41 PM, Ben Ng &lt;<a href="mailto:me@benng.me" class="">me@benng.me</a>&gt; wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">Do you mean like:
<div class=""><br class="" /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class="">
<div class="">$ swiftc -O moof.sil -o moof -Xfrontend -assume-parsing-unqualified-ownership-sil</div>
</blockquote>
<div class=""><br class="" /></div>
<div class="">It seems like the `-assume-parsing-unqualified-ownership-sil` argument isn’t understood without the -Xfrontend flag.</div>
<div class=""><br class="" /></div>
<div class="">The above command results in a different error:</div>
<div class=""><br class="" /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class="">
<div class="">
<div class="">Cannot construct Inlined loc from the given location.</div>
</div>
<div class="">
<div class="">UNREACHABLE executed at /swift/lib/SIL/SILLocation.cpp:209!</div>
</div>
<div class="">
<div class="">0 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010ee694d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) + 40</div>
</div>
<div class="">
<div class="">1 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010ee69b86 SignalHandler(int) + 454</div>
</div>
<div class="">
<div class="">2 &#160;libsystem_platform.dylib 0x00007fffa3c8eb3a _sigtramp + 26</div>
</div>
<div class="">
<div class="">3 &#160;libsystem_platform.dylib 0x0000000100000001 _sigtramp + 1547113697</div>
</div>
<div class="">
<div class="">4 &#160;libsystem_c.dylib &#160; &#160; &#160; &#160;0x00007fffa3b13420 abort + 129</div>
</div>
<div class="">
<div class="">5 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010ee06bd7 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 471</div>
</div>
<div class="">
<div class="">6 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c670d83 swift::InlinedLocation::getInlinedLocation(swift::SILLocation) + 387</div>
</div>
<div class="">
<div class="">7 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3a64af swift::SILInliner::inlineFunction(swift::FullApplySite, llvm::ArrayRef&lt;swift::SILValue&gt;) + 255</div>
</div>
<div class="">
<div class="">8 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c48f93e (anonymous namespace)::SILPerformanceInlinerPass::run() + 1854</div>
</div>
<div class="">
<div class="">9 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3c9732 swift::SILPassManager::runPassOnFunction(swift::SILFunctionTransform*, swift::SILFunction*) + 2258</div>
</div>
<div class="">
<div class="">10 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3ca5ba swift::SILPassManager::runFunctionPasses(llvm::ArrayRef&lt;swift::SILFunctionTransform*&gt;) + 1082</div>
</div>
<div class="">
<div class="">11 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3cb8d4 swift::SILPassManager::runOneIteration() + 948</div>
</div>
<div class="">
<div class="">12 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010bca963b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&amp;) + 187</div>
</div>
<div class="">
<div class="">13 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3d4322 swift::runSILOptimizationPasses(swift::SILModule&amp;) + 114</div>
</div>
<div class="">
<div class="">14 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010bb54fb7 swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 12887</div>
</div>
<div class="">
<div class="">15 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010bb0f8f0 main + 3312</div>
</div>
<div class="">
<div class="">16 libdyld.dylib &#160; &#160; &#160; &#160; &#160; &#160;0x00007fffa3a7f235 start + 1</div>
</div>
<div class="">
<div class="">17 libdyld.dylib &#160; &#160; &#160; &#160; &#160; &#160;0x000000000000000f start + 1549274587</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<div><br class="" /></div>
<div>This is a different issue. Can you post the SIL? I am also not the best person to look at that. A better person would be Adrian (+CC).</div>
<br class="" />
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">
<div class="">
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class="">
<div class="">
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class="">
<div class=""></div>
</blockquote>
<br class="" />
<div class="">So, I tried again without optimizations, and got this instead:</div>
<div class=""><br class="" /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class="">
<div class="">
<div class="">$ swiftc moof.sil -o moof -Xfrontend -assume-parsing-unqualified-ownership-sil</div>
<div class=""><br class="" /></div>
<div class="">Undefined symbols for architecture x86_64:</div>
</div>
<div class="">
<div class="">&#160; "__T0s27_allocateUninitializedArraySayxG_BptBwlFyp_Tgq5", referenced from:</div>
</div>
<div class="">
<div class="">&#160; &#160; &#160; _main in .last_generated-41ab00.o</div>
</div>
<div class="">
<div class="">ld: symbol(s) not found for architecture x86_64</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
<div><br class="" /></div>
<div>Again, can you post the SIL.</div>
<div><br class="" /></div>
<div>Michael</div>
<br class="" />
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">
<div class="">
<div class="">
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #3498db;" class="">
<div class="">
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #d35400;">
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class="">
<div class=""></div>
</blockquote>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
Ben Ng
<div class=""><a href="https://benng.me/" class="">https://benng.me</a><br class="" /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
On Apr 4, 2017, 2:02 AM -0400, Michael Gottesman &lt;<a href="mailto:mgottesman@apple.com" class="">mgottesman@apple.com</a>&gt;, wrote:<br class="" />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #34495e;" class=""><br class="" />
<div class="">
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #2ecc71;">
<div class="">On Apr 3, 2017, at 7:55 PM, Ben Ng via swift-dev &lt;<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>&gt; wrote:</div>
<br class="Apple-interchange-newline" />
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class="">
<div class="">
<div class="">I see that <a href="https://bugs.swift.org/browse/SR-3774" class="">SR-3774</a> already exists, but that ticket was about declarations not appearing in the emitted SIL.</div>
<div class=""><br class="" /></div>
<div class="">I'm able to get declarations to appear with the -frontend flag, but the emitted SIL <i class="">still</i> doesn't parse on master:<br class="" /></div>
</div>
<div class=""><br class="" /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #9b59b6;" class="">
<div class="">
<div class="">$ &#160;echo 'print("moof")' &gt; test.swift</div>
</div>
<div class="">
<div class="">$ &#160;swiftc -frontend -emit-sil test.swift &gt; test.sil</div>
</div>
<div class="">
<div class="">$ &#160;swiftc -parse-sil test.sil</div>
</div>
<div class=""><br class="" /></div>
<div class="">Assertion failed: ((Qualifier != StoreOwnershipQualifier::Unqualified) || F.hasUnqualifiedOwnership() &amp;&amp; "Unqualified inst in qualified function"), function createStore, file /swift-dev/swift/include/swift/SIL/SILBuilder.h, line 503.</div>
<div class="">0 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011298d4d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;) + 40</div>
<div class="">1 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011298db86 SignalHandler(int) + 454</div>
<div class="">2 &#160;libsystem_platform.dylib 0x00007fffa48ceb3a _sigtramp + 26</div>
<div class="">3 &#160;libsystem_platform.dylib 000000000000000000 _sigtramp + 1534268640</div>
<div class="">4 &#160;libsystem_c.dylib &#160; &#160; &#160; &#160;0x00007fffa4753420 abort + 129</div>
<div class="">5 &#160;libsystem_c.dylib &#160; &#160; &#160; &#160;0x00007fffa471a893 basename_r + 0</div>
<div class="">6 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011017b2fc swift::SILBuilder::createStore(swift::SILLocation, swift::SILValue, swift::SILValue, swift::StoreOwnershipQualifier) + 396</div>
<div class="">7 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011038ddec (anonymous namespace)::SILParser::parseSILInstruction(swift::SILBasicBlock*, swift::SILBuilder&amp;) + 70412</div>
<div class="">8 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x0000000110373217 swift::Parser::parseDeclSIL() + 5111</div>
<div class="">9 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011033112d swift::Parser::parseTopLevel() + 269</div>
<div class="">10 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x0000000110367edb swift::parseIntoSourceFile(swift::SourceFile&amp;, unsigned int, bool*, swift::SILParserState*, swift::PersistentParserState*, swift::DelayedParsingCallbacks*) + 283</div>
<div class="">11 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000011011da0c swift::CompilerInstance::performSema() + 3580</div>
<div class="">12 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010f676f6d swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 4621</div>
<div class="">13 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010f6338f0 main + 3312</div>
<div class="">14 libdyld.dylib &#160; &#160; &#160; &#160; &#160; &#160;0x00007fffa46bf235 start + 1</div>
</blockquote>
<br class="" />
<div class="">Is this a bug? Am I using the wrong combination of flags?</div>
</div>
</div>
</div>
</blockquote>
<div class=""><br class="" /></div>
<div class="">You need the flag -assume-parsing-unqualified-ownership-sil.</div>
<br class="" />
<blockquote type="cite" class="" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #2ecc71;">
<div class="">
<div class="">
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""></div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;" class=""><br class="" />
Ben Ng
<div class=""><a href="https://benng.me/" class="">https://benng.me</a><br class="" /></div>
</div>
</div>
_______________________________________________<br class="" />
swift-dev mailing list<br class="" />
<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="" />
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class="" /></div>
</blockquote>
</div>
<br class="" /></blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="" /></blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br class="" /></blockquote>
</div>
</body>
</html>