summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 41260a98e3ce..b6e25c46b514 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -330,8 +330,7 @@ void Value::setNameImpl(const Twine &NewName) {
SmallString<256> NameData;
StringRef NameRef = NeedNewName ? NewName.toStringRef(NameData) : "";
- assert(NameRef.find_first_of(0) == StringRef::npos &&
- "Null bytes are not allowed in names");
+ assert(!NameRef.contains(0) && "Null bytes are not allowed in names");
// Name isn't changing?
if (getName() == NameRef)
@@ -378,7 +377,7 @@ void Value::setNameImpl(const Twine &NewName) {
void Value::setName(const Twine &NewName) {
setNameImpl(NewName);
if (Function *F = dyn_cast<Function>(this))
- F->recalculateIntrinsicID();
+ F->updateAfterNameChange();
}
void Value::takeName(Value *V) {
@@ -575,11 +574,17 @@ void Value::replaceUsesWithIf(Value *New,
/// with New.
static void replaceDbgUsesOutsideBlock(Value *V, Value *New, BasicBlock *BB) {
SmallVector<DbgVariableIntrinsic *> DbgUsers;
- findDbgUsers(DbgUsers, V);
+ SmallVector<DPValue *> DPUsers;
+ findDbgUsers(DbgUsers, V, &DPUsers);
for (auto *DVI : DbgUsers) {
if (DVI->getParent() != BB)
DVI->replaceVariableLocationOp(V, New);
}
+ for (auto *DPV : DPUsers) {
+ DPMarker *Marker = DPV->getMarker();
+ if (Marker->getParent() != BB)
+ DPV->replaceVariableLocationOp(V, New);
+ }
}
// Like replaceAllUsesWith except it does not handle constants or basic blocks.