tyb0807 added inline comments.

================
Comment at: clang/lib/Driver/ToolChains/Arch/AArch64.cpp:269
     success = getAArch64MicroArchFeaturesFromMcpu(
-        D, getAArch64TargetCPU(Args, Triple, A), Args, Features);
+        D, getAArch64TargetCPU(Args, Triple, A), Args, Features, AF);
 
----------------
tmatheson wrote:
> Looks like you could do `AF = Features.back()` below all these if/else 
> conditions (where it is first used) based on the value of `success`. Maybe 
> there is no need to pass it into `getAArch64MicroArchFeaturesFromMcpu` and 
> the other functions?
> 
> Adding an extra output parameter to each of these functions (which duplicates 
> an existing output parameter) seems unnecessary and makes the interfaces more 
> complicated.
we can't do `AF = Features.back()` below all the if/else conditions because 
`getAArch64MicroArchFeaturesFromM*` adds (usually) the architecture feature 
first, followed by a bunch of other features,  so when it returns, 
`Features.back()` is not the architecture feature anymore.

I see your point about complicating the interfaces, maybe @nickdesaulniers can 
help us here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120111/new/

https://reviews.llvm.org/D120111

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to