Anastasia added a comment.

Just to elaborate on the problem that is being solved. We have ended up with 
cycling dependencies between `LangOptions` and `TargetInfo` i.e. some language 
options became dependent on the target and vice versa.

The quick solution has always been to mutate the target after its creation even 
though it has been intended to be immutable. While mutating the target some 
language options are being modified too.

So the approach suggested here eliminates this design flaw by adding a special 
member to `LangOptions` to allow resetting the options after the target has 
been created based on the property of the target.

The approach seems reasonable to me and there are probably not so many good 
alternatives. In the past, we have discussed that adjusting target settings can 
be eliminated by adding a special triple component for OpenCL. However, it 
serves a similar purpose as suggested here but seems like a larger conceptual 
change and some redundancy too. I am also not sure whether it is going to fit 
the needs for OpenCL 3 features and also use cases from all other targets...

I would suggest writing an RFC into cfe-dev about this and see if there are any 
other opinions.

Thanks for looking into this long design issue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110036

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

Reply via email to