mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-21 18:29:45 +00:00
trailing whitespace and 80 column cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
85dbce31d0
commit
0dd2c93318
@ -36,21 +36,21 @@ class MCOperand {
|
|||||||
kExpr ///< Relocatable immediate operand.
|
kExpr ///< Relocatable immediate operand.
|
||||||
};
|
};
|
||||||
unsigned char Kind;
|
unsigned char Kind;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
unsigned RegVal;
|
unsigned RegVal;
|
||||||
int64_t ImmVal;
|
int64_t ImmVal;
|
||||||
const MCExpr *ExprVal;
|
const MCExpr *ExprVal;
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MCOperand() : Kind(kInvalid) {}
|
MCOperand() : Kind(kInvalid) {}
|
||||||
|
|
||||||
bool isValid() const { return Kind != kInvalid; }
|
bool isValid() const { return Kind != kInvalid; }
|
||||||
bool isReg() const { return Kind == kRegister; }
|
bool isReg() const { return Kind == kRegister; }
|
||||||
bool isImm() const { return Kind == kImmediate; }
|
bool isImm() const { return Kind == kImmediate; }
|
||||||
bool isExpr() const { return Kind == kExpr; }
|
bool isExpr() const { return Kind == kExpr; }
|
||||||
|
|
||||||
/// getReg - Returns the register number.
|
/// getReg - Returns the register number.
|
||||||
unsigned getReg() const {
|
unsigned getReg() const {
|
||||||
assert(isReg() && "This is not a register operand!");
|
assert(isReg() && "This is not a register operand!");
|
||||||
@ -62,7 +62,7 @@ public:
|
|||||||
assert(isReg() && "This is not a register operand!");
|
assert(isReg() && "This is not a register operand!");
|
||||||
RegVal = Reg;
|
RegVal = Reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t getImm() const {
|
int64_t getImm() const {
|
||||||
assert(isImm() && "This is not an immediate");
|
assert(isImm() && "This is not an immediate");
|
||||||
return ImmVal;
|
return ImmVal;
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
assert(isImm() && "This is not an immediate");
|
assert(isImm() && "This is not an immediate");
|
||||||
ImmVal = Val;
|
ImmVal = Val;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MCExpr *getExpr() const {
|
const MCExpr *getExpr() const {
|
||||||
assert(isExpr() && "This is not an expression");
|
assert(isExpr() && "This is not an expression");
|
||||||
return ExprVal;
|
return ExprVal;
|
||||||
@ -80,7 +80,7 @@ public:
|
|||||||
assert(isExpr() && "This is not an expression");
|
assert(isExpr() && "This is not an expression");
|
||||||
ExprVal = Val;
|
ExprVal = Val;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MCOperand CreateReg(unsigned Reg) {
|
static MCOperand CreateReg(unsigned Reg) {
|
||||||
MCOperand Op;
|
MCOperand Op;
|
||||||
Op.Kind = kRegister;
|
Op.Kind = kRegister;
|
||||||
@ -104,23 +104,23 @@ public:
|
|||||||
void dump() const;
|
void dump() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/// MCInst - Instances of this class represent a single low-level machine
|
/// MCInst - Instances of this class represent a single low-level machine
|
||||||
/// instruction.
|
/// instruction.
|
||||||
class MCInst {
|
class MCInst {
|
||||||
unsigned Opcode;
|
unsigned Opcode;
|
||||||
SmallVector<MCOperand, 8> Operands;
|
SmallVector<MCOperand, 8> Operands;
|
||||||
public:
|
public:
|
||||||
MCInst() : Opcode(0) {}
|
MCInst() : Opcode(0) {}
|
||||||
|
|
||||||
void setOpcode(unsigned Op) { Opcode = Op; }
|
void setOpcode(unsigned Op) { Opcode = Op; }
|
||||||
|
|
||||||
unsigned getOpcode() const { return Opcode; }
|
unsigned getOpcode() const { return Opcode; }
|
||||||
|
|
||||||
const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
|
const MCOperand &getOperand(unsigned i) const { return Operands[i]; }
|
||||||
MCOperand &getOperand(unsigned i) { return Operands[i]; }
|
MCOperand &getOperand(unsigned i) { return Operands[i]; }
|
||||||
unsigned getNumOperands() const { return Operands.size(); }
|
unsigned getNumOperands() const { return Operands.size(); }
|
||||||
|
|
||||||
void addOperand(const MCOperand &Op) {
|
void addOperand(const MCOperand &Op) {
|
||||||
Operands.push_back(Op);
|
Operands.push_back(Op);
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ namespace llvm {
|
|||||||
/// kept up to date by SwitchSection.
|
/// kept up to date by SwitchSection.
|
||||||
const MCSection *CurSection;
|
const MCSection *CurSection;
|
||||||
|
|
||||||
/// PrevSection - This is the previous section code is being emitted to, it is
|
/// PrevSection - This is the previous section code is being emitted to, it
|
||||||
/// kept up to date by SwitchSection.
|
/// is kept up to date by SwitchSection.
|
||||||
const MCSection *PrevSection;
|
const MCSection *PrevSection;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -65,11 +65,11 @@ namespace llvm {
|
|||||||
|
|
||||||
/// @name Assembly File Formatting.
|
/// @name Assembly File Formatting.
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// isVerboseAsm - Return true if this streamer supports verbose assembly
|
/// isVerboseAsm - Return true if this streamer supports verbose assembly
|
||||||
/// and if it is enabled.
|
/// and if it is enabled.
|
||||||
virtual bool isVerboseAsm() const { return false; }
|
virtual bool isVerboseAsm() const { return false; }
|
||||||
|
|
||||||
/// hasRawTextSupport - Return true if this asm streamer supports emitting
|
/// hasRawTextSupport - Return true if this asm streamer supports emitting
|
||||||
/// unformatted text to the .s file with EmitRawText.
|
/// unformatted text to the .s file with EmitRawText.
|
||||||
virtual bool hasRawTextSupport() const { return false; }
|
virtual bool hasRawTextSupport() const { return false; }
|
||||||
@ -82,20 +82,20 @@ namespace llvm {
|
|||||||
/// If the comment includes embedded \n's, they will each get the comment
|
/// If the comment includes embedded \n's, they will each get the comment
|
||||||
/// prefix as appropriate. The added comment should not end with a \n.
|
/// prefix as appropriate. The added comment should not end with a \n.
|
||||||
virtual void AddComment(const Twine &T) {}
|
virtual void AddComment(const Twine &T) {}
|
||||||
|
|
||||||
/// GetCommentOS - Return a raw_ostream that comments can be written to.
|
/// GetCommentOS - Return a raw_ostream that comments can be written to.
|
||||||
/// Unlike AddComment, you are required to terminate comments with \n if you
|
/// Unlike AddComment, you are required to terminate comments with \n if you
|
||||||
/// use this method.
|
/// use this method.
|
||||||
virtual raw_ostream &GetCommentOS();
|
virtual raw_ostream &GetCommentOS();
|
||||||
|
|
||||||
/// AddBlankLine - Emit a blank line to a .s file to pretty it up.
|
/// AddBlankLine - Emit a blank line to a .s file to pretty it up.
|
||||||
virtual void AddBlankLine() {}
|
virtual void AddBlankLine() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Symbol & Section Management
|
/// @name Symbol & Section Management
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// getCurrentSection - Return the current section that the streamer is
|
/// getCurrentSection - Return the current section that the streamer is
|
||||||
/// emitting code to.
|
/// emitting code to.
|
||||||
const MCSection *getCurrentSection() const { return CurSection; }
|
const MCSection *getCurrentSection() const { return CurSection; }
|
||||||
@ -109,7 +109,7 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
/// This corresponds to assembler directives like .section, .text, etc.
|
/// This corresponds to assembler directives like .section, .text, etc.
|
||||||
virtual void SwitchSection(const MCSection *Section) = 0;
|
virtual void SwitchSection(const MCSection *Section) = 0;
|
||||||
|
|
||||||
/// EmitLabel - Emit a label for @p Symbol into the current section.
|
/// EmitLabel - Emit a label for @p Symbol into the current section.
|
||||||
///
|
///
|
||||||
/// This corresponds to an assembler statement such as:
|
/// This corresponds to an assembler statement such as:
|
||||||
@ -170,7 +170,7 @@ namespace llvm {
|
|||||||
/// .size symbol, expression
|
/// .size symbol, expression
|
||||||
///
|
///
|
||||||
virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
|
virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) = 0;
|
||||||
|
|
||||||
/// EmitCommonSymbol - Emit a common symbol.
|
/// EmitCommonSymbol - Emit a common symbol.
|
||||||
///
|
///
|
||||||
/// @param Symbol - The common symbol to emit.
|
/// @param Symbol - The common symbol to emit.
|
||||||
@ -185,7 +185,7 @@ namespace llvm {
|
|||||||
/// @param Symbol - The common symbol to emit.
|
/// @param Symbol - The common symbol to emit.
|
||||||
/// @param Size - The size of the common symbol.
|
/// @param Size - The size of the common symbol.
|
||||||
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) = 0;
|
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) = 0;
|
||||||
|
|
||||||
/// EmitZerofill - Emit the zerofill section and an optional symbol.
|
/// EmitZerofill - Emit the zerofill section and an optional symbol.
|
||||||
///
|
///
|
||||||
/// @param Section - The zerofill section to create and or to put the symbol
|
/// @param Section - The zerofill section to create and or to put the symbol
|
||||||
@ -204,7 +204,7 @@ namespace llvm {
|
|||||||
/// @param ByteAlignment - The alignment of the thread local common symbol
|
/// @param ByteAlignment - The alignment of the thread local common symbol
|
||||||
/// if non-zero. This must be a power of 2 on some targets.
|
/// if non-zero. This must be a power of 2 on some targets.
|
||||||
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
||||||
uint64_t Size, unsigned ByteAlignment = 0) = 0;
|
uint64_t Size, unsigned ByteAlignment = 0) = 0;
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Generating Data
|
/// @name Generating Data
|
||||||
/// @{
|
/// @{
|
||||||
@ -231,31 +231,31 @@ namespace llvm {
|
|||||||
/// to pass in a MCExpr for constant integers.
|
/// to pass in a MCExpr for constant integers.
|
||||||
virtual void EmitIntValue(uint64_t Value, unsigned Size,
|
virtual void EmitIntValue(uint64_t Value, unsigned Size,
|
||||||
unsigned AddrSpace = 0);
|
unsigned AddrSpace = 0);
|
||||||
|
|
||||||
/// EmitSymbolValue - Special case of EmitValue that avoids the client
|
/// EmitSymbolValue - Special case of EmitValue that avoids the client
|
||||||
/// having to pass in a MCExpr for MCSymbols.
|
/// having to pass in a MCExpr for MCSymbols.
|
||||||
virtual void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
virtual void EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
|
||||||
unsigned AddrSpace);
|
unsigned AddrSpace);
|
||||||
|
|
||||||
/// EmitGPRel32Value - Emit the expression @p Value into the output as a
|
/// EmitGPRel32Value - Emit the expression @p Value into the output as a
|
||||||
/// gprel32 (32-bit GP relative) value.
|
/// gprel32 (32-bit GP relative) value.
|
||||||
///
|
///
|
||||||
/// This is used to implement assembler directives such as .gprel32 on
|
/// This is used to implement assembler directives such as .gprel32 on
|
||||||
/// targets that support them.
|
/// targets that support them.
|
||||||
virtual void EmitGPRel32Value(const MCExpr *Value) = 0;
|
virtual void EmitGPRel32Value(const MCExpr *Value) = 0;
|
||||||
|
|
||||||
/// EmitFill - Emit NumBytes bytes worth of the value specified by
|
/// EmitFill - Emit NumBytes bytes worth of the value specified by
|
||||||
/// FillValue. This implements directives such as '.space'.
|
/// FillValue. This implements directives such as '.space'.
|
||||||
virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
|
virtual void EmitFill(uint64_t NumBytes, uint8_t FillValue,
|
||||||
unsigned AddrSpace);
|
unsigned AddrSpace);
|
||||||
|
|
||||||
/// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
|
/// EmitZeros - Emit NumBytes worth of zeros. This is a convenience
|
||||||
/// function that just wraps EmitFill.
|
/// function that just wraps EmitFill.
|
||||||
void EmitZeros(uint64_t NumBytes, unsigned AddrSpace) {
|
void EmitZeros(uint64_t NumBytes, unsigned AddrSpace) {
|
||||||
EmitFill(NumBytes, 0, AddrSpace);
|
EmitFill(NumBytes, 0, AddrSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// EmitValueToAlignment - Emit some number of copies of @p Value until
|
/// EmitValueToAlignment - Emit some number of copies of @p Value until
|
||||||
/// the byte alignment @p ByteAlignment is reached.
|
/// the byte alignment @p ByteAlignment is reached.
|
||||||
///
|
///
|
||||||
@ -301,13 +301,13 @@ namespace llvm {
|
|||||||
/// @param Value - The value to use when filling bytes.
|
/// @param Value - The value to use when filling bytes.
|
||||||
virtual void EmitValueToOffset(const MCExpr *Offset,
|
virtual void EmitValueToOffset(const MCExpr *Offset,
|
||||||
unsigned char Value = 0) = 0;
|
unsigned char Value = 0) = 0;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// EmitFileDirective - Switch to a new logical file. This is used to
|
/// EmitFileDirective - Switch to a new logical file. This is used to
|
||||||
/// implement the '.file "foo.c"' assembler directive.
|
/// implement the '.file "foo.c"' assembler directive.
|
||||||
virtual void EmitFileDirective(StringRef Filename) = 0;
|
virtual void EmitFileDirective(StringRef Filename) = 0;
|
||||||
|
|
||||||
/// EmitDwarfFileDirective - Associate a filename with a specified logical
|
/// EmitDwarfFileDirective - Associate a filename with a specified logical
|
||||||
/// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
|
/// file number. This implements the DWARF2 '.file 4 "foo.c"' assembler
|
||||||
/// directive.
|
/// directive.
|
||||||
@ -322,7 +322,7 @@ namespace llvm {
|
|||||||
/// indicated by the hasRawTextSupport() predicate. By default this aborts.
|
/// indicated by the hasRawTextSupport() predicate. By default this aborts.
|
||||||
virtual void EmitRawText(StringRef String);
|
virtual void EmitRawText(StringRef String);
|
||||||
void EmitRawText(const Twine &String);
|
void EmitRawText(const Twine &String);
|
||||||
|
|
||||||
/// Finish - Finish emission of machine code.
|
/// Finish - Finish emission of machine code.
|
||||||
virtual void Finish() = 0;
|
virtual void Finish() = 0;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user