<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 10:15 PM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Yeah I fixed it almost immediately in r267104: <a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3875" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3875</a><div><br></div><div>MSVC is happy with a move of the enum to create the std::pair. I have no idea why but I'm interested to understand if you know?</div></div></blockquote><div><br></div><div>No clue.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div></font></span><div><div class="h5"><div><br><div><div><blockquote type="cite"><div>On Apr 21, 2016, at 10:04 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:</div><br><div><div dir="ltr">This seems to break VS2015: <a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3874" target="_blank">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/3874</a><div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 21, 2016 at 9:28 PM, Mehdi Amini via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: mehdi_amini<br>
Date: Thu Apr 21 23:28:05 2016<br>
New Revision: 267103<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267103&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267103&view=rev</a><br>
Log:<br>
Refactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse inline assembly (NFC)<br>
<br>
I plan to call this from ThinLTOCodeGenerator.<br>
<br>
From: Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>><br>
<br>
Modified:<br>
llvm/trunk/include/llvm/Object/IRObjectFile.h<br>
llvm/trunk/lib/Object/IRObjectFile.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/Object/IRObjectFile.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/IRObjectFile.h?rev=267103&r1=267102&r2=267103&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/IRObjectFile.h?rev=267103&r1=267102&r2=267103&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Object/IRObjectFile.h (original)<br>
+++ llvm/trunk/include/llvm/Object/IRObjectFile.h Thu Apr 21 23:28:05 2016<br>
@@ -59,6 +59,16 @@ public:<br>
/// error code if not found.<br>
static ErrorOr<MemoryBufferRef> findBitcodeInObject(const ObjectFile &Obj);<br>
<br>
+ /// Parse inline ASM and collect the symbols that are not defined in<br>
+ /// the current module.<br>
+ ///<br>
+ /// For each found symbol, call \p AsmUndefinedRefs with the name of the<br>
+ /// symbol found and the associated flags.<br>
+ static void CollectAsmUndefinedRefs(<br>
+ Module &TheModule,<br>
+ const std::function<void(StringRef, BasicSymbolRef::Flags)> &<br>
+ AsmUndefinedRefs);<br>
+<br>
/// \brief Finds and returns bitcode in the given memory buffer (which may<br>
/// be either a bitcode file or a native object file with embedded bitcode),<br>
/// or an error code if not found.<br>
<br>
Modified: llvm/trunk/lib/Object/IRObjectFile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=267103&r1=267102&r2=267103&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/IRObjectFile.cpp?rev=267103&r1=267102&r2=267103&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Object/IRObjectFile.cpp (original)<br>
+++ llvm/trunk/lib/Object/IRObjectFile.cpp Thu Apr 21 23:28:05 2016<br>
@@ -38,12 +38,24 @@ using namespace object;<br>
IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod)<br>
: SymbolicFile(Binary::ID_IR, Object), M(std::move(Mod)) {<br>
Mang.reset(new Mangler());<br>
+ CollectAsmUndefinedRefs(*M, [this](StringRef Name,<br>
+ BasicSymbolRef::Flags Flags) {<br>
+ AsmSymbols.push_back(std::make_pair<std::string, uint32_t>(Name, Flags));<br>
+ });<br>
+}<br>
+<br>
+// Parse inline ASM and collect the list of symbols that are not defined in<br>
+// the current module. This is inspired from IRObjectFile.<br>
+void IRObjectFile::CollectAsmUndefinedRefs(<br>
+ Module &TheModule,<br>
+ const std::function<void(StringRef, BasicSymbolRef::Flags)> &<br>
+ AsmUndefinedRefs) {<br>
<br>
- const std::string &InlineAsm = M->getModuleInlineAsm();<br>
+ const std::string &InlineAsm = TheModule.getModuleInlineAsm();<br>
if (InlineAsm.empty())<br>
return;<br>
<br>
- Triple TT(M->getTargetTriple());<br>
+ Triple TT(TheModule.getTargetTriple());<br>
std::string Err;<br>
const Target *T = TargetRegistry::lookupTarget(TT.str(), Err);<br>
if (!T)<br>
@@ -106,8 +118,7 @@ IRObjectFile::IRObjectFile(MemoryBufferR<br>
Res |= BasicSymbolRef::SF_Global;<br>
break;<br>
}<br>
- AsmSymbols.push_back(<br>
- std::make_pair<std::string, uint32_t>(Key, std::move(Res)));<br>
+ AsmUndefinedRefs(Key, BasicSymbolRef::Flags(Res));<br>
}<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div>