diff options
author | Bill Wendling <isanbard@gmail.com> | 2014-01-06 00:43:20 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2014-01-06 00:43:20 +0000 |
commit | 4644d79871d5c337608dff99816ddbdc40cb1175 (patch) | |
tree | c48572a9ed99ae6272ea444c0430eacf984e9b69 /lib/Target/PowerPC | |
parent | 7f1068198534f563fa7640056ec1d595e6662c09 (diff) | |
download | llvm-4644d79871d5c337608dff99816ddbdc40cb1175.tar.gz llvm-4644d79871d5c337608dff99816ddbdc40cb1175.tar.bz2 llvm-4644d79871d5c337608dff99816ddbdc40cb1175.tar.xz |
Refactor function that checks that __builtin_returnaddress's argument is constant.
This moves the check up into the parent class so that all targets can use it
without having to copy (and keep in sync) the same error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r-- | lib/Target/PowerPC/PPCISelLowering.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 630385cc7c..2e87681ab9 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -7796,11 +7796,8 @@ SDValue PPCTargetLowering::LowerRETURNADDR(SDValue Op, MachineFrameInfo *MFI = MF.getFrameInfo(); MFI->setReturnAddressIsTaken(true); - if (!isa<ConstantSDNode>(Op.getOperand(0))) { - DAG.getContext()->emitError("argument to '__builtin_return_address' must " - "be a constant integer"); + if (verifyReturnAddressArgumentIsConstant(Op, DAG)) return SDValue(); - } SDLoc dl(Op); unsigned Depth = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue(); |