aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-10 21:40:29 +0000
committerChris Lattner <sabre@nondot.org>2004-01-10 21:40:29 +0000
commit9a0817971a71442d24a6aec0c5c66110176bdf95 (patch)
tree8febdc55b635dad4743ccfa44e9cf564ea7e9e6b
parent2cacc0a30630e58379f3c57ccb7b161cebb550ca (diff)
Minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10752 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Value.h2
-rw-r--r--lib/VMCore/Function.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Value.h b/include/llvm/Value.h
index e92d6fc6cb..319115375d 100644
--- a/include/llvm/Value.h
+++ b/include/llvm/Value.h
@@ -78,7 +78,7 @@ public:
inline const Type *getType() const { return Ty; }
// All values can potentially be named...
- inline bool hasName() const { return Name != ""; }
+ inline bool hasName() const { return !Name.empty(); }
inline const std::string &getName() const { return Name; }
virtual void setName(const std::string &name, SymbolTable * = 0) {
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index ff7905b73f..4714d3b258 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -266,5 +266,5 @@ void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
"Invalid symtab argument!");
if ((P = getParent()) && hasName()) P->getSymbolTable().remove(this);
Value::setName(name);
- if (P && getName() != "") P->getSymbolTable().insert(this);
+ if (P && hasName()) P->getSymbolTable().insert(this);
}