This is a deeper refactoring of D143487 that tries avoiding Twine -> StringData conversion.
Value::setNameImpl() is used both to set and reset name of the value.
In destructor of Function all arguments get reset their names (see Function::clearArguments()).
If the arguments had their names set (e.g. when the function was created with LLVMContex::DiscardValueNames == true) then their ValueName entries referred by the function's symbol table must be destructed. They are not destructed if LLVMContex::DiscardValueNames is set to false because of the fast path in Value::setNameImpl(). See the new test cases that demonstrate the problem. Without the fix they both crash in the function's destructor.
In Value::setNameImpl() this patch removes the fast path return for DiscardValueNames == true to allow destruction of ValueName entries.
Is there some reason to move the call to getSymTab() earlier?