OSDN Git Service

[X86] Move the feature dependency handling in X86TargetInfo::setFeatureEnabledImpl...
authorCraig Topper <craig.topper@intel.com>
Tue, 7 Jul 2020 05:47:54 +0000 (22:47 -0700)
committerCraig Topper <craig.topper@intel.com>
Tue, 7 Jul 2020 06:14:02 +0000 (23:14 -0700)
commit16f3d698f2afbbea43e0c3df81df6f2a640ce806
tree00c68207475b555c0bcbcd9382ce5c10e428417e
parent094e99d264c937cad33796b8c92fe123cb544c9e
[X86] Move the feature dependency handling in X86TargetInfo::setFeatureEnabledImpl to a table based lookup in X86TargetParser.cpp

Previously we had to specify the forward and backwards feature dependencies separately which was error prone. And as dependencies have gotten more complex it was hard to be sure the transitive dependencies were handled correctly. The way it was written was also not super readable.

This patch replaces everything with a table that lists what features a feature is dependent on directly. Then we can recursively walk through the table to find the transitive dependencies. This is largely based on how we handle subtarget features in the MC layer from the tablegen descriptions.

Differential Revision: https://reviews.llvm.org/D83273
clang/lib/Basic/Targets/X86.cpp
clang/lib/Basic/Targets/X86.h
llvm/include/llvm/Support/X86TargetParser.def
llvm/include/llvm/Support/X86TargetParser.h
llvm/lib/Support/X86TargetParser.cpp