Lines Matching refs:OS

91     void print(const Type *ty, Qualifiers qs, raw_ostream &OS,
93 void print(QualType T, raw_ostream &OS, StringRef PlaceHolder);
96 void spaceBeforePlaceHolder(raw_ostream &OS);
97 void printTypeSpec(const NamedDecl *D, raw_ostream &OS);
99 void printBefore(const Type *ty, Qualifiers qs, raw_ostream &OS);
100 void printBefore(QualType T, raw_ostream &OS);
101 void printAfter(const Type *ty, Qualifiers qs, raw_ostream &OS);
102 void printAfter(QualType T, raw_ostream &OS);
103 void AppendScope(DeclContext *DC, raw_ostream &OS);
104 void printTag(TagDecl *T, raw_ostream &OS);
107 void print##CLASS##Before(const CLASS##Type *T, raw_ostream &OS); \
108 void print##CLASS##After(const CLASS##Type *T, raw_ostream &OS);
113 static void AppendTypeQualList(raw_ostream &OS, unsigned TypeQuals) {
116 OS << "const";
120 if (appendSpace) OS << ' ';
121 OS << "volatile";
125 if (appendSpace) OS << ' ';
126 OS << "restrict";
130 void TypePrinter::spaceBeforePlaceHolder(raw_ostream &OS) {
132 OS << ' ';
135 void TypePrinter::print(QualType t, raw_ostream &OS, StringRef PlaceHolder) {
137 print(split.Ty, split.Quals, OS, PlaceHolder);
140 void TypePrinter::print(const Type *T, Qualifiers Quals, raw_ostream &OS,
143 OS << "NULL TYPE";
149 printBefore(T, Quals, OS);
150 OS << PlaceHolder;
151 printAfter(T, Quals, OS);
230 void TypePrinter::printBefore(QualType T, raw_ostream &OS) {
240 printBefore(Split.Ty, Quals, OS);
245 void TypePrinter::printBefore(const Type *T,Qualifiers Quals, raw_ostream &OS) {
260 Quals.print(OS, Policy, /*appendSpaceIfNonEmpty=*/true);
262 Quals.print(OS, Policy, /*appendSpaceIfNonEmpty=*/true);
276 print##CLASS##Before(cast<CLASS##Type>(T), OS); \
284 Quals.print(OS, Policy, /*appendSpaceIfNonEmpty=*/!PrevPHIsEmpty.get());
286 Quals.print(OS, Policy, /*appendSpaceIfNonEmpty=*/!PrevPHIsEmpty.get());
291 void TypePrinter::printAfter(QualType t, raw_ostream &OS) {
293 printAfter(split.Ty, split.Quals, OS);
298 void TypePrinter::printAfter(const Type *T, Qualifiers Quals, raw_ostream &OS) {
302 print##CLASS##After(cast<CLASS##Type>(T), OS); \
308 void TypePrinter::printBuiltinBefore(const BuiltinType *T, raw_ostream &OS) {
309 OS << T->getName(Policy);
310 spaceBeforePlaceHolder(OS);
312 void TypePrinter::printBuiltinAfter(const BuiltinType *T, raw_ostream &OS) { }
314 void TypePrinter::printComplexBefore(const ComplexType *T, raw_ostream &OS) {
315 OS << "_Complex ";
316 printBefore(T->getElementType(), OS);
318 void TypePrinter::printComplexAfter(const ComplexType *T, raw_ostream &OS) {
319 printAfter(T->getElementType(), OS);
322 void TypePrinter::printPointerBefore(const PointerType *T, raw_ostream &OS) {
325 printBefore(T->getPointeeType(), OS);
329 OS << '(';
330 OS << '*';
332 void TypePrinter::printPointerAfter(const PointerType *T, raw_ostream &OS) {
338 OS << ')';
339 printAfter(T->getPointeeType(), OS);
343 raw_ostream &OS) {
345 printBefore(T->getPointeeType(), OS);
346 OS << '^';
349 raw_ostream &OS) {
351 printAfter(T->getPointeeType(), OS);
355 raw_ostream &OS) {
358 printBefore(T->getPointeeTypeAsWritten(), OS);
362 OS << '(';
363 OS << '&';
366 raw_ostream &OS) {
372 OS << ')';
373 printAfter(T->getPointeeTypeAsWritten(), OS);
377 raw_ostream &OS) {
380 printBefore(T->getPointeeTypeAsWritten(), OS);
384 OS << '(';
385 OS << "&&";
388 raw_ostream &OS) {
394 OS << ')';
395 printAfter(T->getPointeeTypeAsWritten(), OS);
399 raw_ostream &OS) {
402 printBefore(T->getPointeeType(), OS);
406 OS << '(';
410 TypePrinter(InnerPolicy).print(QualType(T->getClass(), 0), OS, StringRef());
412 OS << "::*";
415 raw_ostream &OS) {
421 OS << ')';
422 printAfter(T->getPointeeType(), OS);
426 raw_ostream &OS) {
429 printBefore(T->getElementType(), OS);
432 raw_ostream &OS) {
433 OS << '[' << T->getSize().getZExtValue() << ']';
434 printAfter(T->getElementType(), OS);
438 raw_ostream &OS) {
441 printBefore(T->getElementType(), OS);
444 raw_ostream &OS) {
445 OS << "[]";
446 printAfter(T->getElementType(), OS);
450 raw_ostream &OS) {
453 printBefore(T->getElementType(), OS);
456 raw_ostream &OS) {
457 OS << '[';
459 AppendTypeQualList(OS, T->getIndexTypeCVRQualifiers());
460 OS << ' ';
464 OS << "static";
466 OS << '*';
469 T->getSizeExpr()->printPretty(OS, nullptr, Policy);
470 OS << ']';
472 printAfter(T->getElementType(), OS);
475 void TypePrinter::printAdjustedBefore(const AdjustedType *T, raw_ostream &OS) {
478 printBefore(T->getAdjustedType(), OS);
480 void TypePrinter::printAdjustedAfter(const AdjustedType *T, raw_ostream &OS) {
481 printAfter(T->getAdjustedType(), OS);
484 void TypePrinter::printDecayedBefore(const DecayedType *T, raw_ostream &OS) {
486 printAdjustedBefore(T, OS);
488 void TypePrinter::printDecayedAfter(const DecayedType *T, raw_ostream &OS) {
489 printAdjustedAfter(T, OS);
494 raw_ostream &OS) {
497 printBefore(T->getElementType(), OS);
501 raw_ostream &OS) {
502 OS << '[';
504 T->getSizeExpr()->printPretty(OS, nullptr, Policy);
505 OS << ']';
506 printAfter(T->getElementType(), OS);
511 raw_ostream &OS) {
512 printBefore(T->getElementType(), OS);
516 raw_ostream &OS) {
517 OS << " __attribute__((ext_vector_type(";
519 T->getSizeExpr()->printPretty(OS, nullptr, Policy);
520 OS << ")))";
521 printAfter(T->getElementType(), OS);
524 void TypePrinter::printVectorBefore(const VectorType *T, raw_ostream &OS) {
527 OS << "__vector __pixel ";
530 OS << "__vector __bool ";
531 printBefore(T->getElementType(), OS);
534 OS << "__vector ";
535 printBefore(T->getElementType(), OS);
538 OS << "__attribute__((neon_vector_type("
540 printBefore(T->getElementType(), OS);
543 OS << "__attribute__((neon_polyvector_type(" <<
545 printBefore(T->getElementType(), OS);
550 OS << "__attribute__((__vector_size__("
553 print(T->getElementType(), OS, StringRef());
554 OS << ")))) ";
555 printBefore(T->getElementType(), OS);
560 void TypePrinter::printVectorAfter(const VectorType *T, raw_ostream &OS) {
561 printAfter(T->getElementType(), OS);
565 raw_ostream &OS) {
566 printBefore(T->getElementType(), OS);
568 void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) {
569 printAfter(T->getElementType(), OS);
570 OS << " __attribute__((ext_vector_type(";
571 OS << T->getNumElements();
572 OS << ")))";
576 FunctionProtoType::printExceptionSpecification(raw_ostream &OS,
581 OS << " throw(";
583 OS << "...";
587 OS << ", ";
589 OS << getExceptionType(I).stream(Policy);
591 OS << ')';
593 OS << " noexcept";
595 OS << '(';
597 getNoexceptExpr()->printPretty(OS, nullptr, Policy);
598 OS << ')';
604 raw_ostream &OS) {
606 OS << "auto ";
608 OS << '(';
612 printBefore(T->getReturnType(), OS);
614 OS << '(';
619 raw_ostream &OS) {
622 OS << ')';
625 OS << '(';
629 if (i) OS << ", ";
630 print(T->getParamType(i), OS, StringRef());
636 OS << ", ";
637 OS << "...";
640 OS << "void";
643 OS << ')';
659 OS << " __attribute__((stdcall))";
662 OS << " __attribute__((fastcall))";
665 OS << " __attribute__((thiscall))";
668 OS << " __attribute__((pascal))";
671 OS << " __attribute__((pcs(\"aapcs\")))";
674 OS << " __attribute__((pcs(\"aapcs-vfp\")))";
677 OS << " __attribute__((pnaclcall))";
680 OS << " __attribute__((intel_ocl_bicc))";
683 OS << " __attribute__((ms_abi))";
686 OS << " __attribute__((sysv_abi))";
692 OS << " __attribute__((noreturn))";
694 OS << " __attribute__((regparm ("
698 OS << ' ';
699 AppendTypeQualList(OS, quals);
707 OS << " &";
711 OS << " &&";
714 T->printExceptionSpecification(OS, Policy);
717 OS << " -> ";
718 print(T->getReturnType(), OS, StringRef());
720 printAfter(T->getReturnType(), OS);
724 raw_ostream &OS) {
727 printBefore(T->getReturnType(), OS);
729 OS << '(';
732 raw_ostream &OS) {
735 OS << ')';
738 OS << "()";
740 OS << " __attribute__((noreturn))";
741 printAfter(T->getReturnType(), OS);
744 void TypePrinter::printTypeSpec(const NamedDecl *D, raw_ostream &OS) {
746 OS << II->getName();
747 spaceBeforePlaceHolder(OS);
751 raw_ostream &OS) {
752 printTypeSpec(T->getDecl(), OS);
755 raw_ostream &OS) { }
757 void TypePrinter::printTypedefBefore(const TypedefType *T, raw_ostream &OS) {
758 printTypeSpec(T->getDecl(), OS);
760 void TypePrinter::printTypedefAfter(const TypedefType *T, raw_ostream &OS) { }
763 raw_ostream &OS) {
764 OS << "typeof ";
766 T->getUnderlyingExpr()->printPretty(OS, nullptr, Policy);
767 spaceBeforePlaceHolder(OS);
770 raw_ostream &OS) { }
772 void TypePrinter::printTypeOfBefore(const TypeOfType *T, raw_ostream &OS) {
773 OS << "typeof(";
774 print(T->getUnderlyingType(), OS, StringRef());
775 OS << ')';
776 spaceBeforePlaceHolder(OS);
778 void TypePrinter::printTypeOfAfter(const TypeOfType *T, raw_ostream &OS) { }
780 void TypePrinter::printDecltypeBefore(const DecltypeType *T, raw_ostream &OS) {
781 OS << "decltype(";
783 T->getUnderlyingExpr()->printPretty(OS, nullptr, Policy);
784 OS << ')';
785 spaceBeforePlaceHolder(OS);
787 void TypePrinter::printDecltypeAfter(const DecltypeType *T, raw_ostream &OS) { }
790 raw_ostream &OS) {
795 OS << "__underlying_type(";
796 print(T->getBaseType(), OS, StringRef());
797 OS << ')';
798 spaceBeforePlaceHolder(OS);
802 printBefore(T->getBaseType(), OS);
805 raw_ostream &OS) {
813 printAfter(T->getBaseType(), OS);
816 void TypePrinter::printAutoBefore(const AutoType *T, raw_ostream &OS) {
819 printBefore(T->getDeducedType(), OS);
821 OS << (T->isDecltypeAuto() ? "decltype(auto)" : "auto");
822 spaceBeforePlaceHolder(OS);
825 void TypePrinter::printAutoAfter(const AutoType *T, raw_ostream &OS) {
828 printAfter(T->getDeducedType(), OS);
831 void TypePrinter::printAtomicBefore(const AtomicType *T, raw_ostream &OS) {
834 OS << "_Atomic(";
835 print(T->getValueType(), OS, StringRef());
836 OS << ')';
837 spaceBeforePlaceHolder(OS);
839 void TypePrinter::printAtomicAfter(const AtomicType *T, raw_ostream &OS) { }
842 void TypePrinter::AppendScope(DeclContext *DC, raw_ostream &OS) {
845 AppendScope(DC->getParent(), OS);
852 OS << NS->getName() << "::";
854 OS << "(anonymous namespace)::";
858 OS << Spec->getIdentifier()->getName();
860 TemplateSpecializationType::PrintTemplateArgumentList(OS,
864 OS << "::";
867 OS << Typedef->getIdentifier()->getName() << "::";
869 OS << Tag->getIdentifier()->getName() << "::";
875 void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) {
889 OS << D->getKindName();
890 OS << ' ';
897 AppendScope(D->getDeclContext(), OS);
900 OS << II->getName();
903 OS << Typedef->getIdentifier()->getName();
909 OS << "(lambda";
912 OS << "(anonymous";
920 OS << " " << D->getKindName();
925 OS << " at " << PLoc.getFilename()
931 OS << ')';
951 TemplateSpecializationType::PrintTemplateArgumentList(OS,
956 spaceBeforePlaceHolder(OS);
959 void TypePrinter::printRecordBefore(const RecordType *T, raw_ostream &OS) {
960 printTag(T->getDecl(), OS);
962 void TypePrinter::printRecordAfter(const RecordType *T, raw_ostream &OS) { }
964 void TypePrinter::printEnumBefore(const EnumType *T, raw_ostream &OS) {
965 printTag(T->getDecl(), OS);
967 void TypePrinter::printEnumAfter(const EnumType *T, raw_ostream &OS) { }
970 raw_ostream &OS) {
972 OS << Id->getName();
974 OS << "type-parameter-" << T->getDepth() << '-' << T->getIndex();
975 spaceBeforePlaceHolder(OS);
978 raw_ostream &OS) { }
982 raw_ostream &OS) {
984 printBefore(T->getReplacementType(), OS);
988 raw_ostream &OS) {
990 printAfter(T->getReplacementType(), OS);
995 raw_ostream &OS) {
997 printTemplateTypeParmBefore(T->getReplacedParameter(), OS);
1001 raw_ostream &OS) {
1003 printTemplateTypeParmAfter(T->getReplacedParameter(), OS);
1008 raw_ostream &OS) {
1010 T->getTemplateName().print(OS, Policy);
1012 TemplateSpecializationType::PrintTemplateArgumentList(OS,
1016 spaceBeforePlaceHolder(OS);
1020 raw_ostream &OS) { }
1023 raw_ostream &OS) {
1024 printTemplateSpecializationBefore(T->getInjectedTST(), OS);
1027 raw_ostream &OS) { }
1030 raw_ostream &OS) {
1033 OS << TypeWithKeyword::getKeywordName(T->getKeyword());
1035 OS << " ";
1038 Qualifier->print(OS, Policy);
1041 printBefore(T->getNamedType(), OS);
1044 raw_ostream &OS) {
1046 printAfter(T->getNamedType(), OS);
1049 void TypePrinter::printParenBefore(const ParenType *T, raw_ostream &OS) {
1051 printBefore(T->getInnerType(), OS);
1052 OS << '(';
1054 printBefore(T->getInnerType(), OS);
1056 void TypePrinter::printParenAfter(const ParenType *T, raw_ostream &OS) {
1058 OS << ')';
1059 printAfter(T->getInnerType(), OS);
1061 printAfter(T->getInnerType(), OS);
1065 raw_ostream &OS) {
1066 OS << TypeWithKeyword::getKeywordName(T->getKeyword());
1068 OS << " ";
1070 T->getQualifier()->print(OS, Policy);
1072 OS << T->getIdentifier()->getName();
1073 spaceBeforePlaceHolder(OS);
1076 raw_ostream &OS) { }
1079 const DependentTemplateSpecializationType *T, raw_ostream &OS) {
1082 OS << TypeWithKeyword::getKeywordName(T->getKeyword());
1084 OS << " ";
1087 T->getQualifier()->print(OS, Policy);
1088 OS << T->getIdentifier()->getName();
1089 TemplateSpecializationType::PrintTemplateArgumentList(OS,
1093 spaceBeforePlaceHolder(OS);
1096 const DependentTemplateSpecializationType *T, raw_ostream &OS) { }
1099 raw_ostream &OS) {
1100 printBefore(T->getPattern(), OS);
1103 raw_ostream &OS) {
1104 printAfter(T->getPattern(), OS);
1105 OS << "...";
1109 raw_ostream &OS) {
1113 return printBefore(T->getEquivalentType(), OS);
1115 printBefore(T->getModifiedType(), OS);
1120 case AttributedType::attr_ptr32: OS << " __ptr32"; break;
1121 case AttributedType::attr_ptr64: OS << " __ptr64"; break;
1122 case AttributedType::attr_sptr: OS << " __sptr"; break;
1123 case AttributedType::attr_uptr: OS << " __uptr"; break;
1125 spaceBeforePlaceHolder(OS);
1130 raw_ostream &OS) {
1134 return printAfter(T->getEquivalentType(), OS);
1144 printAfter(T->getModifiedType(), OS);
1146 OS << " __attribute__((";
1150 OS << "address_space(";
1151 OS << T->getEquivalentType().getAddressSpace();
1152 OS << ')';
1156 OS << "__vector_size__(";
1158 OS << vector->getNumElements();
1159 OS << " * sizeof(";
1160 print(vector->getElementType(), OS, StringRef());
1161 OS << ')';
1163 OS << ')';
1170 OS << "neon_vector_type(";
1172 OS << "neon_polyvector_type(";
1174 OS << vector->getNumElements();
1175 OS << ')';
1182 OS << "regparm(";
1186 OS << t->getAs<FunctionType>()->getRegParmType();
1187 OS << ')';
1192 OS << "objc_gc(";
1202 OS << "weak";
1204 OS << "strong";
1205 OS << ')';
1210 OS << "objc_ownership(";
1213 case Qualifiers::OCL_ExplicitNone: OS << "none"; break;
1214 case Qualifiers::OCL_Strong: OS << "strong"; break;
1215 case Qualifiers::OCL_Weak: OS << "weak"; break;
1216 case Qualifiers::OCL_Autoreleasing: OS << "autoreleasing"; break;
1218 OS << ')';
1223 case AttributedType::attr_noreturn: OS << "noreturn"; break;
1225 case AttributedType::attr_cdecl: OS << "cdecl"; break;
1226 case AttributedType::attr_fastcall: OS << "fastcall"; break;
1227 case AttributedType::attr_stdcall: OS << "stdcall"; break;
1228 case AttributedType::attr_thiscall: OS << "thiscall"; break;
1229 case AttributedType::attr_pascal: OS << "pascal"; break;
1230 case AttributedType::attr_ms_abi: OS << "ms_abi"; break;
1231 case AttributedType::attr_sysv_abi: OS << "sysv_abi"; break;
1234 OS << "pcs(";
1238 OS << (t->getAs<FunctionType>()->getCallConv() == CC_AAPCS ?
1240 OS << ')';
1243 case AttributedType::attr_pnaclcall: OS << "pnaclcall"; break;
1244 case AttributedType::attr_inteloclbicc: OS << "inteloclbicc"; break;
1246 OS << "))";
1250 raw_ostream &OS) {
1251 OS << T->getDecl()->getName();
1252 spaceBeforePlaceHolder(OS);
1255 raw_ostream &OS) { }
1258 raw_ostream &OS) {
1260 return printBefore(T->getBaseType(), OS);
1262 print(T->getBaseType(), OS, StringRef());
1263 OS << '<';
1269 OS << ',';
1270 OS << I->getName();
1272 OS << '>';
1273 spaceBeforePlaceHolder(OS);
1276 raw_ostream &OS) {
1278 return printAfter(T->getBaseType(), OS);
1282 raw_ostream &OS) {
1283 T->getPointeeType().getLocalQualifiers().print(OS, Policy,
1289 OS << "id";
1291 OS << "Class";
1293 OS << T->getInterfaceDecl()->getName();
1296 OS << '<';
1300 OS << (*I)->getName();
1302 OS << ',';
1304 OS << '>';
1309 OS << " *"; // Don't forget the implicit pointer.
1311 spaceBeforePlaceHolder(OS);
1315 raw_ostream &OS) { }
1318 PrintTemplateArgumentList(raw_ostream &OS,
1321 return PrintTemplateArgumentList(OS,
1329 raw_ostream &OS,
1335 OS << '<';
1344 OS << ", ";
1351 OS << ", ";
1360 OS << ' ';
1362 OS << ArgString;
1371 OS << ' ';
1374 OS << '>';
1379 PrintTemplateArgumentList(raw_ostream &OS,
1382 OS << '<';
1387 OS << ", ";
1406 OS << ' ';
1408 OS << ArgString;
1417 OS << ' ';
1419 OS << '>';
1469 void Qualifiers::print(raw_ostream &OS, const PrintingPolicy& Policy,
1475 AppendTypeQualList(OS, quals);
1480 OS << ' ';
1484 OS << "__global";
1487 OS << "__local";
1490 OS << "__constant";
1493 OS << "__attribute__((address_space(";
1494 OS << addrspace;
1495 OS << ")))";
1500 OS << ' ';
1503 OS << "__weak";
1505 OS << "__strong";
1510 OS << ' ';
1516 case Qualifiers::OCL_ExplicitNone: OS << "__unsafe_unretained"; break;
1519 OS << "__strong";
1522 case Qualifiers::OCL_Weak: OS << "__weak"; break;
1523 case Qualifiers::OCL_Autoreleasing: OS << "__autoreleasing"; break;
1528 OS << ' ';
1545 raw_ostream &OS, const PrintingPolicy &policy,
1550 TypePrinter(policy).print(ty, qs, OS, PH);