diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp index 4714d3b25845..f98a7c71656b 100644 --- a/llvm/lib/VMCore/Function.cpp +++ b/llvm/lib/VMCore/Function.cpp @@ -128,7 +128,7 @@ void Function::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); } void Function::setParent(Module *parent) {