@@ -389,18 +389,26 @@ class Target {
389389 // / @name Feature Constructors
390390 // / @{
391391
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
393401 // / target triple.
394402 // /
395403 // / \param TheTriple This argument is used to determine the target machine
396404 // / feature set; it should always be provided. Generally this should be
397405 // / either the target triple from the module, or the target triple of the
398406 // / host if that does not exist.
399- MCAsmInfo *createMCAsmInfo (const MCRegisterInfo &MRI, StringRef TheTriple,
407+ MCAsmInfo *createMCAsmInfo (const MCRegisterInfo &MRI, const Triple & TheTriple,
400408 const MCTargetOptions &Options) const {
401409 if (!MCAsmInfoCtorFn)
402410 return nullptr ;
403- return MCAsmInfoCtorFn (MRI, Triple ( TheTriple) , Options);
411+ return MCAsmInfoCtorFn (MRI, TheTriple, Options);
404412 }
405413
406414 // / Create a MCObjectFileInfo implementation for the specified target
@@ -432,14 +440,28 @@ class Target {
432440 return MCInstrAnalysisCtorFn (Info);
433441 }
434442
435- // / createMCRegInfo - Create a MCRegisterInfo implementation.
436- // /
443+ [[deprecated(" Use overload accepting Triple instead" )]]
437444 MCRegisterInfo *createMCRegInfo (StringRef TT) const {
438445 if (!MCRegInfoCtorFn)
439446 return nullptr ;
440447 return MCRegInfoCtorFn (Triple (TT));
441448 }
442449
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+
443465 // / createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
444466 // /
445467 // / \param TheTriple This argument is used to determine the target machine
@@ -449,11 +471,11 @@ class Target {
449471 // / \param CPU This specifies the name of the target CPU.
450472 // / \param Features This specifies the string representation of the
451473 // / additional target features.
452- MCSubtargetInfo *createMCSubtargetInfo (StringRef TheTriple, StringRef CPU,
474+ MCSubtargetInfo *createMCSubtargetInfo (const Triple & TheTriple, StringRef CPU,
453475 StringRef Features) const {
454476 if (!MCSubtargetInfoCtorFn)
455477 return nullptr ;
456- return MCSubtargetInfoCtorFn (Triple ( TheTriple) , CPU, Features);
478+ return MCSubtargetInfoCtorFn (TheTriple, CPU, Features);
457479 }
458480
459481 // / createTargetMachine - Create a target specific machine implementation
@@ -577,15 +599,31 @@ class Target {
577599 return nullptr ;
578600 }
579601
602+ [[deprecated(" Use overload accepting Triple instead" )]]
603+ MCRelocationInfo *createMCRelocationInfo (StringRef TT, MCContext &Ctx) const {
604+ return createMCRelocationInfo (Triple (TT), Ctx);
605+ }
606+
580607 // / createMCRelocationInfo - Create a target specific MCRelocationInfo.
581608 // /
582609 // / \param TT The target triple.
583610 // / \param Ctx The target context.
584- MCRelocationInfo *createMCRelocationInfo (StringRef TT, MCContext &Ctx) const {
611+ MCRelocationInfo *createMCRelocationInfo (const Triple &TT,
612+ MCContext &Ctx) const {
585613 MCRelocationInfoCtorTy Fn = MCRelocationInfoCtorFn
586614 ? MCRelocationInfoCtorFn
587615 : 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));
589627 }
590628
591629 // / createMCSymbolizer - Create a target specific MCSymbolizer.
@@ -601,14 +639,13 @@ class Target {
601639 // / \param RelInfo The relocation information for this target. Takes
602640 // / ownership.
603641 MCSymbolizer *
604- createMCSymbolizer (StringRef TT, LLVMOpInfoCallback GetOpInfo,
642+ createMCSymbolizer (const Triple & TT, LLVMOpInfoCallback GetOpInfo,
605643 LLVMSymbolLookupCallback SymbolLookUp, void *DisInfo,
606644 MCContext *Ctx,
607645 std::unique_ptr<MCRelocationInfo> &&RelInfo) const {
608646 MCSymbolizerCtorTy Fn =
609647 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));
612649 }
613650
614651 // / createCustomBehaviour - Create a target specific CustomBehaviour.
0 commit comments