diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-08-23 07:21:06 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-08-23 07:21:06 +0000 |
commit | b5641a0ffcdabb890443f18c8c26b3552d56c378 (patch) | |
tree | 506c16910e0ec131ed2ebc352d23d52bc1348bcd /lib | |
parent | 859f4e262bb0289f882c19944621f967678d894f (diff) | |
download | external_llvm-b5641a0ffcdabb890443f18c8c26b3552d56c378.tar.gz external_llvm-b5641a0ffcdabb890443f18c8c26b3552d56c378.tar.bz2 external_llvm-b5641a0ffcdabb890443f18c8c26b3552d56c378.zip |
Perform correct codegen for eh_dwarf_cfa intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 78539d454e..1dde705bf5 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -2751,11 +2751,19 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::eh_dwarf_cfa: { if (ExceptionHandling) { MVT::ValueType VT = getValue(I.getOperand(1)).getValueType(); + SDOperand CfaArg; + if (MVT::getSizeInBits(VT) > MVT::getSizeInBits(TLI.getPointerTy())) + CfaArg = DAG.getNode(ISD::TRUNCATE, + TLI.getPointerTy(), getValue(I.getOperand(1))); + else + CfaArg = DAG.getNode(ISD::SIGN_EXTEND, + TLI.getPointerTy(), getValue(I.getOperand(1))); + SDOperand Offset = DAG.getNode(ISD::ADD, TLI.getPointerTy(), DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, - VT), - getValue(I.getOperand(1))); + TLI.getPointerTy()), + CfaArg); setValue(&I, DAG.getNode(ISD::ADD, TLI.getPointerTy(), DAG.getNode(ISD::FRAMEADDR, |