@@ -38,7 +38,9 @@ static cl::opt<bool>
38
38
BranchRelaxation (" sparc-enable-branch-relax" , cl::Hidden, cl::init(true ),
39
39
cl::desc(" Relax out of range conditional branches" ));
40
40
41
- static std::string computeDataLayout (const Triple &T, bool is64Bit) {
41
+ static std::string computeDataLayout (const Triple &T) {
42
+ const bool is64Bit = T.isSPARC64 ();
43
+
42
44
// Sparc is typically big endian, but some are little.
43
45
std::string Ret = T.getArch () == Triple::sparcel ? " e" : " E" ;
44
46
Ret += " -m:e" ;
@@ -107,15 +109,14 @@ SparcTargetMachine::SparcTargetMachine(const Target &T, const Triple &TT,
107
109
const TargetOptions &Options,
108
110
std::optional<Reloc::Model> RM,
109
111
std::optional<CodeModel::Model> CM,
110
- CodeGenOptLevel OL, bool JIT,
111
- bool is64bit)
112
+ CodeGenOptLevel OL, bool JIT)
112
113
: CodeGenTargetMachineImpl(
113
- T, computeDataLayout(TT, is64bit ), TT, CPU, FS, Options,
114
+ T, computeDataLayout(TT), TT, CPU, FS, Options,
114
115
getEffectiveRelocModel(RM),
115
- getEffectiveSparcCodeModel(CM, getEffectiveRelocModel(RM), is64bit,
116
- JIT),
116
+ getEffectiveSparcCodeModel(CM, getEffectiveRelocModel(RM),
117
+ TT.isSPARC64(), JIT),
117
118
OL),
118
- TLOF(std::make_unique<SparcELFTargetObjectFile>()), is64Bit(is64bit) {
119
+ TLOF(std::make_unique<SparcELFTargetObjectFile>()) {
119
120
initAsmInfo ();
120
121
}
121
122
@@ -148,8 +149,7 @@ SparcTargetMachine::getSubtargetImpl(const Function &F) const {
148
149
// creation will depend on the TM and the code generation flags on the
149
150
// function that reside in TargetOptions.
150
151
resetTargetOptions (F);
151
- I = std::make_unique<SparcSubtarget>(CPU, TuneCPU, FS, *this ,
152
- this ->is64Bit );
152
+ I = std::make_unique<SparcSubtarget>(CPU, TuneCPU, FS, *this );
153
153
}
154
154
return I.get ();
155
155
}
@@ -212,7 +212,7 @@ SparcV8TargetMachine::SparcV8TargetMachine(const Target &T, const Triple &TT,
212
212
std::optional<Reloc::Model> RM,
213
213
std::optional<CodeModel::Model> CM,
214
214
CodeGenOptLevel OL, bool JIT)
215
- : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT, false ) {}
215
+ : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT) {}
216
216
217
217
void SparcV9TargetMachine::anchor () { }
218
218
@@ -222,7 +222,7 @@ SparcV9TargetMachine::SparcV9TargetMachine(const Target &T, const Triple &TT,
222
222
std::optional<Reloc::Model> RM,
223
223
std::optional<CodeModel::Model> CM,
224
224
CodeGenOptLevel OL, bool JIT)
225
- : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT, true ) {}
225
+ : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT) {}
226
226
227
227
void SparcelTargetMachine::anchor () {}
228
228
@@ -232,4 +232,4 @@ SparcelTargetMachine::SparcelTargetMachine(const Target &T, const Triple &TT,
232
232
std::optional<Reloc::Model> RM,
233
233
std::optional<CodeModel::Model> CM,
234
234
CodeGenOptLevel OL, bool JIT)
235
- : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT, false ) {}
235
+ : SparcTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, JIT) {}
0 commit comments