Skip to content

Commit b4f352c

Browse files
bitshiftercuviper
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 d28af7c commit b4f352c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: llvm/include/llvm/MC/MCSubtargetInfo.h

+8
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)