Skip to content

Commit

Permalink
Add accessors for MCSubtargetInfo CPU and Feature tables
Browse files Browse the repository at this point in the history
This is needed for `-C target-cpu=help` and `-C target-feature=help` in rustc
  • Loading branch information
bitshifter authored and alexcrichton committed Jul 2, 2019
1 parent 1b534e9 commit 78a950e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions llvm/include/llvm/MC/MCSubtargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@ class MCSubtargetInfo {
auto Found = std::lower_bound(ProcDesc.begin(), ProcDesc.end(), CPU);
return Found != ProcDesc.end() && StringRef(Found->Key) == CPU;
}

ArrayRef<SubtargetSubTypeKV> getCPUTable() const {
return ProcDesc;
}

ArrayRef<SubtargetFeatureKV> getFeatureTable() const {
return ProcFeatures;
}
};

} // end namespace llvm
Expand Down

0 comments on commit 78a950e

Please sign in to comment.