(StrVal[1] >= '0' && StrVal[1] <= '9'))) {
// Reparse stringized version!
if (APFloat(APFloat::IEEEdouble, StrVal).convertToDouble() == Val) {
- Out << StrVal.str();
+ Out << StrVal;
return;
}
}
Out << ' ' << getPredicateText(CE->getPredicate());
Out << " (";
+ if (const GEPOperator *GEP = dyn_cast<GEPOperator>(CE)) {
+ TypePrinter.print(
+ cast<PointerType>(GEP->getPointerOperandType()->getScalarType())
+ ->getElementType(),
+ Out);
+ Out << ", ";
+ }
+
for (User::const_op_iterator OI=CE->op_begin(); OI != CE->op_end(); ++OI) {
TypePrinter.print((*OI)->getType(), Out);
Out << ' ';
TypePrinting *, SlotTracker *, const Module *) {
Out << "!MDBasicType(";
FieldSeparator FS;
- writeTag(Out, FS, N);
+ if (N->getTag() != dwarf::DW_TAG_base_type)
+ writeTag(Out, FS, N);
writeStringField(Out, FS, "name", N->getName());
if (N->getSizeInBits())
Out << FS << "size: " << N->getSizeInBits();
FieldSeparator FS;
writeTag(Out, FS, N);
writeStringField(Out, FS, "name", N->getName());
+ if (N->getScope()) {
+ Out << FS << "scope: ";
+ writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
+ }
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
}
if (N->getLine())
Out << FS << "line: " << N->getLine();
- if (N->getScope()) {
- Out << FS << "scope: ";
- writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
- }
Out << FS << "baseType: ";
writeMetadataAsOperand(Out, N->getBaseType(), TypePrinter, Machine, Context);
if (N->getSizeInBits())
FieldSeparator FS;
writeTag(Out, FS, N);
writeStringField(Out, FS, "name", N->getName());
+ if (N->getScope()) {
+ Out << FS << "scope: ";
+ writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
+ }
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
}
if (N->getLine())
Out << FS << "line: " << N->getLine();
- if (N->getScope()) {
- Out << FS << "scope: ";
- writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
- }
if (N->getBaseType()) {
Out << FS << "baseType: ";
writeMetadataAsOperand(Out, N->getBaseType(), TypePrinter, Machine,
const Module *Context) {
Out << "!MDSubprogram(";
FieldSeparator FS;
+ writeStringField(Out, FS, "name", N->getName());
+ writeStringField(Out, FS, "linkageName", N->getLinkageName());
Out << FS << "scope: ";
writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
- writeStringField(Out, FS, "linkageName", N->getLinkageName());
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
const Module *Context) {
Out << "!MDNamespace(";
FieldSeparator FS;
+ writeStringField(Out, FS, "name", N->getName());
Out << FS << "scope: ";
writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine, Context);
}
- writeStringField(Out, FS, "name", N->getName());
if (N->getLine())
Out << FS << "line: " << N->getLine();
Out << ")";
const Module *Context) {
Out << "!MDTemplateTypeParameter(";
FieldSeparator FS;
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
+ writeStringField(Out, FS, "name", N->getName());
Out << FS << "type: ";
writeMetadataAsOperand(Out, N->getType(), TypePrinter, Machine, Context);
Out << ")";
const Module *Context) {
Out << "!MDTemplateValueParameter(";
FieldSeparator FS;
- writeTag(Out, FS, N);
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
- Out << FS << "type: ";
- writeMetadataAsOperand(Out, N->getType(), TypePrinter, Machine, Context);
+ if (N->getTag() != dwarf::DW_TAG_template_value_parameter)
+ writeTag(Out, FS, N);
+ writeStringField(Out, FS, "name", N->getName());
+ if (auto *Type = N->getType()) {
+ Out << FS << "type: ";
+ writeMetadataAsOperand(Out, Type, TypePrinter, Machine, Context);
+ }
Out << FS << "value: ";
writeMetadataAsOperand(Out, N->getValue(), TypePrinter, Machine, Context);
Out << ")";
SlotTracker *Machine, const Module *Context) {
Out << "!MDGlobalVariable(";
FieldSeparator FS;
+ writeStringField(Out, FS, "name", N->getName());
+ writeStringField(Out, FS, "linkageName", N->getLinkageName());
Out << FS << "scope: ";
writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
- writeStringField(Out, FS, "linkageName", N->getLinkageName());
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
Out << "!MDLocalVariable(";
FieldSeparator FS;
writeTag(Out, FS, N);
+ writeStringField(Out, FS, "name", N->getName());
+ if (N->getTag() == dwarf::DW_TAG_arg_variable || N->getArg())
+ Out << FS << "arg: " << N->getArg();
Out << FS << "scope: ";
writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine,
writeMetadataAsOperand(Out, N->getType(), TypePrinter, Machine,
Context);
}
- if (N->getTag() == dwarf::DW_TAG_arg_variable || N->getArg())
- Out << FS << "arg: " << N->getArg();
if (auto Flags = N->getFlags()) {
Out << FS << "flags: ";
writeDIFlags(Out, Flags);
const Module *Context) {
Out << "!MDObjCProperty(";
FieldSeparator FS;
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
+ writeStringField(Out, FS, "name", N->getName());
if (N->getFile()) {
Out << FS << "file: ";
writeMetadataAsOperand(Out, N->getFile(), TypePrinter, Machine, Context);
Out << "!MDImportedEntity(";
FieldSeparator FS;
writeTag(Out, FS, N);
+ writeStringField(Out, FS, "name", N->getName());
Out << FS << "scope: ";
writeMetadataAsOperand(Out, N->getScope(), TypePrinter, Machine, Context);
if (N->getEntity()) {
}
if (N->getLine())
Out << FS << "line: " << N->getLine();
- writeStringField(Out, FS, "name", N->getName(), /* ShouldSkipEmpty */ false);
Out << ")";
}
} else if (const auto *LI = dyn_cast<LoadInst>(&I)) {
Out << ' ';
TypePrinter.print(LI->getType(), Out);
- Out << ", ";
+ Out << ',';
}
// PrintAllTypes - Instructions who have operands of all the same type
printInfoComment(I);
}
-static void WriteMDNodeComment(const MDNode *Node,
- formatted_raw_ostream &Out) {
- if (Node->getNumOperands() < 1)
- return;
-
- Metadata *Op = Node->getOperand(0);
- if (!Op || !isa<MDString>(Op))
- return;
-
- DIDescriptor Desc(Node);
- if (!Desc.Verify())
- return;
-
- unsigned Tag = Desc.getTag();
- Out.PadToColumn(50);
- if (dwarf::TagString(Tag)) {
- Out << "; ";
- Desc.print(Out);
- } else if (Tag == dwarf::DW_TAG_user_base) {
- Out << "; [ DW_TAG_user_base ]";
- }
-}
-
void AssemblyWriter::writeMDNode(unsigned Slot, const MDNode *Node) {
Out << '!' << Slot << " = ";
printMDNodeBody(Node);
void AssemblyWriter::printMDNodeBody(const MDNode *Node) {
WriteMDNodeBodyInternal(Out, Node, &TypePrinter, &Machine, TheModule);
- WriteMDNodeComment(Node, Out);
}
void AssemblyWriter::writeAllAttributeGroups() {