[clang] [ARM] Introduce -mtp=auto and make it the default (PR #128728)
Peter Smith via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 26 03:24:28 PST 2025
================
@@ -239,7 +240,7 @@ arm::ReadTPMode arm::getReadTPMode(const Driver &D, const ArgList &Args,
D.Diag(diag::err_drv_invalid_mtp) << A->getAsString(Args);
return ReadTPMode::Invalid;
}
- return ReadTPMode::Soft;
+ return ReadTPMode::Auto;
----------------
smithp35 wrote:
Is there a way of rewriting this so that we don't have to return `Auto` from the function? I think the intention is that the logic of handling the mtp option is centralised here. Ideally we should translate `Auto` to either `Soft` or `TPIDRURO`. That would mean it wouldn't need to be handled in setArchNameInTriple
This may need some reorganisation to avoid duplication. Although it may just be simple enough to live with it.
```
if (ThreadPointer == ReadTPMode::Auto)
return (isHardTPSupported(Triple) ? ReadTPMode::TPIDRURO : ReadTPMode::Soft);
```
At the end we could replace `return ReadTPMode::Auto` with
```
return (isHardTPSupported(Triple) ? ReadTPMode::TPIDRURO : ReadTPMode::Soft);
```
https://github.com/llvm/llvm-project/pull/128728
More information about the cfe-commits
mailing list