summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-08-23 07:21:06 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-08-23 07:21:06 +0000
commit97cdac8d19d47edeef478c3738fcd429cdce7528 (patch)
treeab1b0d99f1b6c30da080b13fd90c6736eee8a4d8 /llvm/lib
parent10cb5e520f264abb558f1fa5e9b9cb76445f0675 (diff)
downloadbcm5719-llvm-97cdac8d19d47edeef478c3738fcd429cdce7528.tar.gz
bcm5719-llvm-97cdac8d19d47edeef478c3738fcd429cdce7528.zip
Perform correct codegen for eh_dwarf_cfa intrinsic.
llvm-svn: 41316
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 78539d454ed..1dde705bf59 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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,
OpenPOWER on IntegriCloud