uuid_string_t UUIDStr;
uuid_unparse(uuid, UUIDStr);
- assert(strlen(UUIDStr) == 36);
- HostID.append(&UUIDStr[0], &UUIDStr[36]);
+ StringRef UUIDRef(UUIDStr);
+ HostID.append(UUIDRef.begin(), UUIDRef.end());
#elif LLVM_ON_UNIX
- char hostname[256];
- hostname[255] = 0;
- hostname[0] = 0;
- gethostname(hostname, 255);
- HostID = hostname;
+ char HostName[256];
+ HostName[255] = 0;
+ HostName[0] = 0;
+ gethostname(HostName, 255);
+ StringRef HostNameRef(HostName);
+ HostID.append(HostNameRef.begin(), HostNameRef.end());
#else
- HostID = "localhost";
+ StringRef Dummy("localhost");
+ HostID.append(Dummy.begin(), Dummy.end());
#endif
return std::error_code();