return Twine(&Val, UHexKind, 0, EmptyKind);
}
+ /// @}
+ /// @name Predicate Operations
+ /// @{
+
+ /// isTriviallyEmpty - Check if this twine is trivially empty; a false
+ /// return value does not necessarily mean the twine is empty.
+ bool isTriviallyEmpty() const {
+ return isNullary();
+ }
+
/// @}
/// @name String Operations
/// @{
}
void Value::setName(const Twine &NewName) {
+ // Fast path for common IRBuilder case of setName("") when there is no name.
+ if (NewName.isTriviallyEmpty() && !hasName())
+ return;
+
SmallString<256> NameData;
NewName.toVector(NameData);