<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;">Do you mean like:
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>$ swiftc -O moof.sil -o moof -Xfrontend -assume-parsing-unqualified-ownership-sil</div>
</blockquote>
<div><br /></div>
<div>It seems like the `-assume-parsing-unqualified-ownership-sil` argument isn’t understood without the -Xfrontend flag.</div>
<div><br /></div>
<div>The above command results in a different error:</div>
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>
<div>Cannot construct Inlined loc from the given location.</div>
</div>
<div>
<div>UNREACHABLE executed at /swift/lib/SIL/SILLocation.cpp:209!</div>
</div>
<div>
<div>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>
<div>1 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010ee69b86 SignalHandler(int) + 454</div>
</div>
<div>
<div>2 &#160;libsystem_platform.dylib 0x00007fffa3c8eb3a _sigtramp + 26</div>
</div>
<div>
<div>3 &#160;libsystem_platform.dylib 0x0000000100000001 _sigtramp + 1547113697</div>
</div>
<div>
<div>4 &#160;libsystem_c.dylib &#160; &#160; &#160; &#160;0x00007fffa3b13420 abort + 129</div>
</div>
<div>
<div>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>
<div>6 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c670d83 swift::InlinedLocation::getInlinedLocation(swift::SILLocation) + 387</div>
</div>
<div>
<div>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>
<div>8 &#160;swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c48f93e (anonymous namespace)::SILPerformanceInlinerPass::run() + 1854</div>
</div>
<div>
<div>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>
<div>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>
<div>11 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3cb8d4 swift::SILPassManager::runOneIteration() + 948</div>
</div>
<div>
<div>12 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010bca963b swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&amp;) + 187</div>
</div>
<div>
<div>13 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010c3d4322 swift::runSILOptimizationPasses(swift::SILModule&amp;) + 114</div>
</div>
<div>
<div>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>
<div>15 swift &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;0x000000010bb0f8f0 main + 3312</div>
</div>
<div>
<div>16 libdyld.dylib &#160; &#160; &#160; &#160; &#160; &#160;0x00007fffa3a7f235 start + 1</div>
</div>
<div>
<div>17 libdyld.dylib &#160; &#160; &#160; &#160; &#160; &#160;0x000000000000000f start + 1549274587</div>
</div>
</blockquote>
<br />
<div>So, I tried again without optimizations, and got this instead:</div>
<div><br /></div>
<blockquote style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">
<div>
<div>$ swiftc moof.sil -o moof -Xfrontend -assume-parsing-unqualified-ownership-sil</div>
<div><br /></div>
<div>Undefined symbols for architecture x86_64:</div>
</div>
<div>
<div>&#160; "__T0s27_allocateUninitializedArraySayxG_BptBwlFyp_Tgq5", referenced from:</div>
</div>
<div>
<div>&#160; &#160; &#160; _main in .last_generated-41ab00.o</div>
</div>
<div>
<div>ld: symbol(s) not found for architecture x86_64</div>
</div>
</blockquote>
</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 4, 2017, 2:02 AM -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 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 #3498db;" 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><br class="" /></div>
<div>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 #e67e22;">
<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="" />
https://lists.swift.org/mailman/listinfo/swift-dev<br class="" /></div>
</blockquote>
</div>
<br class="" /></blockquote>
</div>
</body>
</html>