Lines Matching defs:Enc
103 std::string Enc;
105 FieldEncoding(bool b, SmallStringEnc &e) : HasName(b), Enc(e.c_str()) {}
106 StringRef str() { return Enc; }
109 return Enc < rhs.Enc;
292 static bool getTypeString(SmallStringEnc &Enc, const Decl *D,
300 SmallStringEnc Enc;
301 if (getTypeString(Enc, D, CGM, TSC)) {
304 llvm::MDString::get(Ctx, Enc.str())};
327 static bool appendType(SmallStringEnc &Enc, QualType QType,
339 SmallStringEnc Enc;
340 Enc += "m(";
341 Enc += Field->getName();
342 Enc += "){";
344 Enc += "b(";
345 llvm::raw_svector_ostream OS(Enc);
347 Enc += ':';
349 if (!appendType(Enc, Field->getType(), CGM, TSC))
352 Enc += ')';
353 Enc += '}';
354 FE.emplace_back(!Field->getName().empty(), Enc);
359 /// Appends structure and union types to Enc and adds encoding to cache.
362 static bool appendRecordType(SmallStringEnc &Enc, const RecordType *RT,
368 Enc += TypeString;
373 size_t Start = Enc.size();
374 Enc += (RT->isUnionType()? 'u' : 's');
375 Enc += '(';
377 Enc += ID->getName();
378 Enc += "){";
388 std::string StubEnc(Enc.substr(Start).str());
404 Enc += ',';
405 Enc += FE[I].str();
408 Enc += '}';
409 TSC.addIfComplete(ID, Enc.substr(Start), IsRecursive);
413 /// Appends enum types to Enc and adds the encoding to the cache.
414 static bool appendEnumType(SmallStringEnc &Enc, const EnumType *ET,
420 Enc += TypeString;
424 size_t Start = Enc.size();
425 Enc += "e(";
427 Enc += ID->getName();
428 Enc += "){";
447 Enc += ',';
448 Enc += FE[I].str();
451 Enc += '}';
452 TSC.addIfComplete(ID, Enc.substr(Start), false);
456 /// Appends type's qualifier to Enc.
458 static void appendQualifier(SmallStringEnc &Enc, QualType QT) {
468 Enc += Table[Lookup];
471 /// Appends built-in types to Enc.
472 static bool appendBuiltinType(SmallStringEnc &Enc, const BuiltinType *BT) {
526 Enc += EncType;
530 /// Appends a pointer encoding to Enc before calling appendType for the pointee.
531 static bool appendPointerType(SmallStringEnc &Enc, const PointerType *PT,
534 Enc += "p(";
535 if (!appendType(Enc, PT->getPointeeType(), CGM, TSC))
537 Enc += ')';
541 /// Appends array encoding to Enc before calling appendType for the element.
542 static bool appendArrayType(SmallStringEnc &Enc, QualType QT,
548 Enc += "a(";
550 CAT->getSize().toStringUnsigned(Enc);
552 Enc += NoSizeEnc; // Global arrays use "*", otherwise it is "".
553 Enc += ':';
555 appendQualifier(Enc, QT);
556 if (!appendType(Enc, AT->getElementType(), CGM, TSC))
558 Enc += ')';
562 /// Appends a function encoding to Enc, calling appendType for the return type
564 static bool appendFunctionType(SmallStringEnc &Enc, const FunctionType *FT,
567 Enc += "f{";
568 if (!appendType(Enc, FT->getReturnType(), CGM, TSC))
570 Enc += "}(";
577 if (!appendType(Enc, *I, CGM, TSC))
581 Enc += ',';
584 Enc += ",va";
587 Enc += "va";
589 Enc += '0';
592 Enc += ')';
598 static bool appendType(SmallStringEnc &Enc, QualType QType,
607 return appendArrayType(Enc, QT, AT, CGM, TSC, "");
609 appendQualifier(Enc, QT);
612 return appendBuiltinType(Enc, BT);
615 return appendPointerType(Enc, PT, CGM, TSC);
618 return appendEnumType(Enc, ET, TSC, QT.getBaseTypeIdentifier());
621 return appendRecordType(Enc, RT, CGM, TSC, QT.getBaseTypeIdentifier());
624 return appendRecordType(Enc, RT, CGM, TSC, QT.getBaseTypeIdentifier());
627 return appendFunctionType(Enc, FT, CGM, TSC);
632 static bool getTypeString(SmallStringEnc &Enc, const Decl *D,
641 return appendType(Enc, FD->getType(), CGM, TSC);
652 return appendArrayType(Enc, QT, AT, CGM, TSC, "*");
654 return appendType(Enc, QT, CGM, TSC);