diff options
author | Eric Christopher <echristo@apple.com> | 2009-10-28 21:32:16 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2009-10-28 21:32:16 +0000 |
commit | 7e5d2ff20fb4ca86b27f28fc5fb9d589bc0752fd (patch) | |
tree | baa8585c75c365e0d5bc22cde271fe84e87aa42f /lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | |
parent | a597103c328e29fb763e7a4864bd7c29a588fc9d (diff) |
Make sure we return the right sized type here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index f86e584e99..dfe24ae499 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -4220,10 +4220,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { assert(CI && "Non-constant type in __builtin_object_size?"); + SDValue Arg = getValue(I.getOperand(0)); + EVT Ty = Arg.getValueType(); + if (CI->getZExtValue() < 2) - setValue(&I, DAG.getConstant(-1, MVT::i32)); + setValue(&I, DAG.getConstant(-1, Ty)); else - setValue(&I, DAG.getConstant(0, MVT::i32)); + setValue(&I, DAG.getConstant(0, Ty)); return 0; } case Intrinsic::var_annotation: |