Rename Win64Exception.(cpp|h) to WinException.(cpp|h)

This is in preparation for reusing this for 32-bit x86 EH table
emission.  Also updates the type name for consistency. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2015-05-28 22:47:01 +00:00
parent b78a66659b
commit 178db50629
4 changed files with 18 additions and 18 deletions

View File

@ -14,7 +14,7 @@
#include "llvm/CodeGen/AsmPrinter.h" #include "llvm/CodeGen/AsmPrinter.h"
#include "DwarfDebug.h" #include "DwarfDebug.h"
#include "DwarfException.h" #include "DwarfException.h"
#include "Win64Exception.h" #include "WinException.h"
#include "WinCodeViewLineTables.h" #include "WinCodeViewLineTables.h"
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
@ -269,7 +269,7 @@ bool AsmPrinter::doInitialization(Module &M) {
case WinEH::EncodingType::Invalid: case WinEH::EncodingType::Invalid:
break; break;
case WinEH::EncodingType::Itanium: case WinEH::EncodingType::Itanium:
ES = new Win64Exception(this); ES = new WinException(this);
break; break;
} }
break; break;

View File

@ -18,7 +18,7 @@ add_llvm_library(LLVMAsmPrinter
EHStreamer.cpp EHStreamer.cpp
ErlangGCPrinter.cpp ErlangGCPrinter.cpp
OcamlGCPrinter.cpp OcamlGCPrinter.cpp
Win64Exception.cpp WinException.cpp
WinCodeViewLineTables.cpp WinCodeViewLineTables.cpp
) )

View File

@ -1,4 +1,4 @@
//===-- CodeGen/AsmPrinter/Win64Exception.cpp - Dwarf Exception Impl ------===// //===-- CodeGen/AsmPrinter/WinException.cpp - Dwarf Exception Impl ------===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -11,7 +11,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "Win64Exception.h" #include "WinException.h"
#include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h" #include "llvm/ADT/Twine.h"
@ -38,18 +38,18 @@
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm; using namespace llvm;
Win64Exception::Win64Exception(AsmPrinter *A) WinException::WinException(AsmPrinter *A)
: EHStreamer(A), shouldEmitPersonality(false), shouldEmitLSDA(false), : EHStreamer(A), shouldEmitPersonality(false), shouldEmitLSDA(false),
shouldEmitMoves(false) {} shouldEmitMoves(false) {}
Win64Exception::~Win64Exception() {} WinException::~WinException() {}
/// endModule - Emit all exception information that should come after the /// endModule - Emit all exception information that should come after the
/// content. /// content.
void Win64Exception::endModule() { void WinException::endModule() {
} }
void Win64Exception::beginFunction(const MachineFunction *MF) { void WinException::beginFunction(const MachineFunction *MF) {
shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false; shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
// If any landing pads survive, we need an EH table. // If any landing pads survive, we need an EH table.
@ -104,7 +104,7 @@ void Win64Exception::beginFunction(const MachineFunction *MF) {
/// endFunction - Gather and emit post-function exception information. /// endFunction - Gather and emit post-function exception information.
/// ///
void Win64Exception::endFunction(const MachineFunction *MF) { void WinException::endFunction(const MachineFunction *MF) {
if (!shouldEmitPersonality && !shouldEmitMoves) if (!shouldEmitPersonality && !shouldEmitMoves)
return; return;
@ -136,14 +136,14 @@ void Win64Exception::endFunction(const MachineFunction *MF) {
Asm->OutStreamer->EmitWinCFIEndProc(); Asm->OutStreamer->EmitWinCFIEndProc();
} }
const MCExpr *Win64Exception::createImageRel32(const MCSymbol *Value) { const MCExpr *WinException::createImageRel32(const MCSymbol *Value) {
if (!Value) if (!Value)
return MCConstantExpr::Create(0, Asm->OutContext); return MCConstantExpr::Create(0, Asm->OutContext);
return MCSymbolRefExpr::Create(Value, MCSymbolRefExpr::VK_COFF_IMGREL32, return MCSymbolRefExpr::Create(Value, MCSymbolRefExpr::VK_COFF_IMGREL32,
Asm->OutContext); Asm->OutContext);
} }
const MCExpr *Win64Exception::createImageRel32(const GlobalValue *GV) { const MCExpr *WinException::createImageRel32(const GlobalValue *GV) {
if (!GV) if (!GV)
return MCConstantExpr::Create(0, Asm->OutContext); return MCConstantExpr::Create(0, Asm->OutContext);
return createImageRel32(Asm->getSymbol(GV)); return createImageRel32(Asm->getSymbol(GV));
@ -177,7 +177,7 @@ const MCExpr *Win64Exception::createImageRel32(const GlobalValue *GV) {
/// imagerel32 LabelLPad; // Zero means __finally. /// imagerel32 LabelLPad; // Zero means __finally.
/// } Entries[NumEntries]; /// } Entries[NumEntries];
/// }; /// };
void Win64Exception::emitCSpecificHandlerTable() { void WinException::emitCSpecificHandlerTable() {
const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads(); const std::vector<LandingPadInfo> &PadInfos = MMI->getLandingPads();
// Simplifying assumptions for first implementation: // Simplifying assumptions for first implementation:
@ -264,7 +264,7 @@ void Win64Exception::emitCSpecificHandlerTable() {
} }
} }
void Win64Exception::emitCXXFrameHandler3Table(const MachineFunction *MF) { void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) {
const Function *F = MF->getFunction(); const Function *F = MF->getFunction();
const Function *ParentF = MMI->getWinEHParent(F); const Function *ParentF = MMI->getWinEHParent(F);
auto &OS = *Asm->OutStreamer; auto &OS = *Asm->OutStreamer;

View File

@ -1,4 +1,4 @@
//===-- Win64Exception.h - Windows Exception Handling ----------*- C++ -*--===// //===-- WinException.h - Windows Exception Handling ----------*- C++ -*--===//
// //
// The LLVM Compiler Infrastructure // The LLVM Compiler Infrastructure
// //
@ -21,7 +21,7 @@ class GlobalValue;
class MachineFunction; class MachineFunction;
class MCExpr; class MCExpr;
class Win64Exception : public EHStreamer { class WinException : public EHStreamer {
/// Per-function flag to indicate if personality info should be emitted. /// Per-function flag to indicate if personality info should be emitted.
bool shouldEmitPersonality; bool shouldEmitPersonality;
@ -42,8 +42,8 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.
// //
Win64Exception(AsmPrinter *A); WinException(AsmPrinter *A);
~Win64Exception() override; ~WinException() override;
/// Emit all exception information that should come after the content. /// Emit all exception information that should come after the content.
void endModule() override; void endModule() override;