@@ -101,19 +101,16 @@ class Target {
101101
102102 using MCAsmInfoCtorFnTy = MCAsmInfo *(*)(const MCRegisterInfo &MRI,
103103 const Triple &TT);
104- using MCAdjustCodeGenOptsFnTy = void (*)(const Triple &TT, Reloc::Model RM,
105- CodeModel::Model &CM);
106-
107104 using MCInstrInfoCtorFnTy = MCInstrInfo *(*)();
108105 using MCInstrAnalysisCtorFnTy = MCInstrAnalysis *(*)(const MCInstrInfo *Info);
109106 using MCRegInfoCtorFnTy = MCRegisterInfo *(*)(const Triple &TT);
110107 using MCSubtargetInfoCtorFnTy = MCSubtargetInfo *(*)(const Triple &TT,
111108 StringRef CPU,
112109 StringRef Features);
113- using TargetMachineCtorTy = TargetMachine *(*)(
114- const Target &T, const Triple &TT, StringRef CPU, StringRef Features,
115- const TargetOptions &Options, Optional<Reloc::Model> RM,
116- CodeModel::Model CM, CodeGenOpt::Level OL);
110+ using TargetMachineCtorTy = TargetMachine
111+ *(*)( const Target &T, const Triple &TT, StringRef CPU, StringRef Features,
112+ const TargetOptions &Options, Optional<Reloc::Model> RM,
113+ Optional< CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT );
117114 // If it weren't for layering issues (this header is in llvm/Support, but
118115 // depends on MC?) this should take the Streamer by value rather than rvalue
119116 // reference.
@@ -191,8 +188,6 @@ class Target {
191188 // / registered.
192189 MCAsmInfoCtorFnTy MCAsmInfoCtorFn;
193190
194- MCAdjustCodeGenOptsFnTy MCAdjustCodeGenOptsFn;
195-
196191 // / MCInstrInfoCtorFn - Constructor function for this target's MCInstrInfo,
197192 // / if registered.
198193 MCInstrInfoCtorFnTy MCInstrInfoCtorFn;
@@ -312,12 +307,6 @@ class Target {
312307 return MCAsmInfoCtorFn (MRI, Triple (TheTriple));
313308 }
314309
315- void adjustCodeGenOpts (const Triple &TT, Reloc::Model RM,
316- CodeModel::Model &CM) const {
317- if (MCAdjustCodeGenOptsFn)
318- MCAdjustCodeGenOptsFn (TT, RM, CM);
319- }
320-
321310 // / createMCInstrInfo - Create a MCInstrInfo implementation.
322311 // /
323312 MCInstrInfo *createMCInstrInfo () const {
@@ -365,15 +354,17 @@ class Target {
365354 // / feature set; it should always be provided. Generally this should be
366355 // / either the target triple from the module, or the target triple of the
367356 // / host if that does not exist.
368- TargetMachine *
369- createTargetMachine (StringRef TT, StringRef CPU, StringRef Features,
370- const TargetOptions &Options, Optional<Reloc::Model> RM,
371- CodeModel::Model CM = CodeModel::Default,
372- CodeGenOpt::Level OL = CodeGenOpt::Default) const {
357+ TargetMachine *createTargetMachine (StringRef TT, StringRef CPU,
358+ StringRef Features,
359+ const TargetOptions &Options,
360+ Optional<Reloc::Model> RM,
361+ Optional<CodeModel::Model> CM = None,
362+ CodeGenOpt::Level OL = CodeGenOpt::Default,
363+ bool JIT = false ) const {
373364 if (!TargetMachineCtorFn)
374365 return nullptr ;
375366 return TargetMachineCtorFn (*this , Triple (TT), CPU, Features, Options, RM,
376- CM, OL);
367+ CM, OL, JIT );
377368 }
378369
379370 // / createMCAsmBackend - Create a target specific assembly parser.
@@ -663,11 +654,6 @@ struct TargetRegistry {
663654 T.MCAsmInfoCtorFn = Fn;
664655 }
665656
666- static void registerMCAdjustCodeGenOpts (Target &T,
667- Target::MCAdjustCodeGenOptsFnTy Fn) {
668- T.MCAdjustCodeGenOptsFn = Fn;
669- }
670-
671657 // / RegisterMCInstrInfo - Register a MCInstrInfo implementation for the
672658 // / given target.
673659 // /
@@ -929,12 +915,6 @@ struct RegisterMCAsmInfoFn {
929915 }
930916};
931917
932- struct RegisterMCAdjustCodeGenOptsFn {
933- RegisterMCAdjustCodeGenOptsFn (Target &T, Target::MCAdjustCodeGenOptsFnTy Fn) {
934- TargetRegistry::registerMCAdjustCodeGenOpts (T, Fn);
935- }
936- };
937-
938918// / RegisterMCInstrInfo - Helper template for registering a target instruction
939919// / info implementation. This invokes the static "Create" method on the class
940920// / to actually do the construction. Usage:
@@ -1080,12 +1060,11 @@ template <class TargetMachineImpl> struct RegisterTargetMachine {
10801060 }
10811061
10821062private:
1083- static TargetMachine *Allocator (const Target &T, const Triple &TT,
1084- StringRef CPU, StringRef FS,
1085- const TargetOptions &Options,
1086- Optional<Reloc::Model> RM,
1087- CodeModel::Model CM, CodeGenOpt::Level OL) {
1088- return new TargetMachineImpl (T, TT, CPU, FS, Options, RM, CM, OL);
1063+ static TargetMachine *
1064+ Allocator (const Target &T, const Triple &TT, StringRef CPU, StringRef FS,
1065+ const TargetOptions &Options, Optional<Reloc::Model> RM,
1066+ Optional<CodeModel::Model> CM, CodeGenOpt::Level OL, bool JIT) {
1067+ return new TargetMachineImpl (T, TT, CPU, FS, Options, RM, CM, OL, JIT);
10891068 }
10901069};
10911070
0 commit comments