OSDN Git Service

[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubt...
authorCraig Topper <craig.topper@intel.com>
Tue, 5 Mar 2019 18:54:30 +0000 (18:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 5 Mar 2019 18:54:30 +0000 (18:54 +0000)
commitcd52d11df4adbc68b8a9132d901d542661bf3858
tree5a7c52d6fad4f21533bc9fffb92c36bf7d72dcc8
parent2d90299c795690fb0d9c19fe1f0f99f8845aea1f
[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.

The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.

Differential Revision: https://reviews.llvm.org/D58937

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355428 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCSubtargetInfo.h
include/llvm/MC/SubtargetFeature.h
lib/MC/MCSubtargetInfo.cpp
lib/MC/SubtargetFeature.cpp