[llvm] r316076 - [AVR] Update to current LLVM API
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 18 05:35:15 PDT 2017
Author: dylanmckay
Date: Wed Oct 18 05:35:15 2017
New Revision: 316076
URL: http://llvm.org/viewvc/llvm-project?rev=316076&view=rev
Log:
[AVR] Update to current LLVM API
r315410 broke a number of things in the AVR backend, which are now
fixed.
Modified:
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp
llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp?rev=316076&r1=316075&r2=316076&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp Wed Oct 18 05:35:15 2017
@@ -340,7 +340,8 @@ void AVRAsmBackend::adjustFixupValue(con
}
}
-MCObjectWriter *AVRAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const {
+std::unique_ptr<MCObjectWriter>
+AVRAsmBackend::createObjectWriter(raw_pwrite_stream &OS) const {
return createAVRELFObjectWriter(OS,
MCELFObjectTargetWriter::getOSABI(OSType));
}
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h?rev=316076&r1=316075&r2=316076&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.h Wed Oct 18 05:35:15 2017
@@ -38,7 +38,7 @@ public:
void adjustFixupValue(const MCFixup &Fixup, const MCValue &Target,
uint64_t &Value, MCContext *Ctx = nullptr) const;
- MCObjectWriter *createObjectWriter(raw_pwrite_stream &OS) const override;
+ std::unique_ptr<MCObjectWriter> createObjectWriter(raw_pwrite_stream &OS) const override;
void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup,
const MCValue &Target, MutableArrayRef<char> Data,
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp?rev=316076&r1=316075&r2=316076&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp Wed Oct 18 05:35:15 2017
@@ -13,6 +13,7 @@
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCELFObjectWriter.h"
#include "llvm/MC/MCExpr.h"
+#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCValue.h"
#include "llvm/Support/ErrorHandling.h"
@@ -118,9 +119,10 @@ unsigned AVRELFObjectWriter::getRelocTyp
}
}
-MCObjectWriter *createAVRELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI) {
- MCELFObjectTargetWriter *MOTW = new AVRELFObjectWriter(OSABI);
- return createELFObjectWriter(MOTW, OS, true);
+std::unique_ptr<MCObjectWriter>
+createAVRELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI) {
+ std::unique_ptr<MCELFObjectTargetWriter> MOTW(new AVRELFObjectWriter(OSABI));
+ return createELFObjectWriter(std::move(MOTW), OS, true);
}
} // end of namespace llvm
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp?rev=316076&r1=316075&r2=316076&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.cpp Wed Oct 18 05:35:15 2017
@@ -18,6 +18,7 @@
#include "InstPrinter/AVRInstPrinter.h"
#include "llvm/MC/MCELFStreamer.h"
+#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
@@ -66,9 +67,12 @@ static MCInstPrinter *createAVRMCInstPri
}
static MCStreamer *createMCStreamer(const Triple &T, MCContext &Context,
- MCAsmBackend &MAB, raw_pwrite_stream &OS,
- MCCodeEmitter *Emitter, bool RelaxAll) {
- return createELFStreamer(Context, MAB, OS, Emitter, RelaxAll);
+ std::unique_ptr<MCAsmBackend> &&MAB,
+ raw_pwrite_stream &OS,
+ std::unique_ptr<MCCodeEmitter> &&Emitter,
+ bool RelaxAll) {
+ return createELFStreamer(Context, std::move(MAB), OS,
+ std::move(Emitter), RelaxAll);
}
static MCTargetStreamer *
Modified: llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h?rev=316076&r1=316075&r2=316076&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h Wed Oct 18 05:35:15 2017
@@ -16,6 +16,8 @@
#include "llvm/Support/DataTypes.h"
+#include <memory>
+
namespace llvm {
class MCAsmBackend;
@@ -43,7 +45,8 @@ MCAsmBackend *createAVRAsmBackend(const
const llvm::MCTargetOptions &TO);
/// Creates an ELF object writer for AVR.
-MCObjectWriter *createAVRELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI);
+std::unique_ptr<MCObjectWriter>
+createAVRELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI);
} // end namespace llvm
More information about the llvm-commits
mailing list