Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | #undef GET_OPERAND_DIAGNOSTIC_TYPES | ||||
RISCVAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, | RISCVAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, | ||||
const MCInstrInfo &MII, const MCTargetOptions &Options) | const MCInstrInfo &MII, const MCTargetOptions &Options) | ||||
: MCTargetAsmParser(Options, STI, MII) { | : MCTargetAsmParser(Options, STI, MII) { | ||||
Parser.addAliasForDirective(".half", ".2byte"); | Parser.addAliasForDirective(".half", ".2byte"); | ||||
Parser.addAliasForDirective(".hword", ".2byte"); | Parser.addAliasForDirective(".hword", ".2byte"); | ||||
Parser.addAliasForDirective(".word", ".4byte"); | Parser.addAliasForDirective(".word", ".4byte"); | ||||
Parser.addAliasForDirective(".dword", ".8byte"); | Parser.addAliasForDirective(".dword", ".8byte"); | ||||
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); | setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); | ||||
auto ABIName = StringRef(Options.ABIName); | |||||
if (ABIName.endswith("f") && | |||||
!getSTI().getFeatureBits()[RISCV::FeatureStdExtF]) { | |||||
lenary: I'm not sure we should be using `errs()` here directly, should we perhaps be using… | |||||
Not Done ReplyInline ActionsI implemented the RISCVBaseInfo checking using report_fatal_error initially, but moved to complaining via errs() after feedback that this better matched what other backends do in this case. asb: I implemented the RISCVBaseInfo checking using report_fatal_error initially, but moved to… | |||||
errs() << "Hard-float 'f' ABI can't be used for a target that " | |||||
"doesn't support the F instruction set extension (ignoring " | |||||
"target-abi)\n"; | |||||
} else if (ABIName.endswith("d") && | |||||
!getSTI().getFeatureBits()[RISCV::FeatureStdExtD]) { | |||||
errs() << "Hard-float 'd' ABI can't be used for a target that " | |||||
"doesn't support the D instruction set extension (ignoring " | |||||
"target-abi)\n"; | |||||
} | |||||
} | } | ||||
}; | }; | ||||
/// RISCVOperand - Instances of this class represent a parsed machine | /// RISCVOperand - Instances of this class represent a parsed machine | ||||
/// instruction | /// instruction | ||||
struct RISCVOperand : public MCParsedAsmOperand { | struct RISCVOperand : public MCParsedAsmOperand { | ||||
enum class KindTy { | enum class KindTy { | ||||
▲ Show 20 Lines • Show All 1,674 Lines • Show Last 20 Lines |
I'm not sure we should be using errs() here directly, should we perhaps be using report_fatal_error here?