@@ -101,19 +101,16 @@ class Target {
101
101
102
102
using MCAsmInfoCtorFnTy = MCAsmInfo *(*)(const MCRegisterInfo &MRI,
103
103
const Triple &TT);
104
- using MCAdjustCodeGenOptsFnTy = void (*)(const Triple &TT, Reloc::Model RM,
105
- CodeModel::Model &CM);
106
-
107
104
using MCInstrInfoCtorFnTy = MCInstrInfo *(*)();
108
105
using MCInstrAnalysisCtorFnTy = MCInstrAnalysis *(*)(const MCInstrInfo *Info);
109
106
using MCRegInfoCtorFnTy = MCRegisterInfo *(*)(const Triple &TT);
110
107
using MCSubtargetInfoCtorFnTy = MCSubtargetInfo *(*)(const Triple &TT,
111
108
StringRef CPU,
112
109
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 );
117
114
// If it weren't for layering issues (this header is in llvm/Support, but
118
115
// depends on MC?) this should take the Streamer by value rather than rvalue
119
116
// reference.
@@ -191,8 +188,6 @@ class Target {
191
188
// / registered.
192
189
MCAsmInfoCtorFnTy MCAsmInfoCtorFn;
193
190
194
- MCAdjustCodeGenOptsFnTy MCAdjustCodeGenOptsFn;
195
-
196
191
// / MCInstrInfoCtorFn - Constructor function for this target's MCInstrInfo,
197
192
// / if registered.
198
193
MCInstrInfoCtorFnTy MCInstrInfoCtorFn;
@@ -312,12 +307,6 @@ class Target {
312
307
return MCAsmInfoCtorFn (MRI, Triple (TheTriple));
313
308
}
314
309
315
- void adjustCodeGenOpts (const Triple &TT, Reloc::Model RM,
316
- CodeModel::Model &CM) const {
317
- if (MCAdjustCodeGenOptsFn)
318
- MCAdjustCodeGenOptsFn (TT, RM, CM);
319
- }
320
-
321
310
// / createMCInstrInfo - Create a MCInstrInfo implementation.
322
311
// /
323
312
MCInstrInfo *createMCInstrInfo () const {
@@ -365,15 +354,17 @@ class Target {
365
354
// / feature set; it should always be provided. Generally this should be
366
355
// / either the target triple from the module, or the target triple of the
367
356
// / 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 {
373
364
if (!TargetMachineCtorFn)
374
365
return nullptr ;
375
366
return TargetMachineCtorFn (*this , Triple (TT), CPU, Features, Options, RM,
376
- CM, OL);
367
+ CM, OL, JIT );
377
368
}
378
369
379
370
// / createMCAsmBackend - Create a target specific assembly parser.
@@ -663,11 +654,6 @@ struct TargetRegistry {
663
654
T.MCAsmInfoCtorFn = Fn;
664
655
}
665
656
666
- static void registerMCAdjustCodeGenOpts (Target &T,
667
- Target::MCAdjustCodeGenOptsFnTy Fn) {
668
- T.MCAdjustCodeGenOptsFn = Fn;
669
- }
670
-
671
657
// / RegisterMCInstrInfo - Register a MCInstrInfo implementation for the
672
658
// / given target.
673
659
// /
@@ -929,12 +915,6 @@ struct RegisterMCAsmInfoFn {
929
915
}
930
916
};
931
917
932
- struct RegisterMCAdjustCodeGenOptsFn {
933
- RegisterMCAdjustCodeGenOptsFn (Target &T, Target::MCAdjustCodeGenOptsFnTy Fn) {
934
- TargetRegistry::registerMCAdjustCodeGenOpts (T, Fn);
935
- }
936
- };
937
-
938
918
// / RegisterMCInstrInfo - Helper template for registering a target instruction
939
919
// / info implementation. This invokes the static "Create" method on the class
940
920
// / to actually do the construction. Usage:
@@ -1080,12 +1060,11 @@ template <class TargetMachineImpl> struct RegisterTargetMachine {
1080
1060
}
1081
1061
1082
1062
private:
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);
1089
1068
}
1090
1069
};
1091
1070
0 commit comments