//
string getID(const Value *V, const char *Prefix, const char *FPrefix = 0) {
string Result = FPrefix ? FPrefix : ""; // "Forced prefix"
-
+
Result += V->hasName() ? V->getName() : string(Prefix);
-
+
// Qualify all internal names with a unique id.
if (!isExternal(V)) {
int valId = idTable->Table.getValSlot(V);
valId = I->second;
}
Result = Result + "_" + itostr(valId);
+
+ // Replace or prefix problem characters in the name
+ Result = getValidSymbolName(Result);
}
-
- return getValidSymbolName(Result);
+
+ return Result;
}
// getID Wrappers - Ensure consistent usage...
{
unsigned Opcode = MI->getOpCode();
- if (TargetInstrDescriptors[Opcode].iclass & M_DUMMY_PHI_FLAG)
+ if (Target.getInstrInfo().isDummyPhiInstr(Opcode))
return; // IGNORE PHI NODES
- toAsm << "\t" << TargetInstrDescriptors[Opcode].opCodeString << "\t";
+ toAsm << "\t" << Target.getInstrInfo().getName(Opcode) << "\t";
unsigned Mask = getOperandMask(Opcode);
if (NeedComma) toAsm << ", "; // Handle comma outputing
NeedComma = true;
N = printOperands(MI, OpNum);
- }
- else
- N = 1;
+ } else
+ N = 1;
toAsm << "\n";
}