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 | 1fd4c577d2b8bfd32fa80f0a635d448c9cad5213 (patch) | |
tree | 64daf4ab19df4566c0bac6e7841db63236c97d73 /llvm/lib/CodeGen | |
parent | 5179f308a269f3262757aa311b3987fe67932421 (diff) | |
download | bcm5719-llvm-1fd4c577d2b8bfd32fa80f0a635d448c9cad5213.tar.gz bcm5719-llvm-1fd4c577d2b8bfd32fa80f0a635d448c9cad5213.zip |
Make sure we return the right sized type here.
llvm-svn: 85436
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index f86e584e999..dfe24ae4993 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/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: |