summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-03-21 15:36:06 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-03-21 15:36:06 +0000
commit0248a3e54929512b973b6e34636cace1f8970e12 (patch)
tree10b9c5c6a8ccb5f7ed075e8f670073d603c0872d /llvm/lib/Analysis/ValueTracking.cpp
parent307cb8fe5deb57f3d57cfe4e92d65de3bf522186 (diff)
downloadbcm5719-llvm-0248a3e54929512b973b6e34636cace1f8970e12.tar.gz
bcm5719-llvm-0248a3e54929512b973b6e34636cace1f8970e12.zip
ValueTracking: Forward getConstantStringInfo's TrimAtNul param into recursive invocation
Currently this is only used to tweak the backend's memcpy inlining heuristics, testing that isn't very helpful. A real test case will follow in the next commit, where this behavior would cause a real miscompilation. llvm-svn: 232895
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index edccd8c0914..0c66dab3267 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2592,7 +2592,7 @@ bool llvm::getConstantStringInfo(const Value *V, StringRef &Str,
// Look through bitcast instructions and geps.
V = V->stripPointerCasts();
- // If the value is a GEP instructionor constant expression, treat it as an
+ // If the value is a GEP instruction or constant expression, treat it as an
// offset.
if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
// Make sure the GEP has exactly three arguments.
@@ -2619,7 +2619,8 @@ bool llvm::getConstantStringInfo(const Value *V, StringRef &Str,
StartIdx = CI->getZExtValue();
else
return false;
- return getConstantStringInfo(GEP->getOperand(0), Str, StartIdx+Offset);
+ return getConstantStringInfo(GEP->getOperand(0), Str, StartIdx + Offset,
+ TrimAtNul);
}
// The GEP instruction, constant or instruction, must reference a global
OpenPOWER on IntegriCloud