@@ -389,18 +389,26 @@ class Target {
389
389
// / @name Feature Constructors
390
390
// / @{
391
391
392
- // / createMCAsmInfo - Create a MCAsmInfo implementation for the specified
392
+ [[deprecated(" Use overload accepting Triple instead" )]]
393
+ MCAsmInfo *createMCAsmInfo (const MCRegisterInfo &MRI, StringRef TheTriple,
394
+ const MCTargetOptions &Options) const {
395
+ if (!MCAsmInfoCtorFn)
396
+ return nullptr ;
397
+ return MCAsmInfoCtorFn (MRI, Triple (TheTriple), Options);
398
+ }
399
+
400
+ // / Create a MCAsmInfo implementation for the specified
393
401
// / target triple.
394
402
// /
395
403
// / \param TheTriple This argument is used to determine the target machine
396
404
// / feature set; it should always be provided. Generally this should be
397
405
// / either the target triple from the module, or the target triple of the
398
406
// / host if that does not exist.
399
- MCAsmInfo *createMCAsmInfo (const MCRegisterInfo &MRI, StringRef TheTriple,
407
+ MCAsmInfo *createMCAsmInfo (const MCRegisterInfo &MRI, const Triple & TheTriple,
400
408
const MCTargetOptions &Options) const {
401
409
if (!MCAsmInfoCtorFn)
402
410
return nullptr ;
403
- return MCAsmInfoCtorFn (MRI, Triple ( TheTriple) , Options);
411
+ return MCAsmInfoCtorFn (MRI, TheTriple, Options);
404
412
}
405
413
406
414
// / Create a MCObjectFileInfo implementation for the specified target
@@ -432,14 +440,28 @@ class Target {
432
440
return MCInstrAnalysisCtorFn (Info);
433
441
}
434
442
435
- // / createMCRegInfo - Create a MCRegisterInfo implementation.
436
- // /
443
+ [[deprecated(" Use overload accepting Triple instead" )]]
437
444
MCRegisterInfo *createMCRegInfo (StringRef TT) const {
438
445
if (!MCRegInfoCtorFn)
439
446
return nullptr ;
440
447
return MCRegInfoCtorFn (Triple (TT));
441
448
}
442
449
450
+ // / Create a MCRegisterInfo implementation.
451
+ MCRegisterInfo *createMCRegInfo (const Triple &TT) const {
452
+ if (!MCRegInfoCtorFn)
453
+ return nullptr ;
454
+ return MCRegInfoCtorFn (TT);
455
+ }
456
+
457
+ [[deprecated(" Use overload accepting Triple instead" )]]
458
+ MCSubtargetInfo *createMCSubtargetInfo (StringRef TheTriple, StringRef CPU,
459
+ StringRef Features) const {
460
+ if (!MCSubtargetInfoCtorFn)
461
+ return nullptr ;
462
+ return MCSubtargetInfoCtorFn (Triple (TheTriple), CPU, Features);
463
+ }
464
+
443
465
// / createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
444
466
// /
445
467
// / \param TheTriple This argument is used to determine the target machine
@@ -449,11 +471,11 @@ class Target {
449
471
// / \param CPU This specifies the name of the target CPU.
450
472
// / \param Features This specifies the string representation of the
451
473
// / additional target features.
452
- MCSubtargetInfo *createMCSubtargetInfo (StringRef TheTriple, StringRef CPU,
474
+ MCSubtargetInfo *createMCSubtargetInfo (const Triple & TheTriple, StringRef CPU,
453
475
StringRef Features) const {
454
476
if (!MCSubtargetInfoCtorFn)
455
477
return nullptr ;
456
- return MCSubtargetInfoCtorFn (Triple ( TheTriple) , CPU, Features);
478
+ return MCSubtargetInfoCtorFn (TheTriple, CPU, Features);
457
479
}
458
480
459
481
// / createTargetMachine - Create a target specific machine implementation
@@ -577,15 +599,31 @@ class Target {
577
599
return nullptr ;
578
600
}
579
601
602
+ [[deprecated(" Use overload accepting Triple instead" )]]
603
+ MCRelocationInfo *createMCRelocationInfo (StringRef TT, MCContext &Ctx) const {
604
+ return createMCRelocationInfo (Triple (TT), Ctx);
605
+ }
606
+
580
607
// / createMCRelocationInfo - Create a target specific MCRelocationInfo.
581
608
// /
582
609
// / \param TT The target triple.
583
610
// / \param Ctx The target context.
584
- MCRelocationInfo *createMCRelocationInfo (StringRef TT, MCContext &Ctx) const {
611
+ MCRelocationInfo *createMCRelocationInfo (const Triple &TT,
612
+ MCContext &Ctx) const {
585
613
MCRelocationInfoCtorTy Fn = MCRelocationInfoCtorFn
586
614
? MCRelocationInfoCtorFn
587
615
: llvm::createMCRelocationInfo;
588
- return Fn (Triple (TT), Ctx);
616
+ return Fn (TT, Ctx);
617
+ }
618
+
619
+ [[deprecated(" Use overload accepting Triple instead" )]]
620
+ MCSymbolizer *
621
+ createMCSymbolizer (StringRef TT, LLVMOpInfoCallback GetOpInfo,
622
+ LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo,
623
+ MCContext *Ctx,
624
+ std::unique_ptr<MCRelocationInfo> &&RelInfo) const {
625
+ return createMCSymbolizer (Triple (TT), GetOpInfo, SymbolLookUp, DisInfo, Ctx,
626
+ std::move (RelInfo));
589
627
}
590
628
591
629
// / createMCSymbolizer - Create a target specific MCSymbolizer.
@@ -601,14 +639,13 @@ class Target {
601
639
// / \param RelInfo The relocation information for this target. Takes
602
640
// / ownership.
603
641
MCSymbolizer *
604
- createMCSymbolizer (StringRef TT, LLVMOpInfoCallback GetOpInfo,
642
+ createMCSymbolizer (const Triple & TT, LLVMOpInfoCallback GetOpInfo,
605
643
LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo,
606
644
MCContext *Ctx,
607
645
std::unique_ptr<MCRelocationInfo> &&RelInfo) const {
608
646
MCSymbolizerCtorTy Fn =
609
647
MCSymbolizerCtorFn ? MCSymbolizerCtorFn : llvm::createMCSymbolizer;
610
- return Fn (Triple (TT), GetOpInfo, SymbolLookUp, DisInfo, Ctx,
611
- std::move (RelInfo));
648
+ return Fn (TT, GetOpInfo, SymbolLookUp, DisInfo, Ctx, std::move (RelInfo));
612
649
}
613
650
614
651
// / createCustomBehaviour - Create a target specific CustomBehaviour.
0 commit comments