diff options
author | Chris Lattner <clattner@nondot.org> | 2020-04-12 10:44:03 -0700 |
---|---|---|
committer | Chris Lattner <clattner@nondot.org> | 2020-04-12 16:37:17 -0700 |
commit | 89c8ffd54221cfe2d0b5e391974143d08f047ae0 (patch) | |
tree | c5aadd9cba886259982b961a8c56675e5686d813 /llvm/lib/IR/Value.cpp | |
parent | cfb844265aad44668029fce44ddc58adc81ad68a (diff) | |
download | llvm-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.cpp | 9 |
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; } |