Identify predicate and optional-def operands when printing machine
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 19 Jan 2010 22:08:34 +0000 (22:08 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 19 Jan 2010 22:08:34 +0000 (22:08 +0000)
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93925 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineInstr.cpp

index d58a0fb01a993e5248d6cd11b0bba4dde246b5ff..ef2fceef257044876c09baa892ee0c76ccecbf0a 100644 (file)
@@ -1162,6 +1162,13 @@ void MachineInstr::print(raw_ostream &OS, const TargetMachine *TM) const {
 
     if (FirstOp) FirstOp = false; else OS << ",";
     OS << " ";
+    if (i < getDesc().NumOperands) {
+      const TargetOperandInfo &TOI = getDesc().OpInfo[i];
+      if (TOI.isPredicate())
+        OS << "pred:";
+      if (TOI.isOptionalDef())
+        OS << "opt:";
+    }
     MO.print(OS, TM);
   }