These don't need to be ConstStrings. They don't really benefit much from
deduplication and comparing them isn't on a hot path, so they don't
really benefit much from quick comparisons.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/include/lldb/Interpreter/OptionGroupPlatform.h | ||
---|---|---|
52–53 | Is there a specific reason you want to do that instead of using llvm::StringRef::str()? |
lldb/include/lldb/Interpreter/OptionGroupPlatform.h | ||
---|---|---|
52–53 | Yes, it saves a copy when calling SetSDKRootDirectory with an rvalue reference or a moved std::string. There's no downside if you're going to store it as a std::string anyway. |
Looks like this actually causes TestDebuggerAPI.py to segfault because SBPlatform::SetSDKRoot can take nullptr for its argument, and the conversion from nullptr -> std::string blows up. I'm fixing that in https://reviews.llvm.org/D152962.
This should take a std::string by value and move it.