[PATCH] D40169: [AMDGPU] add labels to +DumpCode output

Tim Renouf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 15:28:03 PST 2017


tpr added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.h:200
 protected:
-  std::vector<std::string> DisasmLines, HexLines;
-  size_t DisasmLineMaxLen;
+  mutable std::vector<std::string> DisasmLines, HexLines;
+  mutable size_t DisasmLineMaxLen;
----------------
arsenm wrote:
> Using mutable here is questionable
Yes. The alternative is to do the label in EmitInstruction with a hack to tell when you have changed basic block, possibly including a non-thread-safe static variable. Would you prefer that?

In defense of using mutable, I think we all recognize +dumpcode as a hack that needs to be removed. This mutable would go with it.


https://reviews.llvm.org/D40169





More information about the llvm-commits mailing list