diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-02-29 22:09:08 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-02-29 22:09:08 +0000 |
commit | 8750d7c051d5450a649db135414a35a0a43c0da8 (patch) | |
tree | 25cf8aa3105f09b8b194bd1e6a6132de78d39421 /lib/Target/PowerPC | |
parent | 7e7d194e5ee11b6a68f23b973cc765c49492c1e4 (diff) | |
download | external_llvm-8750d7c051d5450a649db135414a35a0a43c0da8.zip external_llvm-8750d7c051d5450a649db135414a35a0a43c0da8.tar.gz external_llvm-8750d7c051d5450a649db135414a35a0a43c0da8.tar.bz2 |
Use enumeration for preffered EH dwarf encoding reason
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 8 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.h | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 34ea8c3..85ead11 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -92,11 +92,11 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) /// format used for encoding pointers in exception handling data. Reason is /// 0 for data, 1 for code labels, 2 for function pointers. Global is true /// if the symbol can be relocated. -unsigned DarwinTargetAsmInfo::PreferredEHDataFormat(unsigned Reason, +unsigned DarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const { - if (Reason == 2 && Global) + if (Reason == DwarfEncoding::Functions && Global) return (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4); - else if (Reason == 1 || !Global) + else if (Reason == DwarfEncoding::CodeLabels || !Global) return DW_EH_PE_pcrel; else return DW_EH_PE_absptr; @@ -154,7 +154,7 @@ LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) /// format used for encoding pointers in exception handling data. Reason is /// 0 for data, 1 for code labels, 2 for function pointers. Global is true /// if the symbol can be relocated. -unsigned LinuxTargetAsmInfo::PreferredEHDataFormat(unsigned Reason, +unsigned LinuxTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const { // We really need to write something here. return TargetAsmInfo::PreferredEHDataFormat(Reason, Global); diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h index c13063c..4884628 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h @@ -27,12 +27,14 @@ namespace llvm { struct DarwinTargetAsmInfo : public PPCTargetAsmInfo { explicit DarwinTargetAsmInfo(const PPCTargetMachine &TM); - virtual unsigned PreferredEHDataFormat(unsigned Reason, bool Global) const; + virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, + bool Global) const; }; struct LinuxTargetAsmInfo : public PPCTargetAsmInfo { explicit LinuxTargetAsmInfo(const PPCTargetMachine &TM); - virtual unsigned PreferredEHDataFormat(unsigned Reason, bool Global) const; + virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, + bool Global) const; }; } // namespace llvm |