[llvm] r270292 - [AVR] Fix signuature of AVRTargetMachine constructor
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Fri May 20 16:39:05 PDT 2016
Author: dylanmckay
Date: Fri May 20 18:39:04 2016
New Revision: 270292
URL: http://llvm.org/viewvc/llvm-project?rev=270292&view=rev
Log:
[AVR] Fix signuature of AVRTargetMachine constructor
Modified:
llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp
llvm/trunk/lib/Target/AVR/AVRTargetMachine.h
Modified: llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp?rev=270292&r1=270291&r2=270292&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRTargetMachine.cpp Fri May 20 18:39:04 2016
@@ -34,14 +34,18 @@ static StringRef getCPU(StringRef CPU) {
return CPU;
}
+static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) {
+ return RM.hasValue() ? *RM : Reloc::Static;
+}
+
AVRTargetMachine::AVRTargetMachine(const Target &T, const Triple &TT,
StringRef CPU, StringRef FS,
const TargetOptions &Options,
- Reloc::Model RM, CodeModel::Model CM,
+ Optional<Reloc::Model> RM, CodeModel::Model CM,
CodeGenOpt::Level OL)
: LLVMTargetMachine(
T, "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8-i64:8:8-f32:8:8-f64:8:8-n8", TT,
- getCPU(CPU), FS, Options, RM, CM, OL),
+ getCPU(CPU), FS, Options, getEffectiveRelocModel(RM), CM, OL),
SubTarget(TT, getCPU(CPU), FS, *this) {
this->TLOF = make_unique<AVRTargetObjectFile>();
initAsmInfo();
Modified: llvm/trunk/lib/Target/AVR/AVRTargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRTargetMachine.h?rev=270292&r1=270291&r2=270292&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRTargetMachine.h (original)
+++ llvm/trunk/lib/Target/AVR/AVRTargetMachine.h Fri May 20 18:39:04 2016
@@ -29,7 +29,7 @@ namespace llvm {
class AVRTargetMachine : public LLVMTargetMachine {
public:
AVRTargetMachine(const Target &T, const Triple &TT, StringRef CPU,
- StringRef FS, const TargetOptions &Options, Reloc::Model RM,
+ StringRef FS, const TargetOptions &Options, Optional<Reloc::Model> RM,
CodeModel::Model CM, CodeGenOpt::Level OL);
const AVRSubtarget *getSubtargetImpl() const;
@@ -39,7 +39,6 @@ public:
return this->TLOF.get();
}
- // Pass Pipeline Configuration.
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
private:
More information about the llvm-commits
mailing list