summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-31 05:09:17 +0000
committerChris Lattner <sabre@nondot.org>2012-01-31 05:09:17 +0000
commit997348e9fee7148a2d3f3830a8beecf740caf639 (patch)
tree2314ef1a59dee3f22bd4d550d7960cbbcc86afbb /llvm/lib/CodeGen
parent74d4193e2fdc78bfe1e10d3f105189021a44da2d (diff)
downloadbcm5719-llvm-997348e9fee7148a2d3f3830a8beecf740caf639.tar.gz
bcm5719-llvm-997348e9fee7148a2d3f3830a8beecf740caf639.zip
remove the last vestiges of llvm::GetConstantStringInfo, in CodeGen.
llvm-svn: 149356
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 6b6f7bf10d7..fe1a86131c8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -3299,7 +3299,7 @@ static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
/// string ptr.
static SDValue getMemsetStringVal(EVT VT, DebugLoc dl, SelectionDAG &DAG,
const TargetLowering &TLI,
- std::string &Str, unsigned Offset) {
+ StringRef Str, unsigned Offset) {
// Handle vector with all elements zero.
if (Str.empty()) {
if (VT.isInteger())
@@ -3343,7 +3343,7 @@ static SDValue getMemBasePlusOffset(SDValue Base, unsigned Offset,
/// 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;
GlobalAddressSDNode *G = NULL;
if (Src.getOpcode() == ISD::GlobalAddress)
@@ -3358,11 +3358,8 @@ static bool isMemSrcFromString(SDValue Src, std::string &Str) {
return false;
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(G->getGlobal()))
- if (GetConstantStringInfo(GV, Str, SrcDelta)) {
- // The nul can also be read.
- Str.push_back(0);
+ if (getConstantStringInfo(GV, Str, SrcDelta))
return true;
- }
return false;
}
@@ -3467,7 +3464,7 @@ static SDValue getMemcpyLoadsAndStores(SelectionDAG &DAG, DebugLoc dl,
unsigned SrcAlign = DAG.InferPtrAlignment(Src);
if (Align > SrcAlign)
SrcAlign = Align;
- std::string Str;
+ StringRef Str;
bool CopyFromStr = isMemSrcFromString(Src, Str);
bool isZeroStr = CopyFromStr && Str.empty();
unsigned Limit = AlwaysInline ? ~0U : TLI.getMaxStoresPerMemcpy(OptSize);
OpenPOWER on IntegriCloud