@@ -518,34 +518,6 @@ PredefinedExpr::PredefinedExpr(SourceLocation L, QualType FNTy, IdentKind IK,
518
518
setDependence (computeDependence (this ));
519
519
}
520
520
521
- PredefinedExpr::PredefinedExpr (SourceLocation L, QualType FnTy, IdentKind IK,
522
- TypeSourceInfo *Info)
523
- : Expr(PredefinedExprClass, FnTy, VK_LValue, OK_Ordinary) {
524
- PredefinedExprBits.Kind = IK;
525
- assert ((getIdentKind () == IK) &&
526
- " IdentKind do not fit in PredefinedExprBitFields!" );
527
- assert (IK == UniqueStableNameType &&
528
- " Constructor only valid with UniqueStableNameType" );
529
- PredefinedExprBits.HasFunctionName = false ;
530
- PredefinedExprBits.Loc = L;
531
- setTypeSourceInfo (Info);
532
- setDependence (computeDependence (this ));
533
- }
534
-
535
- PredefinedExpr::PredefinedExpr (SourceLocation L, QualType FnTy, IdentKind IK,
536
- Expr *E)
537
- : Expr(PredefinedExprClass, FnTy, VK_LValue, OK_Ordinary) {
538
- PredefinedExprBits.Kind = IK;
539
- assert ((getIdentKind () == IK) &&
540
- " IdentKind do not fit in PredefinedExprBitFields!" );
541
- assert (IK == UniqueStableNameExpr &&
542
- " Constructor only valid with UniqueStableNameExpr" );
543
- PredefinedExprBits.HasFunctionName = false ;
544
- PredefinedExprBits.Loc = L;
545
- setExpr (E);
546
- setDependence (computeDependence (this ));
547
- }
548
-
549
521
PredefinedExpr::PredefinedExpr (EmptyShell Empty, bool HasFunctionName)
550
522
: Expr(PredefinedExprClass, Empty) {
551
523
PredefinedExprBits.HasFunctionName = HasFunctionName;
@@ -555,44 +527,15 @@ PredefinedExpr *PredefinedExpr::Create(const ASTContext &Ctx, SourceLocation L,
555
527
QualType FNTy, IdentKind IK,
556
528
StringLiteral *SL) {
557
529
bool HasFunctionName = SL != nullptr ;
558
- void *Mem = Ctx.Allocate (
559
- totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(HasFunctionName, 0 , 0 ),
560
- alignof (PredefinedExpr));
561
- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
562
- }
563
-
564
- PredefinedExpr *PredefinedExpr::Create (const ASTContext &Ctx, SourceLocation L,
565
- QualType FNTy, IdentKind IK,
566
- StringLiteral *SL,
567
- TypeSourceInfo *Info) {
568
- assert (IK == UniqueStableNameType && " Only valid with UniqueStableNameType" );
569
- bool HasFunctionName = SL != nullptr ;
570
- void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(
571
- HasFunctionName, 0 , !HasFunctionName),
572
- alignof (PredefinedExpr));
573
- if (HasFunctionName)
574
- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
575
- return new (Mem) PredefinedExpr (L, FNTy, IK, Info);
576
- }
577
-
578
- PredefinedExpr *PredefinedExpr::Create (const ASTContext &Ctx, SourceLocation L,
579
- QualType FNTy, IdentKind IK,
580
- StringLiteral *SL, Expr *E) {
581
- assert (IK == UniqueStableNameExpr && " Only valid with UniqueStableNameExpr" );
582
- bool HasFunctionName = SL != nullptr ;
583
- void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(
584
- HasFunctionName, !HasFunctionName, 0 ),
530
+ void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *>(HasFunctionName),
585
531
alignof (PredefinedExpr));
586
- if (HasFunctionName)
587
- return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
588
- return new (Mem) PredefinedExpr (L, FNTy, IK, E);
532
+ return new (Mem) PredefinedExpr (L, FNTy, IK, SL);
589
533
}
590
534
591
535
PredefinedExpr *PredefinedExpr::CreateEmpty (const ASTContext &Ctx,
592
536
bool HasFunctionName) {
593
- void *Mem = Ctx.Allocate (
594
- totalSizeToAlloc<Stmt *, Expr *, TypeSourceInfo *>(HasFunctionName, 0 , 0 ),
595
- alignof (PredefinedExpr));
537
+ void *Mem = Ctx.Allocate (totalSizeToAlloc<Stmt *>(HasFunctionName),
538
+ alignof (PredefinedExpr));
596
539
return new (Mem) PredefinedExpr (EmptyShell (), HasFunctionName);
597
540
}
598
541
@@ -612,28 +555,12 @@ StringRef PredefinedExpr::getIdentKindName(PredefinedExpr::IdentKind IK) {
612
555
return " __FUNCSIG__" ;
613
556
case LFuncSig:
614
557
return " L__FUNCSIG__" ;
615
- case UniqueStableNameType:
616
- case UniqueStableNameExpr:
617
- return " __builtin_unique_stable_name" ;
618
558
case PrettyFunctionNoVirtual:
619
559
break ;
620
560
}
621
561
llvm_unreachable (" Unknown ident kind for PredefinedExpr" );
622
562
}
623
563
624
- std::string PredefinedExpr::ComputeName (ASTContext &Context, IdentKind IK,
625
- QualType Ty) {
626
- std::unique_ptr<MangleContext> Ctx{ItaniumMangleContext::create (
627
- Context, Context.getDiagnostics (), /* IsUniqueNameMangler*/ true )};
628
-
629
- Ty = Ty.getCanonicalType ();
630
-
631
- SmallString<256 > Buffer;
632
- llvm::raw_svector_ostream Out (Buffer);
633
- Ctx->mangleTypeName (Ty, Out);
634
- return std::string (Buffer.str ());
635
- }
636
-
637
564
// FIXME: Maybe this should use DeclPrinter with a special "print predefined
638
565
// expr" policy instead.
639
566
std::string PredefinedExpr::ComputeName (IdentKind IK, const Decl *CurrentDecl) {
0 commit comments