[llvm] r210634 - MC: add enumeration of WinEH data encoding

Saleem Abdulrasool compnerd at compnerd.org
Tue Jun 10 21:19:26 PDT 2014


Author: compnerd
Date: Tue Jun 10 23:19:25 2014
New Revision: 210634

URL: http://llvm.org/viewvc/llvm-project?rev=210634&view=rev
Log:
MC: add enumeration of WinEH data encoding

Most Windows platforms use auxiliary data for unwinding.  This information is
stored in the .pdata section.  The encoding format for the data differs between
architectures and Windows variants.  Windows MIPS and Alpha use identical
formats; Alpha64 is the same with different widths.  Windows x86_64 and Itanium
share the representation.  All Windows CE entries are identical irrespective of
the architecture.  ARMv7 (Windows [NT] on ARM) has its own format.

This enumeration will become the differentiator once the windows EH emission
infrastructure is generalised, allowing us to emit the necessary unwinding
information for Windows on ARM.

Modified:
    llvm/trunk/include/llvm/MC/MCAsmInfo.h
    llvm/trunk/lib/MC/MCAsmInfo.cpp

Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=210634&r1=210633&r2=210634&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Tue Jun 10 23:19:25 2014
@@ -29,6 +29,18 @@ class MCStreamer;
 class MCSymbol;
 class MCContext;
 
+namespace WinEH {
+enum class EncodingType {
+  ET_Invalid, /// Invalid
+  ET_Alpha,   /// Windows Alpha
+  ET_Alpha64, /// Windows AXP64
+  ET_ARM,     /// Windows NT (Windows on ARM)
+  ET_CE,      /// Windows CE ARM, PowerPC, SH3, SH4
+  ET_Itanium, /// Windows x64, Windows Itanium (IA-64)
+  ET_MIPS = ET_Alpha,
+};
+}
+
 namespace ExceptionHandling {
 enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
 }
@@ -286,9 +298,12 @@ protected:
   /// false.
   bool SupportsDebugInformation;
 
-  /// True if target supports exception handling.  Defaults to None
+  /// Exception handling format for the target.  Defaults to None.
   ExceptionHandling::ExceptionsType ExceptionsType;
 
+  /// Windows exception handling data (.pdata) encoding.  Defaults to Invalid.
+  WinEH::EncodingType WinEHEncodingType;
+
   /// True if Dwarf2 output generally uses relocations for references to other
   /// .debug_* sections.
   bool DwarfUsesRelocationsAcrossSections;
@@ -460,6 +475,9 @@ public:
   ExceptionHandling::ExceptionsType getExceptionHandlingType() const {
     return ExceptionsType;
   }
+  WinEH::EncodingType getWinEHEncodingType() const {
+    return WinEHEncodingType;
+  }
   bool isExceptionHandlingDwarf() const {
     return (ExceptionsType == ExceptionHandling::DwarfCFI ||
             ExceptionsType == ExceptionHandling::ARM ||

Modified: llvm/trunk/lib/MC/MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmInfo.cpp?rev=210634&r1=210633&r2=210634&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmInfo.cpp Tue Jun 10 23:19:25 2014
@@ -82,6 +82,7 @@ MCAsmInfo::MCAsmInfo() {
   HasLEB128 = false;
   SupportsDebugInformation = false;
   ExceptionsType = ExceptionHandling::None;
+  WinEHEncodingType = WinEH::EncodingType::ET_Invalid;
   DwarfUsesRelocationsAcrossSections = true;
   DwarfFDESymbolsUseAbsDiff = false;
   DwarfRegNumForCFI = false;
@@ -99,7 +100,7 @@ MCAsmInfo::MCAsmInfo() {
   //   - MCAsmInfoDarwin is handling this case
   // - Generic_GCC toolchains enable the integrated assembler on a per
   //   architecture basis.
-  //   - The target subclasses for AArch64, ARM, and X86  handle these cases
+  //   - The target subclasses for AArch64, ARM, and X86 handle these cases
   UseIntegratedAssembler = false;
 
   CompressDebugSections = false;





More information about the llvm-commits mailing list