[PATCH] ARM: move ARMUnwindOp.h into Support

Saleem Abdulrasool compnerd at compnerd.org
Tue Dec 31 12:16:55 PST 2013


Hi t.p.northover, rengolin, logan,

Move the ARM EHABI unwind opcode definitions from the ARM MCTargetDesc into LLVM
Support.  This enables sharing of the definitions across the ARM target code as
well as llvm-readobj.  This will allow implementation of the unwind decoding in
llvm-readobj.

http://llvm-reviews.chandlerc.com/D2494

Files:
  include/llvm/Support/ARMEHABI.h
  lib/Target/ARM/MCTargetDesc/ARMUnwindOp.h
  lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
  lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp
  lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h

Index: include/llvm/Support/ARMEHABI.h
===================================================================
--- include/llvm/Support/ARMEHABI.h
+++ include/llvm/Support/ARMEHABI.h
@@ -1,4 +1,4 @@
-//===-- ARMUnwindOp.h - ARM Unwind Opcodes ----------------------*- C++ -*-===//
+//===--- ARMEHABI.h - ARM Exception Handling ABI ----------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -12,13 +12,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef ARM_UNWIND_OP_H
-#define ARM_UNWIND_OP_H
+#ifndef LLVM_SUPPORT_ARM_EHABI_H
+#define LLVM_SUPPORT_ARM_EHABI_H
 
 namespace llvm {
-
+namespace ARM {
+namespace EHABI {
   /// ARM exception handling table entry kinds
-  enum ARMEHTEntryKind {
+  enum EHTEntryKind {
     EHT_GENERIC = 0x00,
     EHT_COMPACT = 0x80
   };
@@ -29,7 +30,7 @@
   };
 
   /// ARM-defined frame unwinding opcodes
-  enum ARMUnwindOpcodes {
+  enum UnwindOpcodes {
     // Format: 00xxxxxx
     // Purpose: vsp = vsp + ((x << 2) + 4)
     UNWIND_OPCODE_INC_VSP = 0x00,
@@ -108,7 +109,7 @@
   };
 
   /// ARM-defined Personality Routine Index
-  enum ARMPersonalityRoutineIndex {
+  enum PersonalityRoutineIndex {
     // To make the exception handling table become more compact, ARM defined
     // several personality routines in EHABI.  There are 3 different
     // personality routines in ARM EHABI currently.  It is possible to have 16
@@ -119,7 +120,8 @@
 
     NUM_PERSONALITY_INDEX
   };
-
+}
+}
 }
 
 #endif // ARM_UNWIND_OP_H
Index: lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
@@ -17,7 +17,6 @@
 #include "ARMArchName.h"
 #include "ARMFPUName.h"
 #include "ARMRegisterInfo.h"
-#include "ARMUnwindOp.h"
 #include "ARMUnwindOpAsm.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/StringExtras.h"
@@ -40,13 +39,15 @@
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/MC/MCSymbol.h"
 #include "llvm/MC/MCValue.h"
+#include "llvm/Support/ARMEHABI.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ELF.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 
 using namespace llvm;
+using namespace ARM::EHABI;
 
 static std::string GetAEABIUnwindPersonalityName(unsigned Index) {
   assert(Index < NUM_PERSONALITY_INDEX && "Invalid personality index");
Index: lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp
@@ -13,12 +13,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "ARMUnwindOpAsm.h"
-
-#include "ARMUnwindOp.h"
+#include "llvm/Support/ARMEHABI.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/LEB128.h"
 
 using namespace llvm;
+using namespace ARM::EHABI;
 
 namespace {
   /// UnwindOpcodeStreamer - The simple wrapper over SmallVector to emit bytes
Index: lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h
+++ lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h
@@ -15,10 +15,9 @@
 #ifndef ARM_UNWIND_OP_ASM_H
 #define ARM_UNWIND_OP_ASM_H
 
-#include "ARMUnwindOp.h"
-
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ARMEHABI.h"
 #include "llvm/Support/DataTypes.h"
 
 namespace llvm {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2494.1.patch
Type: text/x-patch
Size: 3646 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131231/41f27c57/attachment.bin>


More information about the llvm-commits mailing list