[PATCH] D44255: MIR-Canon tests and helper function additions.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 10 23:09:26 PST 2018


plotfi marked 6 inline comments as done.
plotfi added inline comments.


================
Comment at: lib/CodeGen/MIRCanonicalizerPass.cpp:145-146
+    std::string s;
+    raw_string_ostream sstr(s);
+    II->print(sstr);
+
----------------
bogner wrote:
> I think we usually put raw_string_ostream stuff in its own block to ensure it flushes or something. Please check other uses to see if this is right.
.str() appears to call flush():

raw_ostream.h:478:

  std::string& str() {
    flush();
    return OS;
  }


================
Comment at: lib/CodeGen/MIRCanonicalizerPass.cpp:173
+  MachineBasicBlock *MBB = MI->getParent();
+  for (auto BBI = MBB->instr_begin(), BBE = MBB->instr_end(); BBI != BBE; ++BBI)
+    if (&*BBI == MI)
----------------
bogner wrote:
> Range-for probably cleans this up a bit.
Going to leave this one out in first commit. 


Repository:
  rL LLVM

https://reviews.llvm.org/D44255





More information about the llvm-commits mailing list