]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/patches/patch-r262460-llvm-r202059-sparc.diff
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / patches / patch-r262460-llvm-r202059-sparc.diff
1 Pull in r202059 from upstream clang trunk (by Roman Divacky):
2
3   Implement getDwarfEHStackPointer() and initDwarfEHRegSizeTable() for sparcv9.
4
5 Introduced here: http://svnweb.freebsd.org/changeset/base/262460
6
7 Index: tools/clang/lib/CodeGen/TargetInfo.cpp
8 ===================================================================
9 --- tools/clang/lib/CodeGen/TargetInfo.cpp
10 +++ tools/clang/lib/CodeGen/TargetInfo.cpp
11 @@ -5435,10 +5435,51 @@ class SparcV9TargetCodeGenInfo : public TargetCode
12  public:
13    SparcV9TargetCodeGenInfo(CodeGenTypes &CGT)
14      : TargetCodeGenInfo(new SparcV9ABIInfo(CGT)) {}
15 +
16 +  int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const {
17 +    return 14;
18 +  }
19 +
20 +  bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
21 +                               llvm::Value *Address) const;
22  };
23  } // end anonymous namespace
24  
25 +bool
26 +SparcV9TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
27 +                                                llvm::Value *Address) const {
28 +  // This is calculated from the LLVM and GCC tables and verified
29 +  // against gcc output.  AFAIK all ABIs use the same encoding.
30  
31 +  CodeGen::CGBuilderTy &Builder = CGF.Builder;
32 +
33 +  llvm::IntegerType *i8 = CGF.Int8Ty;
34 +  llvm::Value *Four8 = llvm::ConstantInt::get(i8, 4);
35 +  llvm::Value *Eight8 = llvm::ConstantInt::get(i8, 8);
36 +
37 +  // 0-31: the 8-byte general-purpose registers
38 +  AssignToArrayRange(Builder, Address, Eight8, 0, 31);
39 +
40 +  // 32-63: f0-31, the 4-byte floating-point registers
41 +  AssignToArrayRange(Builder, Address, Four8, 32, 63);
42 +
43 +  //   Y   = 64
44 +  //   PSR = 65
45 +  //   WIM = 66
46 +  //   TBR = 67
47 +  //   PC  = 68
48 +  //   NPC = 69
49 +  //   FSR = 70
50 +  //   CSR = 71
51 +  AssignToArrayRange(Builder, Address, Eight8, 64, 71);
52 +   
53 +  // 72-87: d0-15, the 8-byte floating-point registers
54 +  AssignToArrayRange(Builder, Address, Eight8, 72, 87);
55 +
56 +  return false;
57 +}
58 +
59 +
60  //===----------------------------------------------------------------------===//
61  // Xcore ABI Implementation
62  //===----------------------------------------------------------------------===//