[PATCH] D23164: [SelectionDAG] Refactor visitInlineAsm a bit. NFCI.

Anton Korobeynikov via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 08:07:04 PDT 2016


asl added a subscriber: asl.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6458
@@ +6457,3 @@
+    // Indirect operand accesses access memory.
+    if (isIndirect)
+      HasMemory = true;
----------------
Early return

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6461
@@ +6460,3 @@
+    else {
+      for (unsigned j = 0, ee = Codes.size(); j != ee; ++j) {
+        TargetLowering::ConstraintType CType = TLI.getConstraintType(Codes[j]);
----------------
Could you use range-for?

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:6531
@@ +6530,3 @@
+                               SelectionDAG &DAG) {
+  if (OpInfo.ConstraintVT != MatchingOpInfo.ConstraintVT) {
+    const TargetRegisterInfo *TRI = DAG.getSubtarget().getRegisterInfo();
----------------
Again, reduce indent level by using early return


https://reviews.llvm.org/D23164





More information about the llvm-commits mailing list