Skip to content

Commit 78a950e

Browse files
bitshifteralexcrichton
authored andcommitted
Add accessors for MCSubtargetInfo CPU and Feature tables
This is needed for `-C target-cpu=help` and `-C target-feature=help` in rustc
1 parent 1b534e9 commit 78a950e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/include/llvm/MC/MCSubtargetInfo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ class MCSubtargetInfo {
221221
auto Found = std::lower_bound(ProcDesc.begin(), ProcDesc.end(), CPU);
222222
return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
223223
}
224+
225+
ArrayRef<SubtargetSubTypeKV> getCPUTable() const {
226+
return ProcDesc;
227+
}
228+
229+
ArrayRef<SubtargetFeatureKV> getFeatureTable() const {
230+
return ProcFeatures;
231+
}
224232
};
225233

226234
} // end namespace llvm

0 commit comments

Comments
 (0)