Minor cleanup
authorChris Lattner <sabre@nondot.org>
Sat, 10 Jan 2004 21:40:29 +0000 (21:40 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Jan 2004 21:40:29 +0000 (21:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10752 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Value.h
lib/VMCore/Function.cpp

index e92d6fc6cbc6daf4a1514e6e1c8f14edd922bd86..319115375dd588d413ff5ec0609bcd98da56dff6 100644 (file)
@@ -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) {
index ff7905b73f574a8c9afc3ee377c8a04eab4a9d64..4714d3b2584564b3a50c80c2b4bd62fd99827934 100644 (file)
@@ -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);
 }