Implement the -fno-builtin option in the front-end, not in the back-end.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56900 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling 2008-10-01 00:59:58 +00:00
parent 70695fee51
commit 6158d8492c
4 changed files with 20 additions and 30 deletions

View File

@ -1049,8 +1049,7 @@ public:
SDValue Chain, SDValue Chain,
SDValue Op1, SDValue Op2, SDValue Op1, SDValue Op2,
SDValue Op3, unsigned Align, SDValue Op3, unsigned Align,
const Value *DstSV, uint64_t DstOff, const Value *DstSV, uint64_t DstOff) {
bool NoBuiltin = false) {
return SDValue(); return SDValue();
} }

View File

@ -41,11 +41,6 @@
#include <cmath> #include <cmath>
using namespace llvm; using namespace llvm;
static cl::opt<bool>
NoBuiltin("no-builtin", cl::init(false),
cl::desc("Don't recognize built-in functions that do not begin "
"with `__builtin_' as prefix"));
/// makeVTList - Return an instance of the SDVTList struct initialized with the /// makeVTList - Return an instance of the SDVTList struct initialized with the
/// specified members. /// specified members.
static SDVTList makeVTList(const MVT *VTs, unsigned NumVTs) { static SDVTList makeVTList(const MVT *VTs, unsigned NumVTs) {
@ -3195,7 +3190,7 @@ SDValue SelectionDAG::getMemset(SDValue Chain, SDValue Dst,
// code. If the target chooses to do this, this is the next best. // code. If the target chooses to do this, this is the next best.
SDValue Result = SDValue Result =
TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align, TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align,
DstSV, DstSVOff, NoBuiltin); DstSV, DstSVOff);
if (Result.getNode()) if (Result.getNode())
return Result; return Result;

View File

@ -5132,8 +5132,7 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG,
SDValue Dst, SDValue Src, SDValue Dst, SDValue Src,
SDValue Size, unsigned Align, SDValue Size, unsigned Align,
const Value *DstSV, const Value *DstSV,
uint64_t DstSVOff, uint64_t DstSVOff) {
bool NoBuiltin) {
ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size); ConstantSDNode *ConstantSize = dyn_cast<ConstantSDNode>(Size);
// If not DWORD aligned or size is more than the threshold, call the library. // If not DWORD aligned or size is more than the threshold, call the library.
@ -5148,7 +5147,6 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG,
// Check to see if there is a specialized entry-point for memory zeroing. // Check to see if there is a specialized entry-point for memory zeroing.
ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src); ConstantSDNode *V = dyn_cast<ConstantSDNode>(Src);
if (!NoBuiltin) {
if (const char *bzeroEntry = V && if (const char *bzeroEntry = V &&
V->isNullValue() ? Subtarget->getBZeroEntry() : 0) { V->isNullValue() ? Subtarget->getBZeroEntry() : 0) {
MVT IntPtr = getPointerTy(); MVT IntPtr = getPointerTy();
@ -5166,7 +5164,6 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG,
DAG.getExternalSymbol(bzeroEntry, IntPtr), Args, DAG); DAG.getExternalSymbol(bzeroEntry, IntPtr), Args, DAG);
return CallResult.second; return CallResult.second;
} }
}
// Otherwise have the target-independent code call memset. // Otherwise have the target-independent code call memset.
return SDValue(); return SDValue();

View File

@ -578,8 +578,7 @@ namespace llvm {
SDValue Chain, SDValue Chain,
SDValue Dst, SDValue Src, SDValue Dst, SDValue Src,
SDValue Size, unsigned Align, SDValue Size, unsigned Align,
const Value *DstSV, uint64_t DstSVOff, const Value *DstSV, uint64_t DstSVOff);
bool NoBuiltin);
SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG,
SDValue Chain, SDValue Chain,
SDValue Dst, SDValue Src, SDValue Dst, SDValue Src,