summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCAsmBackend.cpp')
-rw-r--r--llvm/lib/MC/MCAsmBackend.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCAsmBackend.cpp b/llvm/lib/MC/MCAsmBackend.cpp
index 3642f37aa85..b4a4d0a8996 100644
--- a/llvm/lib/MC/MCAsmBackend.cpp
+++ b/llvm/lib/MC/MCAsmBackend.cpp
@@ -10,6 +10,7 @@
#include "llvm/MC/MCAsmBackend.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/MC/MCCodePadder.h"
#include "llvm/MC/MCFixupKindInfo.h"
#include <cassert>
#include <cstddef>
@@ -17,7 +18,10 @@
using namespace llvm;
-MCAsmBackend::MCAsmBackend() = default;
+MCAsmBackend::MCAsmBackend() : CodePadder(new MCCodePadder()) {}
+
+MCAsmBackend::MCAsmBackend(std::unique_ptr<MCCodePadder> TargetCodePadder)
+ : CodePadder(std::move(TargetCodePadder)) {}
MCAsmBackend::~MCAsmBackend() = default;
@@ -59,3 +63,25 @@ bool MCAsmBackend::fixupNeedsRelaxationAdvanced(
return true;
return fixupNeedsRelaxation(Fixup, Value, DF, Layout);
}
+
+void MCAsmBackend::handleCodePaddingBasicBlockStart(
+ MCObjectStreamer *OS, const MCCodePaddingContext &Context) {
+ CodePadder->handleBasicBlockStart(OS, Context);
+}
+
+void MCAsmBackend::handleCodePaddingBasicBlockEnd(
+ const MCCodePaddingContext &Context) {
+ CodePadder->handleBasicBlockEnd(Context);
+}
+
+void MCAsmBackend::handleCodePaddingInstructionBegin(const MCInst &Inst) {
+ CodePadder->handleInstructionBegin(Inst);
+}
+
+void MCAsmBackend::handleCodePaddingInstructionEnd(const MCInst &Inst) {
+ CodePadder->handleInstructionEnd(Inst);
+}
+
+bool MCAsmBackend::relaxFragment(MCPaddingFragment *PF, MCAsmLayout &Layout) {
+ return CodePadder->relaxFragment(PF, Layout);
+} \ No newline at end of file
OpenPOWER on IntegriCloud