@@ -510,34 +510,6 @@ PredefinedExpr::PredefinedExpr(SourceLocation L, QualType FNTy, IdentKind IK,
510510 setDependence (computeDependence (this ));
511511}
512512
513- PredefinedExpr::PredefinedExpr (SourceLocation L, QualType FnTy, IdentKind IK,
514- TypeSourceInfo *Info)
515- : Expr(PredefinedExprClass, FnTy, VK_LValue, OK_Ordinary) {
516- PredefinedExprBits.Kind = IK;
517- assert ((getIdentKind () == IK) &&
518- " IdentKind do not fit in PredefinedExprBitFields!" );
519- assert (IK == UniqueStableNameType &&
520- " Constructor only valid with UniqueStableNameType" );
521- PredefinedExprBits.HasFunctionName = false ;
522- PredefinedExprBits.Loc = L;
523- setTypeSourceInfo (Info);
524- setDependence (computeDependence (this ));
525- }
526-
527- PredefinedExpr::PredefinedExpr (SourceLocation L, QualType FnTy, IdentKind IK,
528- Expr *E)
529- : Expr(PredefinedExprClass, FnTy, VK_LValue, OK_Ordinary) {
530- PredefinedExprBits.Kind = IK;
531- assert ((getIdentKind () == IK) &&
532- " IdentKind do not fit in PredefinedExprBitFields!" );
533- assert (IK == UniqueStableNameExpr &&
534- " Constructor only valid with UniqueStableNameExpr" );
535- PredefinedExprBits.HasFunctionName = false ;
536- PredefinedExprBits.Loc = L;
537- setExpr (E);
538- setDependence (computeDependence (this ));
539- }
540-
541513PredefinedExpr::PredefinedExpr (EmptyShell Empty, bool HasFunctionName)
542514 : Expr(PredefinedExprClass, Empty) {
543515 PredefinedExprBits.HasFunctionName = HasFunctionName;
@@ -547,44 +519,15 @@ PredefinedExpr *PredefinedExpr::Create(const ASTContext &Ctx, SourceLocation L,
547519 QualType FNTy, IdentKind IK,
548520 StringLiteral *SL) {
549521 bool HasFunctionName = SL != nullptr ;
550- void *Mem = Ctx.Allocate (
551- totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(HasFunctionName, 0 , 0 ),
552- alignof (PredefinedExpr));
553- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
554- }
555-
556- PredefinedExpr *PredefinedExpr::Create (const ASTContext &Ctx, SourceLocation L,
557- QualType FNTy, IdentKind IK,
558- StringLiteral *SL,
559- TypeSourceInfo *Info) {
560- assert (IK == UniqueStableNameType && " Only valid with UniqueStableNameType" );
561- bool HasFunctionName = SL != nullptr ;
562- void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(
563- HasFunctionName, 0 , !HasFunctionName),
564- alignof (PredefinedExpr));
565- if (HasFunctionName)
566- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
567- return new (Mem) PredefinedExpr (L, FNTy, IK, Info);
568- }
569-
570- PredefinedExpr *PredefinedExpr::Create (const ASTContext &Ctx, SourceLocation L,
571- QualType FNTy, IdentKind IK,
572- StringLiteral *SL, Expr *E) {
573- assert (IK == UniqueStableNameExpr && " Only valid with UniqueStableNameExpr" );
574- bool HasFunctionName = SL != nullptr ;
575- void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(
576- HasFunctionName, !HasFunctionName, 0 ),
522+ void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *>(HasFunctionName),
577523 alignof (PredefinedExpr));
578- if (HasFunctionName)
579- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
580- return new (Mem) PredefinedExpr (L, FNTy, IK, E);
524+ return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
581525}
582526
583527PredefinedExpr *PredefinedExpr::CreateEmpty (const ASTContext &Ctx,
584528 bool HasFunctionName) {
585- void *Mem = Ctx.Allocate (
586- totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(HasFunctionName, 0 , 0 ),
587- alignof (PredefinedExpr));
529+ void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *>(HasFunctionName),
530+ alignof (PredefinedExpr));
588531 return new (Mem) PredefinedExpr (EmptyShell (), HasFunctionName);
589532}
590533
@@ -604,28 +547,12 @@ StringRef PredefinedExpr::getIdentKindName(PredefinedExpr::IdentKind IK) {
604547 return " __FUNCSIG__" ;
605548 case LFuncSig:
606549 return " L__FUNCSIG__" ;
607- case UniqueStableNameType:
608- case UniqueStableNameExpr:
609- return " __builtin_unique_stable_name" ;
610550 case PrettyFunctionNoVirtual:
611551 break ;
612552 }
613553 llvm_unreachable (" Unknown ident kind for PredefinedExpr" );
614554}
615555
616- std::string PredefinedExpr::ComputeName (ASTContext &Context, IdentKind IK,
617- QualType Ty) {
618- std::unique_ptr<MangleContext> Ctx{ItaniumMangleContext::create (
619- Context, Context.getDiagnostics (), /* IsUniqueNameMangler*/ true )};
620-
621- Ty = Ty.getCanonicalType ();
622-
623- SmallString<256 > Buffer;
624- llvm::raw_svector_ostream Out (Buffer);
625- Ctx->mangleTypeName (Ty, Out);
626- return std::string (Buffer.str ());
627- }
628-
629556// FIXME: Maybe this should use DeclPrinter with a special "print predefined
630557// expr" policy instead.
631558std::string PredefinedExpr::ComputeName (IdentKind IK, const Decl *CurrentDecl) {
0 commit comments