Can you add a comment explaining why this is necessary? Other than that, lgtm. Feel free to submit after adding the comment <br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 24, 2018 at 3:14 PM Stella Stamenova via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">stella.stamenova updated this revision to Diff 157140.<br>
stella.stamenova added a comment.<br>
<br>
Follow Zachary's advise and do not force no inline in the case of clang.<br>
<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D49753" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49753</a><br>
<br>
Files:<br>
utils/TableGen/FixedLenDecoderEmitter.cpp<br>
<br>
<br>
Index: utils/TableGen/FixedLenDecoderEmitter.cpp<br>
===================================================================<br>
--- utils/TableGen/FixedLenDecoderEmitter.cpp<br>
+++ utils/TableGen/FixedLenDecoderEmitter.cpp<br>
@@ -2066,7 +2066,10 @@<br>
static void emitFieldFromInstruction(formatted_raw_ostream &OS) {<br>
OS << "// Helper function for extracting fields from encoded instructions.\n"<br>
<< "template<typename InsnType>\n"<br>
- << "static InsnType fieldFromInstruction(InsnType insn, unsigned startBit,\n"<br>
+ << "#if defined(_MSC_VER) && !defined(__clang__)\n"<br>
+ << "__declspec(noinline)\n"<br>
+ << "#endif\n"<br>
+ << "static InsnType fieldFromInstruction(InsnType insn, unsigned startBit,\n"<br>
<< " unsigned numBits) {\n"<br>
<< " assert(startBit + numBits <= (sizeof(InsnType)*8) &&\n"<br>
<< " \"Instruction field out of bounds!\");\n"<br>
<br>
<br>
</blockquote></div>