mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing.
Previously .cpu directive in ARM assembler didnt switch to the new CPU and therefore acted as a nop. This implemented real action for .cpu and eg. allows to assembler FreeBSD kernel with -integrated-as. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223147 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -136,6 +136,15 @@ public:
|
||||
|
||||
/// Initialize an InstrItineraryData instance.
|
||||
void initInstrItins(InstrItineraryData &InstrItins) const;
|
||||
|
||||
/// Check whether the CPU string is valid.
|
||||
bool CPUStringIsValid(StringRef CPU) {
|
||||
auto Found = std::find_if(ProcDesc.begin(), ProcDesc.end(),
|
||||
[=](const SubtargetFeatureKV &KV) {
|
||||
return CPU == KV.Key;
|
||||
});
|
||||
return Found != ProcDesc.end();
|
||||
}
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
Reference in New Issue
Block a user