Minor cleanup

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-01-10 21:40:29 +00:00
parent 2cacc0a306
commit 9a0817971a
2 changed files with 2 additions and 2 deletions

View 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) {

View 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);
}