aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Value.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-07 06:13:49 +0000
committerChris Lattner <sabre@nondot.org>2007-02-07 06:13:49 +0000
commit56920a0eccb281e4f7cc71cb69c0d23c9d531a84 (patch)
tree3333e6727718386f758574d1c278d2a965da42d5 /lib/VMCore/Value.cpp
parent1e348549d930f1a3e636dcb2c78bad95636daec2 (diff)
downloadexternal_llvm-56920a0eccb281e4f7cc71cb69c0d23c9d531a84.tar.gz
external_llvm-56920a0eccb281e4f7cc71cb69c0d23c9d531a84.tar.bz2
external_llvm-56920a0eccb281e4f7cc71cb69c0d23c9d531a84.zip
eliminate ValueSymbolTable::rename, it has no advantage over using remove+insert.
Make insert/remove assert if used incorrectly instead of returning a bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Value.cpp')
-rw-r--r--lib/VMCore/Value.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 0218e5798f..f84671d475 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -120,7 +120,9 @@ void Value::setName(const std::string &name) {
Name = name;
else if (hasName()) {
if (!name.empty()) { // Replacing name.
- ST->rename(this, name);
+ ST->remove(this);
+ Name = name;
+ ST->insert(this);
} else { // Transitioning from hasName -> noname.
ST->remove(this);
Name.clear();