mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-22 10:24:26 +00:00
remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149356 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -132,8 +132,8 @@ namespace llvm {
|
|||||||
uint64_t Offset = 0);
|
uint64_t Offset = 0);
|
||||||
|
|
||||||
// FIXME: Remove this.
|
// FIXME: Remove this.
|
||||||
bool GetConstantStringInfo(const Value *V, std::string &Str,
|
// bool GetConstantStringInfo(const Value *V, std::string &Str,
|
||||||
uint64_t Offset = 0);
|
// uint64_t Offset = 0);
|
||||||
|
|
||||||
/// GetStringLength - If we can compute the length of the string pointed to by
|
/// GetStringLength - If we can compute the length of the string pointed to by
|
||||||
/// the specified pointer, return 'len+1'. If we can't, return 0.
|
/// the specified pointer, return 'len+1'. If we can't, return 0.
|
||||||
|
@ -1603,16 +1603,6 @@ Value *llvm::GetPointerBaseWithConstantOffset(Value *Ptr, int64_t &Offset,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// FIXME: Remove this.
|
|
||||||
bool llvm::GetConstantStringInfo(const Value *V, std::string &Str,
|
|
||||||
uint64_t Offset) {
|
|
||||||
StringRef Tmp;
|
|
||||||
if (!getConstantStringInfo(V, Tmp, Offset))
|
|
||||||
return false;
|
|
||||||
Str = Tmp.str();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// getConstantStringInfo - This function computes the length of a
|
/// getConstantStringInfo - This function computes the length of a
|
||||||
/// null-terminated C string pointed to by V. If successful, it returns true
|
/// null-terminated C string pointed to by V. If successful, it returns true
|
||||||
/// and returns the string in Str. If unsuccessful, it returns false.
|
/// and returns the string in Str. If unsuccessful, it returns false.
|
||||||
|
@ -3299,7 +3299,7 @@ static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
|
|||||||
/// string ptr.
|
/// string ptr.
|
||||||
static SDValue getMemsetStringVal(EVT VT, DebugLoc dl, SelectionDAG &DAG,
|
static SDValue getMemsetStringVal(EVT VT, DebugLoc dl, SelectionDAG &DAG,
|
||||||
const TargetLowering &TLI,
|
const TargetLowering &TLI,
|
||||||
std::string &Str, unsigned Offset) {
|
StringRef Str, unsigned Offset) {
|
||||||
// Handle vector with all elements zero.
|
// Handle vector with all elements zero.
|
||||||
if (Str.empty()) {
|
if (Str.empty()) {
|
||||||
if (VT.isInteger())
|
if (VT.isInteger())
|
||||||
@ -3343,7 +3343,7 @@ static SDValue getMemBasePlusOffset(SDValue Base, unsigned Offset,
|
|||||||
|
|
||||||
/// isMemSrcFromString - Returns true if memcpy source is a string constant.
|
/// isMemSrcFromString - Returns true if memcpy source is a string constant.
|
||||||
///
|
///
|
||||||
static bool isMemSrcFromString(SDValue Src, std::string &Str) {
|
static bool isMemSrcFromString(SDValue Src, StringRef &Str) {
|
||||||
unsigned SrcDelta = 0;
|
unsigned SrcDelta = 0;
|
||||||
GlobalAddressSDNode *G = NULL;
|
GlobalAddressSDNode *G = NULL;
|
||||||
if (Src.getOpcode() == ISD::GlobalAddress)
|
if (Src.getOpcode() == ISD::GlobalAddress)
|
||||||
@ -3358,11 +3358,8 @@ static bool isMemSrcFromString(SDValue Src, std::string &Str) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal()))
|
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal()))
|
||||||
if (GetConstantStringInfo(GV, Str, SrcDelta)) {
|
if (getConstantStringInfo(GV, Str, SrcDelta))
|
||||||
// The nul can also be read.
|
|
||||||
Str.push_back(0);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3467,7 +3464,7 @@ static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, DebugLoc dl,
|
|||||||
unsigned SrcAlign = DAG.InferPtrAlignment(Src);
|
unsigned SrcAlign = DAG.InferPtrAlignment(Src);
|
||||||
if (Align > SrcAlign)
|
if (Align > SrcAlign)
|
||||||
SrcAlign = Align;
|
SrcAlign = Align;
|
||||||
std::string Str;
|
StringRef Str;
|
||||||
bool CopyFromStr = isMemSrcFromString(Src, Str);
|
bool CopyFromStr = isMemSrcFromString(Src, Str);
|
||||||
bool isZeroStr = CopyFromStr && Str.empty();
|
bool isZeroStr = CopyFromStr && Str.empty();
|
||||||
unsigned Limit = AlwaysInline ? ~0U : TLI.getMaxStoresPerMemcpy(OptSize);
|
unsigned Limit = AlwaysInline ? ~0U : TLI.getMaxStoresPerMemcpy(OptSize);
|
||||||
|
Reference in New Issue
Block a user