[llvm] 05f343f - [CSKY] Fix compiling error due to the interface change
Zi Xuan Wu via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 20 19:59:16 PST 2022
Author: Zi Xuan Wu (Zeson)
Date: 2022-12-21T11:58:52+08:00
New Revision: 05f343fa8afeb219e1089ac40c79277941e18a14
URL: https://github.com/llvm/llvm-project/commit/05f343fa8afeb219e1089ac40c79277941e18a14
DIFF: https://github.com/llvm/llvm-project/commit/05f343fa8afeb219e1089ac40c79277941e18a14.diff
LOG: [CSKY] Fix compiling error due to the interface change
Added:
Modified:
llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
llvm/lib/Target/CSKY/CSKY.h
llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp
llvm/lib/Target/CSKY/CSKYTargetMachine.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
index 724f06fd21bef..2515b62f31cf0 100644
--- a/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
+++ b/llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp
@@ -70,7 +70,8 @@ class CSKYAsmParser : public MCTargetAsmParser {
uint64_t &ErrorInfo,
bool MatchingInlineAsm) override;
- bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) override;
+ bool parseRegister(MCRegister &RegNo, SMLoc &StartLoc,
+ SMLoc &EndLoc) override;
bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands) override;
@@ -81,7 +82,7 @@ class CSKYAsmParser : public MCTargetAsmParser {
// possible, compression of the instruction is performed.
void emitToStreamer(MCStreamer &S, const MCInst &Inst);
- OperandMatchResultTy tryParseRegister(unsigned &RegNo, SMLoc &StartLoc,
+ OperandMatchResultTy tryParseRegister(MCRegister &RegNo, SMLoc &StartLoc,
SMLoc &EndLoc) override;
bool processInstruction(MCInst &Inst, SMLoc IDLoc, OperandVector &Operands,
@@ -1008,7 +1009,7 @@ static bool matchRegisterNameHelper(const MCSubtargetInfo &STI,
return RegNo == CSKY::NoRegister;
}
-bool CSKYAsmParser::ParseRegister(unsigned &RegNo, SMLoc &StartLoc,
+bool CSKYAsmParser::parseRegister(MCRegister &RegNo, SMLoc &StartLoc,
SMLoc &EndLoc) {
const AsmToken &Tok = getParser().getTok();
StartLoc = Tok.getLoc();
@@ -1599,7 +1600,7 @@ bool CSKYAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
return false;
}
-OperandMatchResultTy CSKYAsmParser::tryParseRegister(unsigned &RegNo,
+OperandMatchResultTy CSKYAsmParser::tryParseRegister(MCRegister &RegNo,
SMLoc &StartLoc,
SMLoc &EndLoc) {
const AsmToken &Tok = getParser().getTok();
diff --git a/llvm/lib/Target/CSKY/CSKY.h b/llvm/lib/Target/CSKY/CSKY.h
index 27a6c6d2f2502..da995acadd5d0 100644
--- a/llvm/lib/Target/CSKY/CSKY.h
+++ b/llvm/lib/Target/CSKY/CSKY.h
@@ -22,7 +22,8 @@ class CSKYTargetMachine;
class FunctionPass;
class PassRegistry;
-FunctionPass *createCSKYISelDag(CSKYTargetMachine &TM);
+FunctionPass *createCSKYISelDag(CSKYTargetMachine &TM,
+ CodeGenOpt::Level OptLevel);
FunctionPass *createCSKYConstantIslandPass();
void initializeCSKYConstantIslandsPass(PassRegistry &);
diff --git a/llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp b/llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp
index b893487f1f0f1..031b160f85edc 100644
--- a/llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp
+++ b/llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp
@@ -27,7 +27,10 @@ class CSKYDAGToDAGISel : public SelectionDAGISel {
const CSKYSubtarget *Subtarget;
public:
- explicit CSKYDAGToDAGISel(CSKYTargetMachine &TM) : SelectionDAGISel(TM) {}
+ static char ID;
+
+ explicit CSKYDAGToDAGISel(CSKYTargetMachine &TM, CodeGenOpt::Level OptLevel)
+ : SelectionDAGISel(ID, TM, OptLevel) {}
StringRef getPassName() const override {
return "CSKY DAG->DAG Pattern Instruction Selection";
@@ -55,6 +58,8 @@ class CSKYDAGToDAGISel : public SelectionDAGISel {
};
} // namespace
+char CSKYDAGToDAGISel::ID = 0;
+
void CSKYDAGToDAGISel::Select(SDNode *N) {
// If we have a custom node, we have already selected
if (N->isMachineOpcode()) {
@@ -394,6 +399,7 @@ bool CSKYDAGToDAGISel::SelectInlineAsmMemoryOperand(
return true;
}
-FunctionPass *llvm::createCSKYISelDag(CSKYTargetMachine &TM) {
- return new CSKYDAGToDAGISel(TM);
+FunctionPass *llvm::createCSKYISelDag(CSKYTargetMachine &TM,
+ CodeGenOpt::Level OptLevel) {
+ return new CSKYDAGToDAGISel(TM, OptLevel);
}
diff --git a/llvm/lib/Target/CSKY/CSKYTargetMachine.cpp b/llvm/lib/Target/CSKY/CSKYTargetMachine.cpp
index 9d1fe09c03224..be73b5e9cec70 100644
--- a/llvm/lib/Target/CSKY/CSKYTargetMachine.cpp
+++ b/llvm/lib/Target/CSKY/CSKYTargetMachine.cpp
@@ -114,7 +114,7 @@ void CSKYPassConfig::addIRPasses() {
}
bool CSKYPassConfig::addInstSelector() {
- addPass(createCSKYISelDag(getCSKYTargetMachine()));
+ addPass(createCSKYISelDag(getCSKYTargetMachine(), getOptLevel()));
return false;
}
More information about the llvm-commits
mailing list