mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 21:31:03 +00:00
Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117651 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61a4d56a03
commit
16c7425cff
@ -35,7 +35,7 @@ enum ShiftType {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct ARMOperand;
|
struct ARMOperand;
|
||||||
|
|
||||||
class ARMAsmParser : public TargetAsmParser {
|
class ARMAsmParser : public TargetAsmParser {
|
||||||
MCAsmParser &Parser;
|
MCAsmParser &Parser;
|
||||||
TargetMachine &TM;
|
TargetMachine &TM;
|
||||||
@ -79,7 +79,7 @@ private:
|
|||||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out);
|
MCStreamer &Out);
|
||||||
|
|
||||||
/// @name Auto-generated Match Functions
|
/// @name Auto-generated Match Functions
|
||||||
/// {
|
/// {
|
||||||
|
|
||||||
@ -98,8 +98,8 @@ public:
|
|||||||
|
|
||||||
virtual bool ParseDirective(AsmToken DirectiveID);
|
virtual bool ParseDirective(AsmToken DirectiveID);
|
||||||
};
|
};
|
||||||
} // end anonymous namespace
|
} // end anonymous namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
/// ARMOperand - Instances of this class represent a parsed ARM machine
|
/// ARMOperand - Instances of this class represent a parsed ARM machine
|
||||||
@ -134,7 +134,7 @@ public:
|
|||||||
struct {
|
struct {
|
||||||
const MCExpr *Val;
|
const MCExpr *Val;
|
||||||
} Imm;
|
} Imm;
|
||||||
|
|
||||||
// This is for all forms of ARM address expressions
|
// This is for all forms of ARM address expressions
|
||||||
struct {
|
struct {
|
||||||
unsigned BaseRegNum;
|
unsigned BaseRegNum;
|
||||||
@ -152,7 +152,7 @@ public:
|
|||||||
} Mem;
|
} Mem;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ARMOperand(const ARMOperand &o) : MCParsedAsmOperand() {
|
ARMOperand(const ARMOperand &o) : MCParsedAsmOperand() {
|
||||||
Kind = o.Kind;
|
Kind = o.Kind;
|
||||||
StartLoc = o.StartLoc;
|
StartLoc = o.StartLoc;
|
||||||
@ -175,7 +175,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getStartLoc - Get the location of the first token of this operand.
|
/// getStartLoc - Get the location of the first token of this operand.
|
||||||
SMLoc getStartLoc() const { return StartLoc; }
|
SMLoc getStartLoc() const { return StartLoc; }
|
||||||
/// getEndLoc - Get the location of the last token of this operand.
|
/// getEndLoc - Get the location of the last token of this operand.
|
||||||
@ -233,20 +233,20 @@ public:
|
|||||||
assert(N == 1 && "Invalid number of operands!");
|
assert(N == 1 && "Invalid number of operands!");
|
||||||
addExpr(Inst, getImm());
|
addExpr(Inst, getImm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isMemMode5() const {
|
bool isMemMode5() const {
|
||||||
// FIXME: Is this right? What about postindexed and Writeback?
|
// FIXME: Is this right? What about postindexed and Writeback?
|
||||||
if (!isMemory() || Mem.OffsetIsReg || Mem.OffsetRegShifted ||
|
if (!isMemory() || Mem.OffsetIsReg || Mem.OffsetRegShifted ||
|
||||||
Mem.Preindexed || Mem.Negative)
|
Mem.Preindexed || Mem.Negative)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addMemMode5Operands(MCInst &Inst, unsigned N) const {
|
void addMemMode5Operands(MCInst &Inst, unsigned N) const {
|
||||||
assert(N == 2 && isMemMode5() && "Invalid number of operands!");
|
assert(N == 2 && isMemMode5() && "Invalid number of operands!");
|
||||||
|
|
||||||
Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum));
|
Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum));
|
||||||
assert(!Mem.OffsetIsReg && "invalid mode 5 operand");
|
assert(!Mem.OffsetIsReg && "invalid mode 5 operand");
|
||||||
addExpr(Inst, Mem.Offset);
|
addExpr(Inst, Mem.Offset);
|
||||||
@ -307,12 +307,12 @@ public:
|
|||||||
Op->Mem.Postindexed = Postindexed;
|
Op->Mem.Postindexed = Postindexed;
|
||||||
Op->Mem.Negative = Negative;
|
Op->Mem.Negative = Negative;
|
||||||
Op->Mem.Writeback = Writeback;
|
Op->Mem.Writeback = Writeback;
|
||||||
|
|
||||||
Op->StartLoc = S;
|
Op->StartLoc = S;
|
||||||
Op->EndLoc = E;
|
Op->EndLoc = E;
|
||||||
return Op;
|
return Op;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARMOperand(KindTy K) : Kind(K) {}
|
ARMOperand(KindTy K) : Kind(K) {}
|
||||||
};
|
};
|
||||||
@ -364,11 +364,11 @@ ARMOperand *ARMAsmParser::MaybeParseRegister(bool ParseWriteBack) {
|
|||||||
RegNum = MatchRegisterName(Tok.getString());
|
RegNum = MatchRegisterName(Tok.getString());
|
||||||
if (RegNum == -1)
|
if (RegNum == -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
S = Tok.getLoc();
|
S = Tok.getLoc();
|
||||||
|
|
||||||
Parser.Lex(); // Eat identifier token.
|
Parser.Lex(); // Eat identifier token.
|
||||||
|
|
||||||
E = Parser.getTok().getLoc();
|
E = Parser.getTok().getLoc();
|
||||||
|
|
||||||
bool Writeback = false;
|
bool Writeback = false;
|
||||||
@ -404,7 +404,7 @@ ARMOperand *ARMAsmParser::ParseRegisterList() {
|
|||||||
Error(RegLoc, "register expected");
|
Error(RegLoc, "register expected");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Parser.Lex(); // Eat identifier token.
|
Parser.Lex(); // Eat identifier token.
|
||||||
unsigned RegList = 1 << RegNum;
|
unsigned RegList = 1 << RegNum;
|
||||||
|
|
||||||
@ -534,7 +534,7 @@ ARMOperand *ARMAsmParser::ParseMemory() {
|
|||||||
}
|
}
|
||||||
Parser.Lex(); // Eat comma token.
|
Parser.Lex(); // Eat comma token.
|
||||||
if (ParseMemoryOffsetReg(Negative, OffsetRegShifted, ShiftType,
|
if (ParseMemoryOffsetReg(Negative, OffsetRegShifted, ShiftType,
|
||||||
ShiftAmount, Offset, OffsetIsReg, OffsetRegNum,
|
ShiftAmount, Offset, OffsetIsReg, OffsetRegNum,
|
||||||
E))
|
E))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -603,7 +603,7 @@ bool ARMAsmParser::ParseMemoryOffsetReg(bool &Negative,
|
|||||||
const AsmToken &HashTok = Parser.getTok();
|
const AsmToken &HashTok = Parser.getTok();
|
||||||
if (HashTok.isNot(AsmToken::Hash))
|
if (HashTok.isNot(AsmToken::Hash))
|
||||||
return Error(HashTok.getLoc(), "'#' expected");
|
return Error(HashTok.getLoc(), "'#' expected");
|
||||||
|
|
||||||
Parser.Lex(); // Eat hash token.
|
Parser.Lex(); // Eat hash token.
|
||||||
|
|
||||||
if (getParser().ParseExpression(Offset))
|
if (getParser().ParseExpression(Offset))
|
||||||
@ -617,7 +617,7 @@ bool ARMAsmParser::ParseMemoryOffsetReg(bool &Negative,
|
|||||||
/// ( lsl | lsr | asr | ror ) , # shift_amount
|
/// ( lsl | lsr | asr | ror ) , # shift_amount
|
||||||
/// rrx
|
/// rrx
|
||||||
/// and returns true if it parses a shift otherwise it returns false.
|
/// and returns true if it parses a shift otherwise it returns false.
|
||||||
bool ARMAsmParser::ParseShift(ShiftType &St, const MCExpr *&ShiftAmount,
|
bool ARMAsmParser::ParseShift(ShiftType &St, const MCExpr *&ShiftAmount,
|
||||||
SMLoc &E) {
|
SMLoc &E) {
|
||||||
const AsmToken &Tok = Parser.getTok();
|
const AsmToken &Tok = Parser.getTok();
|
||||||
if (Tok.isNot(AsmToken::Identifier))
|
if (Tok.isNot(AsmToken::Identifier))
|
||||||
@ -657,12 +657,12 @@ bool ARMAsmParser::ParseShift(ShiftType &St, const MCExpr *&ShiftAmount,
|
|||||||
/// of the mnemonic.
|
/// of the mnemonic.
|
||||||
ARMOperand *ARMAsmParser::ParseOperand() {
|
ARMOperand *ARMAsmParser::ParseOperand() {
|
||||||
SMLoc S, E;
|
SMLoc S, E;
|
||||||
|
|
||||||
switch (getLexer().getKind()) {
|
switch (getLexer().getKind()) {
|
||||||
case AsmToken::Identifier:
|
case AsmToken::Identifier:
|
||||||
if (ARMOperand *Op = MaybeParseRegister(true))
|
if (ARMOperand *Op = MaybeParseRegister(true))
|
||||||
return Op;
|
return Op;
|
||||||
|
|
||||||
// This was not a register so parse other operands that start with an
|
// This was not a register so parse other operands that start with an
|
||||||
// identifier (like labels) as expressions and create them as immediates.
|
// identifier (like labels) as expressions and create them as immediates.
|
||||||
const MCExpr *IdVal;
|
const MCExpr *IdVal;
|
||||||
@ -720,7 +720,7 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
|
|||||||
.Case("le", ARMCC::LE)
|
.Case("le", ARMCC::LE)
|
||||||
.Case("al", ARMCC::AL)
|
.Case("al", ARMCC::AL)
|
||||||
.Default(~0U);
|
.Default(~0U);
|
||||||
|
|
||||||
if (CC != ~0U)
|
if (CC != ~0U)
|
||||||
Head = Head.slice(0, Head.size() - 2);
|
Head = Head.slice(0, Head.size() - 2);
|
||||||
else
|
else
|
||||||
@ -760,7 +760,7 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
if (getLexer().isNot(AsmToken::EndOfStatement)) {
|
||||||
Parser.EatToEndOfStatement();
|
Parser.EatToEndOfStatement();
|
||||||
return TokError("unexpected token in argument list");
|
return TokError("unexpected token in argument list");
|
||||||
@ -779,7 +779,7 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
case Match_Success:
|
case Match_Success:
|
||||||
Out.EmitInstruction(Inst);
|
Out.EmitInstruction(Inst);
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case Match_MissingFeature:
|
case Match_MissingFeature:
|
||||||
Error(IDLoc, "instruction requires a CPU feature not currently enabled");
|
Error(IDLoc, "instruction requires a CPU feature not currently enabled");
|
||||||
return true;
|
return true;
|
||||||
@ -788,17 +788,17 @@ MatchAndEmitInstruction(SMLoc IDLoc,
|
|||||||
if (ErrorInfo != ~0U) {
|
if (ErrorInfo != ~0U) {
|
||||||
if (ErrorInfo >= Operands.size())
|
if (ErrorInfo >= Operands.size())
|
||||||
return Error(IDLoc, "too few operands for instruction");
|
return Error(IDLoc, "too few operands for instruction");
|
||||||
|
|
||||||
ErrorLoc = ((ARMOperand*)Operands[ErrorInfo])->getStartLoc();
|
ErrorLoc = ((ARMOperand*)Operands[ErrorInfo])->getStartLoc();
|
||||||
if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc;
|
if (ErrorLoc == SMLoc()) ErrorLoc = IDLoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Error(ErrorLoc, "invalid operand for instruction");
|
return Error(ErrorLoc, "invalid operand for instruction");
|
||||||
}
|
}
|
||||||
case Match_MnemonicFail:
|
case Match_MnemonicFail:
|
||||||
return Error(IDLoc, "unrecognized instruction mnemonic");
|
return Error(IDLoc, "unrecognized instruction mnemonic");
|
||||||
}
|
}
|
||||||
|
|
||||||
llvm_unreachable("Implement any new match types added!");
|
llvm_unreachable("Implement any new match types added!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ bool ARMAsmParser::ParseDirectiveWord(unsigned Size, SMLoc L) {
|
|||||||
|
|
||||||
if (getLexer().is(AsmToken::EndOfStatement))
|
if (getLexer().is(AsmToken::EndOfStatement))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// FIXME: Improve diagnostic.
|
// FIXME: Improve diagnostic.
|
||||||
if (getLexer().isNot(AsmToken::Comma))
|
if (getLexer().isNot(AsmToken::Comma))
|
||||||
return Error(L, "unexpected token in directive");
|
return Error(L, "unexpected token in directive");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user