Skip to content

Commit a8f170c

Browse files
bitshifternikic
authored andcommitted
[rust] 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 0fd385c commit a8f170c

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
@@ -230,6 +230,14 @@ class MCSubtargetInfo {
230230
return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
231231
}
232232

233+
ArrayRef<SubtargetSubTypeKV> getCPUTable() const {
234+
return ProcDesc;
235+
}
236+
237+
ArrayRef<SubtargetFeatureKV> getFeatureTable() const {
238+
return ProcFeatures;
239+
}
240+
233241
virtual unsigned getHwMode() const { return 0; }
234242

235243
/// Return the cache size in bytes for the given level of cache.

0 commit comments

Comments
 (0)