diff options
| author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-03-20 14:10:20 +0000 | 
|---|---|---|
| committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-03-20 14:10:20 +0000 | 
| commit | 4655d731e129902af1061e4cc9d6888a04a16d12 (patch) | |
| tree | 44f7ca0a54601e3d764e95366bc686134b9e6dfa /llvm/lib/Target/PIC16/PIC16ISelLowering.cpp | |
| parent | 83debdf4b4498936e81782ea7f723e56f0bc1f60 (diff) | |
| download | bcm5719-llvm-4655d731e129902af1061e4cc9d6888a04a16d12.tar.gz bcm5719-llvm-4655d731e129902af1061e4cc9d6888a04a16d12.zip  | |
Fixed comment for libcalls.
llvm-svn: 67373
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16ISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16ISelLowering.cpp | 43 | 
1 files changed, 23 insertions, 20 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp index bb591941157..3ace4821d8d 100644 --- a/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp +++ b/llvm/lib/Target/PIC16/PIC16ISelLowering.cpp @@ -191,18 +191,21 @@ MVT PIC16TargetLowering::getSetCCResultType(MVT ValType) const {    return MVT::i8;  } -/// FIXME: These three functions below should not be here if we change  -/// the generic code to allow generting libcalls for I8 types as well. +/// The type legalizer framework of generating legalizer can generate libcalls +/// only when the operand/result types are illegal. +/// PIC16 needs to generate libcalls even for the legal types (i8) for some ops. +/// For example an arithmetic right shift. These functions are used to lower +/// such operations that generate libcall for legal types.  void   PIC16TargetLowering::setPIC16LibcallName(PIC16ISD::PIC16Libcall Call,                                           const char *Name) { - PIC16LibcallNames[Call] = Name;  +  PIC16LibcallNames[Call] = Name;   }  const char *  PIC16TargetLowering::getPIC16LibcallName(PIC16ISD::PIC16Libcall Call) { - return PIC16LibcallNames[Call]; +  return PIC16LibcallNames[Call];  }  SDValue @@ -211,23 +214,23 @@ PIC16TargetLowering::MakePIC16Libcall(PIC16ISD::PIC16Libcall Call,                                        unsigned NumOps, bool isSigned,                                        SelectionDAG &DAG, DebugLoc dl) { - TargetLowering::ArgListTy Args; - Args.reserve(NumOps); - - TargetLowering::ArgListEntry Entry; - for (unsigned i = 0; i != NumOps; ++i) { -   Entry.Node = Ops[i]; -   Entry.Ty = Entry.Node.getValueType().getTypeForMVT(); -   Entry.isSExt = isSigned; -   Entry.isZExt = !isSigned; -   Args.push_back(Entry); - } - SDValue Callee = DAG.getExternalSymbol(getPIC16LibcallName(Call), MVT::i8); - -  const Type *RetTy = RetVT.getTypeForMVT(); -  std::pair<SDValue,SDValue> CallInfo =  +  TargetLowering::ArgListTy Args; +  Args.reserve(NumOps); + +  TargetLowering::ArgListEntry Entry; +  for (unsigned i = 0; i != NumOps; ++i) { +    Entry.Node = Ops[i]; +    Entry.Ty = Entry.Node.getValueType().getTypeForMVT(); +    Entry.isSExt = isSigned; +    Entry.isZExt = !isSigned; +    Args.push_back(Entry); +  } +  SDValue Callee = DAG.getExternalSymbol(getPIC16LibcallName(Call), MVT::i8); + +   const Type *RetTy = RetVT.getTypeForMVT(); +   std::pair<SDValue,SDValue> CallInfo =        LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false, -                     false, CallingConv::C, false, Callee, Args, DAG, dl); +                 false, CallingConv::C, false, Callee, Args, DAG, dl);    return CallInfo.first;  }  | 

