Home | History | Annotate | Download | only in IR

Lines Matching refs:Out

72 static void PrintCallingConv(unsigned cc, raw_ostream &Out) {
74 default: Out << "cc" << cc; break;
75 case CallingConv::Fast: Out << "fastcc"; break;
76 case CallingConv::Cold: Out << "coldcc"; break;
77 case CallingConv::X86_StdCall: Out << "x86_stdcallcc"; break;
78 case CallingConv::X86_FastCall: Out << "x86_fastcallcc"; break;
79 case CallingConv::X86_ThisCall: Out << "x86_thiscallcc"; break;
80 case CallingConv::Intel_OCL_BI: Out << "intel_ocl_bicc"; break;
81 case CallingConv::ARM_APCS: Out << "arm_apcscc"; break;
82 case CallingConv::ARM_AAPCS: Out << "arm_aapcscc"; break;
83 case CallingConv::ARM_AAPCS_VFP: Out << "arm_aapcs_vfpcc"; break;
84 case CallingConv::MSP430_INTR: Out << "msp430_intrcc"; break;
85 case CallingConv::PTX_Kernel: Out << "ptx_kernel"; break;
86 case CallingConv::PTX_Device: Out << "ptx_device"; break;
87 case CallingConv::X86_64_SysV: Out << "x86_64_sysvcc"; break;
88 case CallingConv::X86_64_Win64: Out << "x86_64_win64cc"; break;
94 static void PrintEscapedString(StringRef Name, raw_ostream &Out) {
98 Out << C;
100 Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
113 /// surrounded with ""'s (if it has special chars in it). Print it out.
140 // If we didn't need any quotes, just write out the name in one blast.
155 /// surrounded with ""'s (if it has special chars in it). Print it out.
168 // the unnamed ones out to a numbering and remove the anonymous structs.
330 /// Construct from a function, starting out in incorp state.
555 /// Clean up after incorporating a function. This is the only way to get out of
673 static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
713 static void writeAtomicRMWOperation(raw_ostream &Out,
716 default: Out << " <unknown operation " << Op << ">"; break;
717 case AtomicRMWInst::Xchg: Out << " xchg"; break;
718 case AtomicRMWInst::Add: Out << " add"; break;
719 case AtomicRMWInst::Sub: Out << " sub"; break;
720 case AtomicRMWInst::And: Out << " and"; break;
721 case AtomicRMWInst::Nand: Out << " nand"; break;
722 case AtomicRMWInst::Or: Out << " or"; break;
723 case AtomicRMWInst::Xor: Out << " xor"; break;
724 case AtomicRMWInst::Max: Out << " max"; break;
725 case AtomicRMWInst::Min: Out << " min"; break;
726 case AtomicRMWInst::UMax: Out << " umax"; break;
727 case AtomicRMWInst::UMin: Out << " umin"; break;
731 static void WriteOptimizationInfo(raw_ostream &Out, const User *U) {
733 // Unsafe algebra implies all the others, no need to write them all out
735 Out << " fast";
738 Out << " nnan";
740 Out << " ninf";
742 Out << " nsz";
744 Out << " arcp";
751 Out << " nuw";
753 Out << " nsw";
757 Out << " exact";
760 Out << " inbounds";
764 static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
770 Out << (CI->getZExtValue() ? "true" : "false");
773 Out << CI->getValue();
805 Out << StrVal.str();
822 Out << "0x" <<
831 Out << "0x";
836 Out << 'K';
846 Out << (unsigned char)(nibble + '0');
848 Out << (unsigned char)(nibble - 10 + 'A');
859 Out << 'L';
862 Out << 'M';
865 Out << 'H';
876 Out << (unsigned char)(nibble + '0');
878 Out << (unsigned char)(nibble - 10 + 'A');
890 Out << "zeroinitializer";
895 Out << "blockaddress(";
896 WriteAsOperandInternal(Out, BA->getFunction(), &TypePrinter, Machine,
898 Out << ", ";
899 WriteAsOperandInternal(Out, BA->getBasicBlock(), &TypePrinter, Machine,
901 Out << ")";
907 Out << '[';
908 TypePrinter.print(ETy, Out);
909 Out << ' ';
910 WriteAsOperandInternal(Out, CA->getOperand(0),
914 Out << ", ";
915 TypePrinter.print(ETy, Out);
916 Out << ' ';
917 WriteAsOperandInternal(Out, CA->getOperand(i), &TypePrinter, Machine,
920 Out << ']';
928 Out << "c\"";
929 PrintEscapedString(CA->getAsString(), Out);
930 Out << '"';
935 Out << '[';
936 TypePrinter.print(ETy, Out);
937 Out << ' ';
938 WriteAsOperandInternal(Out, CA->getElementAsConstant(0),
942 Out << ", ";
943 TypePrinter.print(ETy, Out);
944 Out << ' ';
945 WriteAsOperandInternal(Out
948 Out << ']';
955 Out << '<';
956 Out << '{';
959 Out << ' ';
960 TypePrinter.print(CS->getOperand(0)->getType(), Out);
961 Out << ' ';
963 WriteAsOperandInternal(Out, CS->getOperand(0), &TypePrinter, Machine,
967 Out << ", ";
968 TypePrinter.print(CS->getOperand(i)->getType(), Out);
969 Out << ' ';
971 WriteAsOperandInternal(Out, CS->getOperand(i), &TypePrinter, Machine,
974 Out << ' ';
977 Out << '}';
979 Out << '>';
985 Out << '<';
986 TypePrinter.print(ETy, Out);
987 Out << ' ';
988 WriteAsOperandInternal(Out, CV->getAggregateElement(0U), &TypePrinter,
991 Out << ", ";
992 TypePrinter.print(ETy, Out);
993 Out << ' ';
994 WriteAsOperandInternal(Out, CV->getAggregateElement(i), &TypePrinter,
997 Out << '>';
1002 Out << "null";
1007 Out << "undef";
1012 Out << CE->getOpcodeName();
1013 WriteOptimizationInfo(Out, CE);
1015 Out << ' ' << getPredicateText(CE->getPredicate());
1016 Out << " (";
1019 TypePrinter.print((*OI)->getType(), Out);
1020 Out << ' ';
1021 WriteAsOperandInternal(Out, *OI, &TypePrinter, Machine, Context);
1023 Out << ", ";
1029 Out << ", " << Indices[i];
1033 Out << " to ";
1034 TypePrinter.print(CE->getType(), Out);
1037 Out << ')';
1041 Out << "<placeholder or erroneous Constant>";
1044 static void WriteMDNodeBodyInternal(raw_ostream &Out, const MDNode *Node,
1048 Out << "!{";
1052 Out << "null";
1054 TypePrinter->print(V->getType(), Out);
1055 Out << ' ';
1056 WriteAsOperandInternal(Out, Node->getOperand(mi),
1060 Out << ", ";
1063 Out << "}";
1067 /// WriteAsOperand - Write the name of the specified value out to the specified
1071 static void WriteAsOperandInternal(raw_ostream &Out, const Value *V,
1076 PrintLLVMName(Out, V);
1083 WriteConstantInternal(Out, CV, *TypePrinter, Machine, Context);
1088 Out << "asm ";
1090 Out << "sideeffect ";
1092 Out << "alignstack ";
1095 Out << "inteldialect ";
1096 Out << '"';
1097 PrintEscapedString(IA->getAsmString(), Out);
1098 Out << "\", \"";
1099 PrintEscapedString(IA->getConstraintString(), Out);
1100 Out << '"';
1107 WriteMDNodeBodyInternal(Out, N, TypePrinter, Machine, Context);
1119 Out << "<badref>";
1121 Out << '!' << Slot;
1126 Out << "!\"";
1127 PrintEscapedString(MDS->getString(), Out);
1128 Out << '"';
1134 V->print(Out);
1172 Out << Prefix << Slot;
1174 Out << "<badref>";
1177 void WriteAsOperand(raw_ostream &Out, const Value *V,
1185 WriteAsOperandInternal(Out, V, 0, 0, Context);
1195 TypePrinter.print(V->getType(), Out);
1196 Out << ' ';
1199 WriteAsOperandInternal(Out, V, &TypePrinter, 0, Context);
1211 : Out(o), TheModule(M), Machine(Mac), AnnotationWriter(AAW) {
1217 : Out(o), TheModule(M), ModuleSlotTracker(createSlotTracker(M)),
1226 Out << "<null operand!>";
1230 TypePrinter.print(Operand->getType(), Out);
1231 Out << ' ';
1233 WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine, TheModule);
1242 case SingleThread: Out << " singlethread"; break;
1247 default: Out << " <bad ordering " << int(Ordering) << ">"; break;
1248 case Unordered: Out << " unordered"; break;
1249 case Monotonic: Out << " monotonic"; break;
1250 case Acquire: Out << " acquire"; break;
1251 case Release: Out << " release"; break;
1252 case AcquireRelease: Out << " acq_rel"; break;
1253 case SequentiallyConsistent: Out << " seq_cst"; break;
1260 Out << "<null operand!>";
1265 TypePrinter.print(Operand->getType(), Out);
1268 Out << ' ' << Attrs.getAsString(Idx);
1269 Out << ' ';
1271 WriteAsOperandInternal(Out, Operand, &TypePrinter, &Machine, TheModule);
1281 Out << "; ModuleID = '" << M->getModuleIdentifier() << "'\n";
1284 Out << "target datalayout = \"" << M->getDataLayout() << "\"\n";
1286 Out << "target triple = \"" << M->getTargetTriple() << "\"\n";
1293 Out << '\n';
1297 Out << "module asm \"";
1299 Out);
1300 Out << "\"\n";
1306 Out << "module asm \"";
1307 PrintEscapedString(rest, Out);
1308 Out << "\"\n";
1315 if (!M->global_empty()) Out << '\n';
1318 printGlobal(I); Out << '\n';
1322 if (!M->alias_empty()) Out << "\n";
1333 Out << '\n';
1338 if (!M->named_metadata_empty()) Out << '\n';
1346 Out << '\n';
1352 Out << '!';
1355 Out << "<empty name> ";
1360 Out << Name[0];
1362 Out << '\\' << hexdigit(Name[0] >> 4) << hexdigit(Name[0] & 0x0F);
1367 Out << C;
1369 Out << '\\' << hexdigit(C >> 4) << hexdigit(C & 0x0F);
1372 Out << " = !{";
1374 if (i) Out << ", ";
1377 Out << "<badref>";
1379 Out << '!' << Slot;
1381 Out << "}\n";
1386 formatted_raw_ostream &Out) {
1389 case GlobalValue::PrivateLinkage: Out << "private "; break;
1390 case GlobalValue::LinkerPrivateLinkage: Out << "linker_private "; break;
1392 Out << "linker_private_weak ";
1394 case GlobalValue::InternalLinkage: Out << "internal "; break;
1395 case GlobalValue::LinkOnceAnyLinkage: Out << "linkonce "; break;
1396 case GlobalValue::LinkOnceODRLinkage: Out << "linkonce_odr "; break;
1398 Out << "linkonce_odr_auto_hide ";
1400 case GlobalValue::WeakAnyLinkage: Out << "weak "; break;
1401 case GlobalValue::WeakODRLinkage: Out << "weak_odr "; break;
1402 case GlobalValue::CommonLinkage: Out << "common "; break;
1403 case GlobalValue::AppendingLinkage: Out << "appending "; break;
1404 case GlobalValue::DLLImportLinkage: Out << "dllimport "; break;
1405 case GlobalValue::DLLExportLinkage: Out << "dllexport "; break;
1406 case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
1408 Out << "available_externally ";
1415 formatted_raw_ostream &Out) {
1418 case GlobalValue::HiddenVisibility: Out << "hidden "; break;
1419 case GlobalValue::ProtectedVisibility: Out << "protected "; break;
1424 formatted_raw_ostream &Out) {
1429 Out << "thread_local ";
1432 Out << "thread_local(localdynamic) ";
1435 Out << "thread_local(initialexec) ";
1438 Out << "thread_local(localexec) ";
1445 Out << "; Materializable\n";
1447 WriteAsOperandInternal(Out, GV, &TypePrinter, &Machine, GV->getParent());
1448 Out << " = ";
1451 Out << "external ";
1453 PrintLinkage(GV->getLinkage(), Out);
1454 PrintVisibility(GV->getVisibility(), Out);
1455 PrintThreadLocalModel(GV->getThreadLocalMode(), Out);
1458 Out << "addrspace(" << AddressSpace << ") ";
1459 if (GV->hasUnnamedAddr()) Out << "unnamed_addr ";
1460 if (GV->isExternallyInitialized()) Out << "externally_initialized ";
1461 Out << (GV->isConstant() ? "constant " : "global ");
1462 TypePrinter.print(GV->getType()->getElementType(), Out);
1465 Out << ' ';
1470 Out << ", section \"";
1471 PrintEscapedString(GV->getSection(), Out);
1472 Out << '"';
1475 Out << ", align " << GV->getAlignment();
1482 Out << "; Materializable\n";
1486 Out << "<<nameless>> = ";
1488 PrintLLVMName(Out, GA);
1489 Out << " = ";
1491 PrintVisibility(GA->getVisibility(), Out);
1493 Out << "alias ";
1495 PrintLinkage(GA->getLinkage(), Out);
1500 TypePrinter.print(GA->getType(), Out);
1501 Out << " <<NULL ALIASEE>>";
1507 Out << '\n';
1515 Out << '\n';
1529 Out << '%' << i << " = type ";
1531 // Make sure we print out at least one level of the type structure, so
1533 TypePrinter.printStructBody(NumberedTypes[i], Out);
1534 Out << '\n';
1538 PrintLLVMName(Out, TypePrinter.NamedTypes[i]->getName(), LocalPrefix);
1539 Out << " = type ";
1541 // Make sure we print out at least one level of the type structure, so
1543 TypePrinter.printStructBody(TypePrinter.NamedTypes[i], Out);
1544 Out << '\n';
1551 // Print out the return type and name.
1552 Out << '\n';
1554 if (AnnotationWriter) AnnotationWriter->emitFunctionAnnot(F, Out);
1557 Out << "; Materializable\n";
1579 Out << "; Function Attrs: " << AttrStr << '\n';
1583 Out << "declare ";
1585 Out << "define ";
1587 PrintLinkage(F->getLinkage(), Out);
1588 PrintVisibility(F->getVisibility(), Out);
1592 PrintCallingConv(F->getCallingConv(), Out);
1593 Out << " ";
1598 Out << Attrs.getAsString(AttributeSet::ReturnIndex) << ' ';
1599 TypePrinter.print(F->getReturnType(), Out);
1600 Out << ' ';
1601 WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent());
1602 Out << '(';
1613 if (I != F->arg_begin()) Out << ", ";
1621 if (i) Out << ", ";
1624 TypePrinter.print(FT->getParamType(i), Out);
1627 Out << ' ' << Attrs.getAsString(i+1);
1633 if (FT->getNumParams()) Out << ", ";
1634 Out << "..."; // Output varargs portion of signature!
1636 Out << ')';
1638 Out << " unnamed_addr";
1640 Out << " #" << Machine.getAttributeGroupSlot(Attrs.getFnAttributes());
1642 Out << " section \"";
1643 PrintEscapedString(F->getSection(), Out);
1644 Out << '"';
1647 Out << " align " << F->getAlignment();
1649 Out << " gc \"" << F->getGC() << '"';
1651 Out << '\n';
1653 Out << " {";
1658 Out << "}\n";
1665 /// the function. Simply print it out
1670 TypePrinter.print(Arg->getType(), Out);
1674 Out << ' ' << Attrs.getAsString(Idx);
1678 Out << ' ';
1679 PrintLLVMName(Out, Arg);
1686 if (BB->hasName()) { // Print out the label if it exists...
1687 Out << "\n";
1688 PrintLLVMName(Out, BB->getName(), LabelPrefix);
1689 Out << ':';
1691 Out << "\n; <label>:";
1694 Out << Slot;
1696 Out << "<badref>";
1700 Out.PadToColumn(50);
1701 Out << "; Error: Block without parent!";
1704 Out.PadToColumn(50);
1705 Out << ";";
1709 Out << " No predecessors!";
1711 Out << " preds = ";
1714 Out << ", ";
1720 Out << "\n";
1722 if (AnnotationWriter) AnnotationWriter->emitBasicBlockStartAnnot(BB, Out);
1729 if (AnnotationWriter) AnnotationWriter->emitBasicBlockEndAnnot(BB, Out);
1735 Out << '\n';
1743 AnnotationWriter->printInfoComment(V, Out);
1748 if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out);
1750 // Print out indentation for an instruction.
1751 Out << " ";
1753 // Print out name if it exists...
1755 PrintLLVMName(Out, &I);
1756 Out << " = ";
1758 // Print out the def slot taken.
1761 Out << "<badref> = ";
1763 Out << '%' << SlotNum << " = ";
1767 Out << "tail ";
1769 // Print out the opcode...
1770 Out << I.getOpcodeName();
1772 // If this is an atomic load or store, print out the atomic marker.
1775 Out << " atomic";
1777 // If this is a volatile operation, print out the volatile marker.
1782 Out << " volatile";
1784 // Print out optimization information.
1785 WriteOptimizationInfo(Out, &I);
1787 // Print out the compare instruction predicates
1789 Out << ' ' << getPredicateText(CI->getPredicate());
1791 // Print out the atomicrmw operation
1793 writeAtomicRMWOperation(Out, RMWI->getOperation());
1795 // Print out the type of the operands...
1798 // Special case conditional branches to swizzle the condition out to the front
1801 Out << ' ';
1803 Out << ", ";
1805 Out << ", ";
1811 Out << ' ';
1813 Out << ", ";
1815 Out << " [";
1818 Out << "\n ";
1820 Out << ", ";
1823 Out << "\n ]";
1826 Out << ' ';
1828 Out << ", [";
1832 Out << ", ";
1835 Out << ']';
1837 Out << ' ';
1838 TypePrinter.print(I.getType(), Out);
1839 Out << ' ';
1842 if (op) Out << ", ";
1843 Out << "[ ";
1844 writeOperand(PN->getIncomingValue(op), false); Out << ", ";
1845 writeOperand(PN->getIncomingBlock(op), false); Out << " ]";
1848 Out << ' ';
1851 Out << ", " << *i;
1853 Out << ' ';
1854 writeOperand(I.getOperand(0), true); Out << ", ";
1857 Out << ", " << *i;
1859 Out << ' ';
1860 TypePrinter.print(I.getType(), Out);
1861 Out << " personality ";
1862 writeOperand(I.getOperand(0), true); Out << '\n';
1865 Out << " cleanup";
1868 if (i != 0 || LPI->isCleanup()) Out << "\n";
1870 Out << " catch ";
1872 Out << " filter ";
1877 Out << " void";
1881 Out << " ";
1882 PrintCallingConv(CI->getCallingConv(), Out);
1892 Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex);
1894 // If possible, print out the short form of the call instruction. We can
1898 Out << ' ';
1902 TypePrinter.print(RetTy, Out);
1903 Out << ' ';
1908 Out << '(';
1911 Out << ", ";
1914 Out << ')';
1916 Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
1926 Out << " ";
1927 PrintCallingConv(II->getCallingConv(), Out);
1931 Out << ' ' << PAL.getAsString(AttributeSet::ReturnIndex);
1933 // If possible, print out the short form of the invoke instruction. We can
1937 Out << ' ';
1941 TypePrinter.print(RetTy, Out);
1942 Out << ' ';
1947 Out << '(';
1950 Out << ", ";
1954 Out << ')';
1956 Out << " #" << Machine.getAttributeGroupSlot(PAL.getFnAttributes());
1958 Out << "\n to ";
1960 Out << " unwind ";
1964 Out << ' ';
1965 TypePrinter.print(AI->getAllocatedType(), Out);
1967 Out << ", ";
1971 Out << ", align " << AI->getAlignment();
1975 Out << ' ';
1978 Out << " to ";
1979 TypePrinter.print(I.getType(), Out);
1982 Out << ' ';
1985 Out << ", ";
1986 TypePrinter.print(I.getType(), Out);
2012 Out << ' ';
2013 TypePrinter.print(TheType, Out);
2016 Out << ' ';
2018 if (i) Out << ", ";
2028 Out << ", align " << LI->getAlignment();
2033 Out << ", align " << SI->getAlignment();
2051 Out << ", !" << MDNames[Kind];
2053 Out << ", !<unknown kind #" << Kind << ">";
2055 Out << ' ';
2056 WriteAsOperandInternal(Out, InstMD[i].second, &TypePrinter, &Machine,
2064 formatted_raw_ostream &Out) {
2077 Out.PadToColumn(50);
2079 Out << "; ";
2080 Desc.print(Out);
2082 Out << "; [ DW_TAG_user_base ]";
2087 Out << '!' << Slot << " = metadata ";
2104 WriteMDNodeBodyInternal(Out, Node, &TypePrinter, &Machine, TheModule);
2105 WriteMDNodeComment(Node, Out);
2106 Out << "\n";
2119 Out << "attributes #" << I->second << " = { "
2205 llvm_unreachable("Unknown value to print out!");