================
@@ -1614,6 +1614,19 @@ const char *SBTarget::GetTriple() {
return nullptr;
}
+const char *SBTarget::GetArchName() {
+ LLDB_INSTRUMENT_VA(this);
+
+ if (TargetSP target_sp = GetSP()) {
+ std::string arch_name =
+ target_sp->GetArchitecture().GetTriple().getArchName().str();
+ ConstString const_arch_name(arch_name.c_str());
----------------
JDevlieghere wrote:
There's no need to allocate a temporary `std::string` here, `getArchName`
returns a StringRef that you can pass directly to the `ConstString` ctor.
```suggestion
llvm::StringRef arch_name =
target_sp->GetArchitecture().GetTriple().getArchName();
ConstString const_arch_name(arch_name);
```
https://github.com/llvm/llvm-project/pull/168273
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits