Skip to content

Commit e62d123

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 de3396d commit e62d123

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
@@ -226,6 +226,14 @@ class MCSubtargetInfo {
226226
return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
227227
}
228228

229+
ArrayRef<SubtargetSubTypeKV> getCPUTable() const {
230+
return ProcDesc;
231+
}
232+
233+
ArrayRef<SubtargetFeatureKV> getFeatureTable() const {
234+
return ProcFeatures;
235+
}
236+
229237
virtual unsigned getHwMode() const { return 0; }
230238

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

0 commit comments

Comments
 (0)