[PATCH] D14346: Reduce size of MCRelaxableFragment

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 14:40:53 PST 2015


ahatanak added inline comments.

================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:239
@@ -239,1 +238,3 @@
+    EmitInlineAsm(M.getModuleInlineAsm()+"\n",
+                  OutContext.getSubtargetCopy(*STI), TM.Options.MCOptions);
     OutStreamer->AddComment("End of file scope inline assembly");
----------------
rafael wrote:
> Why do you need this copy? The idea is that we create a copy every time we toggle a bit during parsing, no? If so, this should not need a copy.
> 
getSubtargetCopy is called here because STI is a unique_ptr and gets destructed when it goes out of scope. We don't need a copy here, but we need a subtarget object that is kept alive until it is used. 


http://reviews.llvm.org/D14346





More information about the llvm-commits mailing list