mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-25 19:29:53 +00:00
Rename the routines to reflect the reality that they are more related to call frame information than to Win64 EH. Although EH is implemented in an intertwined manner by augmenting with an exception handler and an associated parameter, the majority of these routines emit information required to unwind the frames. This also helps identify that these routines are generic for most windows platforms (they apply equally to nearly all architectures except x86) although the encoding of the information is architecture dependent. Unwinding data is emitted via EmitWinCFI* and exception handling information via EmitWinEH*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211994 91177308-0d34-0410-b5e6-96231b3b80d8
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
//===-- X86WinCOFFStreamer.cpp - X86 Target WinCOFF Streamer ----*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "X86MCTargetDesc.h"
|
|
#include "llvm/MC/MCWinCOFFStreamer.h"
|
|
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
class X86WinCOFFStreamer : public MCWinCOFFStreamer {
|
|
public:
|
|
X86WinCOFFStreamer(MCContext &C, MCAsmBackend &AB, MCCodeEmitter *CE,
|
|
raw_ostream &OS)
|
|
: MCWinCOFFStreamer(C, AB, *CE, OS) { }
|
|
|
|
void EmitWinEHHandlerData() override;
|
|
void FinishImpl() override;
|
|
};
|
|
|
|
void X86WinCOFFStreamer::EmitWinEHHandlerData() {
|
|
MCStreamer::EmitWinEHHandlerData();
|
|
|
|
// We have to emit the unwind info now, because this directive
|
|
// actually switches to the .xdata section!
|
|
MCWin64EHUnwindEmitter::EmitUnwindInfo(*this, getCurrentW64UnwindInfo());
|
|
}
|
|
|
|
void X86WinCOFFStreamer::FinishImpl() {
|
|
EmitFrames(nullptr);
|
|
EmitW64Tables();
|
|
|
|
MCWinCOFFStreamer::FinishImpl();
|
|
}
|
|
}
|
|
|
|
namespace llvm {
|
|
MCStreamer *createX86WinCOFFStreamer(MCContext &C, MCAsmBackend &AB,
|
|
MCCodeEmitter *CE, raw_ostream &OS,
|
|
bool RelaxAll) {
|
|
X86WinCOFFStreamer *S = new X86WinCOFFStreamer(C, AB, CE, OS);
|
|
S->getAssembler().setRelaxAll(RelaxAll);
|
|
return S;
|
|
}
|
|
}
|
|
|