aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorChris Lattner <clattner@nondot.org>2020-04-12 10:44:03 -0700
committerChris Lattner <clattner@nondot.org>2020-04-12 16:37:17 -0700
commit89c8ffd54221cfe2d0b5e391974143d08f047ae0 (patch)
treec5aadd9cba886259982b961a8c56675e5686d813 /llvm/lib/IR/Value.cpp
parentcfb844265aad44668029fce44ddc58adc81ad68a (diff)
downloadllvm-89c8ffd54221cfe2d0b5e391974143d08f047ae0.zip
llvm-89c8ffd54221cfe2d0b5e391974143d08f047ae0.tar.gz
llvm-89c8ffd54221cfe2d0b5e391974143d08f047ae0.tar.bz2
NFC: Clean up the implementation of StringPool a bit, and remove dependence on some "implicitly MallocAllocator" based methods on StringMapEntry. This allows reducing the #includes in StringMapEntry.h.
Summary: StringPool has many caveats and isn't used in the monorepo. I will propose removing it as a patch separate from this refactoring patch. Reviewers: rriddle Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77976
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index afb509f..015bf20 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -128,8 +128,10 @@ void Value::deleteValue() {
void Value::destroyValueName() {
ValueName *Name = getValueName();
- if (Name)
- Name->Destroy();
+ if (Name) {
+ MallocAllocator Allocator;
+ Name->Destroy(Allocator);
+ }
setValueName(nullptr);
}
@@ -312,7 +314,8 @@ void Value::setNameImpl(const Twine &NewName) {
destroyValueName();
// Create the new name.
- setValueName(ValueName::Create(NameRef));
+ MallocAllocator Allocator;
+ setValueName(ValueName::Create(NameRef, Allocator));
getValueName()->setValue(this);
return;
}