forked from OSchip/llvm-project
[lanai] Use Optional<Reloc> in LanaiTargetMachine.
Follow r269988 and use Optional<Reloc>. llvm-svn: 270176
This commit is contained in:
parent
565463fbba
commit
813e83734d
|
@ -40,7 +40,6 @@ LanaiSubtarget &LanaiSubtarget::initializeSubtargetDependencies(StringRef CPU,
|
|||
LanaiSubtarget::LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,
|
||||
StringRef FeatureString, const TargetMachine &TM,
|
||||
const TargetOptions &Options,
|
||||
Reloc::Model RelocationModel,
|
||||
CodeModel::Model CodeModel,
|
||||
CodeGenOpt::Level OptLevel)
|
||||
: LanaiGenSubtargetInfo(TargetTriple, Cpu, FeatureString),
|
||||
|
|
|
@ -34,8 +34,8 @@ public:
|
|||
// of the specified triple.
|
||||
LanaiSubtarget(const Triple &TargetTriple, StringRef Cpu,
|
||||
StringRef FeatureString, const TargetMachine &TM,
|
||||
const TargetOptions &Options, Reloc::Model RelocationModel,
|
||||
CodeModel::Model CodeModel, CodeGenOpt::Level OptLevel);
|
||||
const TargetOptions &Options, CodeModel::Model CodeModel,
|
||||
CodeGenOpt::Level OptLevel);
|
||||
|
||||
// ParseSubtargetFeatures - Parses features string setting specified
|
||||
// subtarget options. Definition of function is auto generated by tblgen.
|
||||
|
|
|
@ -47,18 +47,23 @@ static std::string computeDataLayout(const Triple &TT) {
|
|||
"-S64"; // 64 bit natural stack alignment
|
||||
}
|
||||
|
||||
LanaiTargetMachine::LanaiTargetMachine(const Target &TheTarget,
|
||||
const Triple &TargetTriple,
|
||||
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
||||
Optional<Reloc::Model> RM) {
|
||||
if (!RM.hasValue())
|
||||
return Reloc::Static;
|
||||
return *RM;
|
||||
}
|
||||
|
||||
LanaiTargetMachine::LanaiTargetMachine(const Target &T, const Triple &TT,
|
||||
StringRef Cpu, StringRef FeatureString,
|
||||
const TargetOptions &Options,
|
||||
Reloc::Model RelocationModel,
|
||||
Optional<Reloc::Model> RM,
|
||||
CodeModel::Model CodeModel,
|
||||
CodeGenOpt::Level OptLevel)
|
||||
: LLVMTargetMachine(TheTarget, computeDataLayout(TargetTriple),
|
||||
TargetTriple, Cpu, FeatureString, Options,
|
||||
RelocationModel, CodeModel, OptLevel),
|
||||
Subtarget(TargetTriple, Cpu, FeatureString, *this, Options,
|
||||
RelocationModel, CodeModel, OptLevel),
|
||||
: LLVMTargetMachine(T, computeDataLayout(TargetTriple), TT, Cpu,
|
||||
FeatureString, Options, getEffectiveRelocModel(TT, RM),
|
||||
CodeModel, OptLevel),
|
||||
Subtarget(TT, Cpu, FeatureString, *this, Options, CodeModel, OptLevel),
|
||||
TLOF(new LanaiTargetObjectFile()) {
|
||||
initAsmInfo();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@ class LanaiTargetMachine : public LLVMTargetMachine {
|
|||
public:
|
||||
LanaiTargetMachine(const Target &TheTarget, const Triple &TargetTriple,
|
||||
StringRef Cpu, StringRef FeatureString,
|
||||
const TargetOptions &Options, Reloc::Model RelocationModel,
|
||||
const TargetOptions &Options,
|
||||
Optional<Reloc::Model> RelocationModel,
|
||||
CodeModel::Model CodeModel, CodeGenOpt::Level OptLevel);
|
||||
|
||||
const LanaiSubtarget *
|
||||
|
|
Loading…
Reference in New Issue