Add a bool to indicate if we should set the "indirect encoding" bit in the Dwarf
authorBill Wendling <isanbard@gmail.com>
Tue, 11 Sep 2007 17:20:55 +0000 (17:20 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 11 Sep 2007 17:20:55 +0000 (17:20 +0000)
information for EH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41852 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/CodeGen/DwarfWriter.cpp
lib/Target/TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 97eaa3598cbcbe8bd1a83e969f5ac5ac1710ffad..3326088a96527b1650e5a8a05496df070515bf48 100644 (file)
@@ -116,6 +116,11 @@ namespace llvm {
     const char *PersonalityPrefix;        // Defaults to ""
     const char *PersonalitySuffix;        // Defaults to ""
 
+    /// NeedsIndirectEncoding - If set, we need to set the indirect encoding bit
+    /// for EH in Dwarf.
+    /// 
+    bool NeedsIndirectEncoding;           // Defaults to false
+
     /// InlineAsmStart/End - If these are nonempty, they contain a directive to
     /// emit before and after an inline assembly statement.
     const char *InlineAsmStart;           // Defaults to "#APP\n"
index 2b4b4ce135f3ffe7e769e4826621c0f07bd7a8a6..cf6a922d23ce444ba09174ff79e78bea5297f516 100644 (file)
@@ -2789,7 +2789,12 @@ private:
     if (Personality) {
       Asm->EmitULEB128Bytes(7);
       Asm->EOL("Augmentation Size");
-      Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect);
+
+      if (TAI->getNeedsIndirectEncoding())
+        Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4 | DW_EH_PE_indirect);
+      else
+        Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_sdata4);
+
       Asm->EOL("Personality (pcrel sdata4 indirect)");
       
       PrintRelDirective();
index 09a8d5ab8e772e1340aecc8d380f82d5f847d97e..1a3daf0eaa90f3346f85e49277d6d0ab6c2ebb04 100644 (file)
@@ -40,6 +40,7 @@ TargetAsmInfo::TargetAsmInfo() :
   FunctionAddrSuffix(""),
   PersonalityPrefix(""),
   PersonalitySuffix(""),
+  NeedsIndirectEncoding(false),
   InlineAsmStart("#APP"),
   InlineAsmEnd("#NO_APP"),
   AssemblerDialect(0),
index 414782ee4db8c7062dd0103befc68e66b8cac47b..05cf2bfdaba6a612c84ec1e1c0f347bcf36d6110 100644 (file)
@@ -70,6 +70,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     }
     PersonalityPrefix = "L";
     PersonalitySuffix = "$non_lazy_ptr";
+    NeedsIndirectEncoding = true;
     InlineAsmStart = "# InlineAsm Start";
     InlineAsmEnd = "# InlineAsm End";
     SetDirective = "\t.set";