Lines Matching refs:Out

69 static void PrintCallingConv(unsigned cc, raw_ostream &Out) {
71 default: Out << "cc" << cc; break;
72 case CallingConv::Fast: Out << "fastcc"; break;
73 case CallingConv::Cold: Out << "coldcc"; break;
74 case CallingConv::WebKit_JS: Out << "webkit_jscc"; break;
75 case CallingConv::AnyReg: Out << "anyregcc"; break;
76 case CallingConv::PreserveMost: Out << "preserve_mostcc"; break;
77 case CallingConv::PreserveAll: Out << "preserve_allcc"; break;
78 case CallingConv::X86_StdCall: Out << "x86_stdcallcc"; break;
79 case CallingConv::X86_FastCall: Out << "x86_fastcallcc"; break;
80 case CallingConv::X86_ThisCall: Out << "x86_thiscallcc"; break;
81 case CallingConv::Intel_OCL_BI: Out << "intel_ocl_bicc"; break;
82 case CallingConv::ARM_APCS: Out << "arm_apcscc"; break;
83 case CallingConv::ARM_AAPCS: Out << "arm_aapcscc"; break;
84 case CallingConv::ARM_AAPCS_VFP: Out << "arm_aapcs_vfpcc"; break;
85 case CallingConv::MSP430_INTR: Out << "msp430_intrcc"; break;
86 case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break;
87 case CallingConv::PTX_Device: Out << "ptx_device"; break;
88 case CallingConv::X86_64_SysV: Out << "x86_64_sysvcc"; break;
89 case CallingConv::X86_64_Win64: Out << "x86_64_win64cc"; break;
90 case CallingConv::SPIR_FUNC: Out << "spir_func"; break;
91 case CallingConv::SPIR_KERNEL: Out << "spir_kernel"; break;
97 static void PrintEscapedString(StringRef Name, raw_ostream &Out) {
101 Out << C;
103 Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
676 static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
714 static void writeAtomicRMWOperation(raw_ostream &Out,
717 default: Out << " <unknown operation " << Op << ">"; break;
718 case AtomicRMWInst::Xchg: Out << " xchg"; break;
719 case AtomicRMWInst::Add: Out << " add"; break;
720 case AtomicRMWInst::Sub: Out << " sub"; break;
721 case AtomicRMWInst::And: Out << " and"; break;
722 case AtomicRMWInst::Nand: Out << " nand"; break;
723 case AtomicRMWInst::Or: Out << " or"; break;
724 case AtomicRMWInst::Xor: Out << " xor"; break;
725 case AtomicRMWInst::Max: Out << " max"; break;
726 case AtomicRMWInst::Min: Out << " min"; break;
727 case AtomicRMWInst::UMax: Out << " umax"; break;
728 case AtomicRMWInst::UMin: Out << " umin"; break;
732 static void WriteOptimizationInfo(raw_ostream &Out, const User *U) {
736 Out << " fast";
739 Out << " nnan";
741 Out << " ninf";
743 Out << " nsz";
745 Out << " arcp";
752 Out << " nuw";
754 Out << " nsw";
758 Out << " exact";
761 Out << " inbounds";
765 static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
771 Out << (CI->getZExtValue() ? "true" : "false");
774 Out << CI->getValue();
806 Out << StrVal.str();
823 Out << "0x" <<
832 Out << "0x";
837 Out << 'K';
847 Out << (unsigned char)(nibble + '0');
849 Out << (unsigned char)(nibble - 10 + 'A');
860 Out << 'L';
863 Out << 'M';
866 Out << 'H';
877 Out << (unsigned char)(nibble + '0');
879 Out << (unsigned char)(nibble - 10 + 'A');
891 Out << "zeroinitializer";
896 Out << "blockaddress(";
897 WriteAsOperandInternal(Out, BA->getFunction(), &TypePrinter, Machine,
899 Out << ", ";
900 WriteAsOperandInternal(Out, BA->getBasicBlock(), &TypePrinter, Machine,
902 Out << ")";
908 Out << '[';
909 TypePrinter.print(ETy, Out);
910 Out << ' ';
911 WriteAsOperandInternal(Out, CA->getOperand(0),
915 Out << ", ";
916 TypePrinter.print(ETy, Out);
917 Out << ' ';
918 WriteAsOperandInternal(Out, CA->getOperand(i), &TypePrinter, Machine,
921 Out << ']';
929 Out << "c\"";
930 PrintEscapedString(CA->getAsString(), Out);
931 Out << '"';
936 Out << '[';
937 TypePrinter.print(ETy, Out);
938 Out << ' ';
939 WriteAsOperandInternal(Out, CA->getElementAsConstant(0),
943 Out << ", ";
944 TypePrinter.print(ETy, Out);
945 Out << ' ';
946 WriteAsOperandInternal(Out, CA->getElementAsConstant(i), &TypePrinter,
949 Out << ']';
956 Out << '<';
957 Out << '{';
960 Out << ' ';
961 TypePrinter.print(CS->getOperand(0)->getType(), Out);
962 Out << ' ';
964 WriteAsOperandInternal(Out, CS->getOperand(0), &TypePrinter, Machine,
968 Out << ", ";
969 TypePrinter.print(CS->getOperand(i)->getType(), Out);
970 Out << ' ';
972 WriteAsOperandInternal(Out, CS->getOperand(i), &TypePrinter, Machine,
975 Out << ' ';
978 Out << '}';
980 Out << '>';
986 Out << '<';
987 TypePrinter.print(ETy, Out);
988 Out << ' ';
989 WriteAsOperandInternal(Out, CV->getAggregateElement(0U), &TypePrinter,
992 Out << ", ";
993 TypePrinter.print(ETy, Out);
994 Out << ' ';
995 WriteAsOperandInternal(Out, CV->getAggregateElement(i), &TypePrinter,
998 Out << '>';
1003 Out << "null";
1008 Out << "undef";
1013 Out << CE->getOpcodeName();
1014 WriteOptimizationInfo(Out, CE);
1016 Out << ' ' << getPredicateText(CE->getPredicate());
1017 Out << " (";
1020 TypePrinter.print((*OI)->getType(), Out);
1021 Out << ' ';
1022 WriteAsOperandInternal(Out, *OI, &TypePrinter, Machine, Context);
1024 Out << ", ";
1030 Out << ", " << Indices[i];
1034 Out << " to ";
1035 TypePrinter.print(CE->getType(), Out);
1038 Out << ')';
1042 Out << "<placeholder or erroneous Constant>";
1045 static void WriteMDNodeBodyInternal(raw_ostream &Out, const MDNode *Node,
1049 Out << "!{";
1053 Out << "null";
1055 TypePrinter->print(V->getType(), Out);
1056 Out << ' ';
1057 WriteAsOperandInternal(Out, Node->getOperand(mi),
1061 Out << ", ";
1064 Out << "}";
1069 static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
1074 PrintLLVMName(Out, V);
1081 WriteConstantInternal(Out, CV, *TypePrinter, Machine, Context);
1086 Out << "asm ";
1088 Out << "sideeffect ";
1090 Out << "alignstack ";
1093 Out << "inteldialect ";
1094 Out << '"';
1095 PrintEscapedString(IA->getAsmString(), Out);
1096 Out << "\", \"";
1097 PrintEscapedString(IA->getConstraintString(), Out);
1098 Out << '"';
1105 WriteMDNodeBodyInternal(Out, N, TypePrinter, Machine, Context);
1117 Out << "<badref>";
1119 Out << '!' << Slot;
1124 Out << "!\"";
1125 PrintEscapedString(MDS->getString(), Out);
1126 Out << '"';
1164 Out << Prefix << Slot;
1166 Out << "<badref>";
1185 : Out(o), TheModule(M), Machine(Mac), AnnotationWriter(AAW) {
1191 : Out(o), TheModule(M), ModuleSlotTracker(createSlotTracker(M)),
1200 Out << "<null operand!>";
1204 TypePrinter.print(Operand->getType(), Out);
1205 Out << ' ';
1207 WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine, TheModule);
1216 case SingleThread: Out << " singlethread"; break;
1221 default: Out << " <bad ordering " << int(Ordering) << ">"; break;
1222 case Unordered: Out << " unordered"; break;
1223 case Monotonic: Out << " monotonic"; break;
1224 case Acquire: Out << " acquire"; break;
1225 case Release: Out << " release"; break;
1226 case AcquireRelease: Out << " acq_rel"; break;
1227 case SequentiallyConsistent: Out << " seq_cst"; break;
1237 case SingleThread: Out << " singlethread"; break;
1242 default: Out << " <bad ordering " << int(SuccessOrdering) << ">"; break;
1243 case Unordered: Out << " unordered"; break;
1244 case Monotonic: Out << " monotonic"; break;
1245 case Acquire: Out << " acquire"; break;
1246 case Release: Out << " release"; break;
1247 case AcquireRelease: Out << " acq_rel"; break;
1248 case SequentiallyConsistent: Out << " seq_cst"; break;
1252 default: Out << " <bad ordering " << int(FailureOrdering) << ">"; break;
1253 case Unordered: Out << " unordered"; break;
1254 case Monotonic: Out << " monotonic"; break;
1255 case Acquire: Out << " acquire"; break;
1256 case Release: Out << " release"; break;
1257 case AcquireRelease: Out << " acq_rel"; break;
1258 case SequentiallyConsistent: Out << " seq_cst"; break;
1265 Out << "<null operand!>";
1270 TypePrinter.print(Operand->getType(), Out);
1273 Out << ' ' << Attrs.getAsString(Idx);
1274 Out << ' ';
1276 WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine, TheModule);
1286 Out << "; ModuleID = '" << M->getModuleIdentifier() << "'\n";
1290 Out << "target datalayout = \"" << DL << "\"\n";
1292 Out << "target triple = \"" << M->getTargetTriple() << "\"\n";
1299 Out << '\n';
1303 Out << "module asm \"";
1305 Out);
1306 Out << "\"\n";
1312 Out << "module asm \"";
1313 PrintEscapedString(rest, Out);
1314 Out << "\"\n";
1322 Out << '\n';
1326 Out << '\n';
1330 if (!M->global_empty()) Out << '\n';
1333 printGlobal(I); Out << '\n';
1337 if (!M->alias_empty()) Out << "\n";
1348 Out << '\n';
1353 if (!M->named_metadata_empty()) Out << '\n';
1361 Out << '\n';
1367 Out << '!';
1370 Out << "<empty name> ";
1375 Out << Name[0];
1377 Out << '\\' << hexdigit(Name[0] >> 4) << hexdigit(Name[0] & 0x0F);
1382 Out << C;
1384 Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
1387 Out << " = !{";
1389 if (i) Out << ", ";
1392 Out << "<badref>";
1394 Out << '!' << Slot;
1396 Out << "}\n";
1401 formatted_raw_ostream &Out) {
1404 case GlobalValue::PrivateLinkage: Out << "private "; break;
1405 case GlobalValue::InternalLinkage: Out << "internal "; break;
1406 case GlobalValue::LinkOnceAnyLinkage: Out << "linkonce "; break;
1407 case GlobalValue::LinkOnceODRLinkage: Out << "linkonce_odr "; break;
1408 case GlobalValue::WeakAnyLinkage: Out << "weak "; break;
1409 case GlobalValue::WeakODRLinkage: Out << "weak_odr "; break;
1410 case GlobalValue::CommonLinkage: Out << "common "; break;
1411 case GlobalValue::AppendingLinkage: Out << "appending "; break;
1412 case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
1414 Out << "available_externally ";
1421 formatted_raw_ostream &Out) {
1424 case GlobalValue::HiddenVisibility: Out << "hidden "; break;
1425 case GlobalValue::ProtectedVisibility: Out << "protected "; break;
1430 formatted_raw_ostream &Out) {
1433 case GlobalValue::DLLImportStorageClass: Out << "dllimport "; break;
1434 case GlobalValue::DLLExportStorageClass: Out << "dllexport "; break;
1439 formatted_raw_ostream &Out) {
1444 Out << "thread_local ";
1447 Out << "thread_local(localdynamic) ";
1450 Out << "thread_local(initialexec) ";
1453 Out << "thread_local(localexec) ";
1460 Out << "; Materializable\n";
1462 WriteAsOperandInternal(Out, GV, &TypePrinter, &Machine, GV->getParent());
1463 Out << " = ";
1466 Out << "external ";
1468 PrintLinkage(GV->getLinkage(), Out);
1469 PrintVisibility(GV->getVisibility(), Out);
1470 PrintDLLStorageClass(GV->getDLLStorageClass(), Out);
1471 PrintThreadLocalModel(GV->getThreadLocalMode(), Out);
1473 Out << "unnamed_addr ";
1476 Out << "addrspace(" << AddressSpace << ") ";
1477 if (GV->isExternallyInitialized()) Out << "externally_initialized ";
1478 Out << (GV->isConstant() ? "constant " : "global ");
1479 TypePrinter.print(GV->getType()->getElementType(), Out);
1482 Out << ' ';
1487 Out << ", section \"";
1488 PrintEscapedString(GV->getSection(), Out);
1489 Out << '"';
1492 Out << ", comdat ";
1493 PrintLLVMName(Out, GV->getComdat()->getName(), ComdatPrefix);
1496 Out << ", align " << GV->getAlignment();
1503 Out << "; Materializable\n";
1507 Out << "<<nameless>> = ";
1509 PrintLLVMName(Out, GA);
1510 Out << " = ";
1512 PrintVisibility(GA->getVisibility(), Out);
1513 PrintDLLStorageClass(GA->getDLLStorageClass(), Out);
1514 PrintThreadLocalModel(GA->getThreadLocalMode(), Out);
1516 Out << "unnamed_addr ";
1518 Out << "alias ";
1520 PrintLinkage(GA->getLinkage(), Out);
1525 TypePrinter.print(GA->getType(), Out);
1526 Out << " <<NULL ALIASEE>>";
1532 Out << '\n';
1536 C->print(Out);
1544 Out << '\n';
1558 Out << '%' << i << " = type ";
1562 TypePrinter.printStructBody(NumberedTypes[i], Out);
1563 Out << '\n';
1567 PrintLLVMName(Out, TypePrinter.NamedTypes[i]->getName(), LocalPrefix);
1568 Out << " = type ";
1572 TypePrinter.printStructBody(TypePrinter.NamedTypes[i], Out);
1573 Out << '\n';
1581 Out << '\n';
1583 if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
1586 Out << "; Materializable\n";
1608 Out << "; Function Attrs: " << AttrStr << '\n';
1612 Out << "declare ";
1614 Out << "define ";
1616 PrintLinkage(F->getLinkage(), Out);
1617 PrintVisibility(F->getVisibility(), Out);
1618 PrintDLLStorageClass(F->getDLLStorageClass(), Out);
1622 PrintCallingConv(F->getCallingConv(), Out);
1623 Out << " ";
1628 Out << Attrs.getAsString(AttributeSet::ReturnIndex) << ' ';
1629 TypePrinter.print(F->getReturnType(), Out);
1630 Out << ' ';
1631 WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent());
1632 Out << '(';
1643 if (I != F->arg_begin()) Out << ", ";
1651 if (i) Out << ", ";
1654 TypePrinter.print(FT->getParamType(i), Out);
1657 Out << ' ' << Attrs.getAsString(i+1);
1663 if (FT->getNumParams()) Out << ", ";
1664 Out << "..."; // Output varargs portion of signature!
1666 Out << ')';
1668 Out << " unnamed_addr";
1670 Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
1672 Out << " section \"";
1673 PrintEscapedString(F->getSection(), Out);
1674 Out << '"';
1677 Out << " comdat ";
1678 PrintLLVMName(Out, F->getComdat()->getName(), ComdatPrefix);
1681 Out << " align " << F->getAlignment();
1683 Out << " gc \"" << F->getGC() << '"';
1685 Out << " prefix ";
1689 Out << '\n';
1691 Out << " {";
1696 Out << "}\n";
1708 TypePrinter.print(Arg->getType(), Out);
1712 Out << ' ' << Attrs.getAsString(Idx);
1716 Out << ' ';
1717 PrintLLVMName(Out, Arg);
1725 Out << "\n";
1726 PrintLLVMName(Out, BB->getName(), LabelPrefix);
1727 Out << ':';
1729 Out << "\n; <label>:";
1732 Out << Slot;
1734 Out << "<badref>";
1738 Out.PadToColumn(50);
1739 Out << "; Error: Block without parent!";
1742 Out.PadToColumn(50);
1743 Out << ";";
1747 Out << " No predecessors!";
1749 Out << " preds = ";
1752 Out << ", ";
1758 Out << "\n";
1760 if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out);
1767 if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out);
1773 Out << '\n';
1781 AnnotationWriter->printInfoComment(V, Out);
1786 if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out);
1789 Out << " ";
1793 PrintLLVMName(Out, &I);
1794 Out << " = ";
1799 Out << "<badref> = ";
1801 Out << '%' << SlotNum << " = ";
1806 Out << "musttail ";
1808 Out << "tail ";
1812 Out << I.getOpcodeName();
1817 Out << " atomic";
1820 Out << " weak";
1827 Out << " volatile";
1830 WriteOptimizationInfo(Out, &I);
1834 Out << ' ' << getPredicateText(CI->getPredicate());
1838 writeAtomicRMWOperation(Out, RMWI->getOperation());
1846 Out << ' ';
1848 Out << ", ";
1850 Out << ", ";
1856 Out << ' ';
1858 Out << ", ";
1860 Out << " [";
1863 Out << "\n ";
1865 Out << ", ";
1868 Out << "\n ]";
1871 Out << ' ';
1873 Out << ", [";
1877 Out << ", ";
1880 Out << ']';
1882 Out << ' ';
1883 TypePrinter.print(I.getType(), Out);
1884 Out << ' ';
1887 if (op) Out << ", ";
1888 Out << "[ ";
1889 writeOperand(PN->getIncomingValue(op), false); Out << ", ";
1890 writeOperand(PN->getIncomingBlock(op), false); Out << " ]";
1893 Out << ' ';
1896 Out << ", " << *i;
1898 Out << ' ';
1899 writeOperand(I.getOperand(0), true); Out << ", ";
1902 Out << ", " << *i;
1904 Out << ' ';
1905 TypePrinter.print(I.getType(), Out);
1906 Out << " personality ";
1907 writeOperand(I.getOperand(0), true); Out << '\n';
1910 Out << " cleanup";
1913 if (i != 0 || LPI->isCleanup()) Out << "\n";
1915 Out << " catch ";
1917 Out << " filter ";
1922 Out << " void";
1926 Out << " ";
1927 PrintCallingConv(CI->getCallingConv(), Out);
1937 Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex);
1943 Out << ' ';
1947 TypePrinter.print(RetTy, Out);
1948 Out << ' ';
1953 Out << '(';
1956 Out << ", ";
1959 Out << ')';
1961 Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
1971 Out << " ";
1972 PrintCallingConv(II->getCallingConv(), Out);
1976 Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex);
1982 Out << ' ';
1986 TypePrinter.print(RetTy, Out);
1987 Out << ' ';
1992 Out << '(';
1995 Out << ", ";
1999 Out << ')';
2001 Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
2003 Out << "\n to ";
2005 Out << " unwind ";
2009 Out << ' ';
2011 Out << "inalloca ";
2012 TypePrinter.print(AI->getAllocatedType(), Out);
2014 Out << ", ";
2018 Out << ", align " << AI->getAlignment();
2022 Out << ' ';
2025 Out << " to ";
2026 TypePrinter.print(I.getType(), Out);
2029 Out << ' ';
2032 Out << ", ";
2033 TypePrinter.print(I.getType(), Out);
2059 Out << ' ';
2060 TypePrinter.print(TheType, Out);
2063 Out << ' ';
2065 if (i) Out << ", ";
2075 Out << ", align " << LI->getAlignment();
2080 Out << ", align " << SI->getAlignment();
2099 Out << ", !" << MDNames[Kind];
2101 Out << ", !<unknown kind #" << Kind << ">";
2103 Out << ' ';
2104 WriteAsOperandInternal(Out, InstMD[i].second, &TypePrinter, &Machine,
2112 formatted_raw_ostream &Out) {
2125 Out.PadToColumn(50);
2127 Out << "; ";
2128 Desc.print(Out);
2130 Out << "; [ DW_TAG_user_base ]";
2135 Out << '!' << Slot << " = metadata ";
2152 WriteMDNodeBodyInternal(Out, Node, &TypePrinter, &Machine, TheModule);
2153 WriteMDNodeComment(Node, Out);
2154 Out << "\n";
2167 Out << "attributes #" << I->second << " = { "