8
8
9
9
#include " SymbolFileDWARF.h"
10
10
#include " llvm/ADT/STLExtras.h"
11
+ #include " llvm/ADT/StringRef.h"
11
12
#include " llvm/DebugInfo/DWARF/DWARFAddressRange.h"
12
13
#include " llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
13
14
#include " llvm/Support/Casting.h"
@@ -998,12 +999,12 @@ XcodeSDK SymbolFileDWARF::ParseXcodeSDK(CompileUnit &comp_unit) {
998
999
const char *sdk = cu_die.GetAttributeValueAsString (DW_AT_APPLE_sdk, nullptr );
999
1000
if (!sdk)
1000
1001
return {};
1001
- std::string sysroot =
1002
+ llvm::StringRef sysroot =
1002
1003
cu_die.GetAttributeValueAsString (DW_AT_LLVM_sysroot, " " );
1003
1004
1004
1005
// RegisterXcodeSDK calls into xcrun which is not aware of CLT, which is
1005
1006
// expensive.
1006
- if (sysroot.find (" /Library/Developer/CommandLineTools/SDKs" ) != 0 ) {
1007
+ if (! sysroot.starts_with (" /Library/Developer/CommandLineTools/SDKs" )) {
1007
1008
// Register the sysroot path remapping with the module belonging to
1008
1009
// the CU as well as the one belonging to the symbol file. The two
1009
1010
// would be different if this is an OSO object and module is the
@@ -1017,7 +1018,7 @@ XcodeSDK SymbolFileDWARF::ParseXcodeSDK(CompileUnit &comp_unit) {
1017
1018
local_module_sp->RegisterXcodeSDK (sdk, sysroot);
1018
1019
}
1019
1020
1020
- return {sdk, FileSpec{ std::move (sysroot)} };
1021
+ return {sdk, FileSpec (sysroot)};
1021
1022
}
1022
1023
1023
1024
size_t SymbolFileDWARF::ParseFunctions (CompileUnit &comp_unit) {
0 commit comments