mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
simplify printing of mdstring and Argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92325 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
38cf02ebc9
commit
4a3d3a54eb
@ -57,9 +57,11 @@ static const Module *getModuleFromVal(const Value *V) {
|
|||||||
const Function *M = I->getParent() ? I->getParent()->getParent() : 0;
|
const Function *M = I->getParent() ? I->getParent()->getParent() : 0;
|
||||||
return M ? M->getParent() : 0;
|
return M ? M->getParent() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
||||||
return GV->getParent();
|
return GV->getParent();
|
||||||
|
if (const NamedMDNode *NMD = dyn_cast<NamedMDNode>(V))
|
||||||
|
return NMD->getParent();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2091,13 +2093,6 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
|
|||||||
SlotTracker SlotTable(GV->getParent());
|
SlotTracker SlotTable(GV->getParent());
|
||||||
AssemblyWriter W(OS, SlotTable, GV->getParent(), AAW);
|
AssemblyWriter W(OS, SlotTable, GV->getParent(), AAW);
|
||||||
W.write(GV);
|
W.write(GV);
|
||||||
} else if (const MDString *MDS = dyn_cast<MDString>(this)) {
|
|
||||||
TypePrinting TypePrinter;
|
|
||||||
TypePrinter.print(MDS->getType(), OS);
|
|
||||||
OS << ' ';
|
|
||||||
OS << "!\"";
|
|
||||||
PrintEscapedString(MDS->getString(), OS);
|
|
||||||
OS << '"';
|
|
||||||
} else if (const MDNode *N = dyn_cast<MDNode>(this)) {
|
} else if (const MDNode *N = dyn_cast<MDNode>(this)) {
|
||||||
SlotTracker SlotTable(N);
|
SlotTracker SlotTable(N);
|
||||||
TypePrinting TypePrinter;
|
TypePrinting TypePrinter;
|
||||||
@ -2123,10 +2118,8 @@ void Value::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
|
|||||||
TypePrinter.print(C->getType(), OS);
|
TypePrinter.print(C->getType(), OS);
|
||||||
OS << ' ';
|
OS << ' ';
|
||||||
WriteConstantInt(OS, C, TypePrinter, 0);
|
WriteConstantInt(OS, C, TypePrinter, 0);
|
||||||
} else if (const Argument *A = dyn_cast<Argument>(this)) {
|
} else if (isa<InlineAsm>(this) || isa<MDString>(this) ||
|
||||||
WriteAsOperand(OS, this, true,
|
isa<Argument>(this)) {
|
||||||
A->getParent() ? A->getParent()->getParent() : 0);
|
|
||||||
} else if (isa<InlineAsm>(this)) {
|
|
||||||
WriteAsOperand(OS, this, true, 0);
|
WriteAsOperand(OS, this, true, 0);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise we don't know what it is. Call the virtual function to
|
// Otherwise we don't know what it is. Call the virtual function to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user