Skip to content

Commit

Permalink
[CodeGen] Report error rather than crash when unable to makeLibCall.
Browse files Browse the repository at this point in the history
Also, make the assumption explicit in the header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233329 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ahmedbougacha committed Mar 26, 2015
1 parent 5cb4112 commit f55b1a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/llvm/Target/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -2030,6 +2030,7 @@ class TargetLowering : public TargetLoweringBase {
ISD::CondCode &CCCode, SDLoc DL) const;

/// Returns a pair of (return value, chain).
/// It is an error to pass RTLIB::UNKNOWN_LIBCALL as \p LC.
std::pair<SDValue, SDValue> makeLibCall(SelectionDAG &DAG, RTLIB::Libcall LC,
EVT RetVT, const SDValue *Ops,
unsigned NumOps, bool isSigned,
Expand Down
2 changes: 2 additions & 0 deletions lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ TargetLowering::makeLibCall(SelectionDAG &DAG,
Entry.isZExt = !shouldSignExtendTypeInLibCall(Ops[i].getValueType(), isSigned);
Args.push_back(Entry);
}
if (LC == RTLIB::UNKNOWN_LIBCALL)
report_fatal_error("Unsupported library call operation!");
SDValue Callee = DAG.getExternalSymbol(getLibcallName(LC), getPointerTy());

Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
Expand Down

0 comments on commit f55b1a5

Please sign in to comment.