Page MenuHomePhabricator

[TargetInfo][LangOpts] Refactor target info and language options adjustment.
Needs ReviewPublic

Authored by azabaznov on Sep 19 2021, 7:02 AM.


  • Function CreateTargetInfo() has an access to language options which makes target immutable after creation without modification of language options themselves. Target specific hook TargetInfo::adjustAccordingToLangOpts() can be used if such modification depends on certain target.
  • Introduce LangOptions::adjustAccordingToTI() to apply changes to language options based on target info (also without modification of target info). This also involves adding of some hooks (hasAtomics() / hasAltivec() as this options are used in PPC and WebAssembly in original TargetInfo::adjust()) which potentially can be reused.
  • Validation of OpenCL target is in CreateTargetInfo() as language options are available at that point.

Diff Detail

Event Timeline

azabaznov created this revision.Sep 19 2021, 7:02 AM
azabaznov requested review of this revision.Sep 19 2021, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2021, 7:02 AM