[C++11] Add 'override' keywords and remove 'virtual'. Additionally add 'final' and leave 'virtual' on some methods that are marked virtual without overriding anything and have no obvious overrides themselves. ARM64 edition

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207509 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2014-04-29 07:58:25 +00:00
parent aab65f8023
commit a4f9f5e7de
27 changed files with 141 additions and 132 deletions

View File

@ -75,13 +75,13 @@ public:
initializeARM64AddressTypePromotionPass(*PassRegistry::getPassRegistry()); initializeARM64AddressTypePromotionPass(*PassRegistry::getPassRegistry());
} }
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 Address Type Promotion"; return "ARM64 Address Type Promotion";
} }
/// Iterate over the functions and promote the computation of interesting /// Iterate over the functions and promote the computation of interesting
// sext instructions. // sext instructions.
bool runOnFunction(Function &F); bool runOnFunction(Function &F) override;
private: private:
/// The current function. /// The current function.
@ -91,7 +91,7 @@ private:
Type *ConsideredSExtType; Type *ConsideredSExtType;
// This transformation requires dominator info. // This transformation requires dominator info.
virtual void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG(); AU.setPreservesCFG();
AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<DominatorTreeWrapperPass>();
AU.addPreserved<DominatorTreeWrapperPass>(); AU.addPreserved<DominatorTreeWrapperPass>();

View File

@ -87,13 +87,13 @@ public:
static char ID; // Pass identification, replacement for typeid. static char ID; // Pass identification, replacement for typeid.
explicit ARM64AdvSIMDScalar() : MachineFunctionPass(ID) {} explicit ARM64AdvSIMDScalar() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &F); bool runOnMachineFunction(MachineFunction &F) override;
const char *getPassName() const { const char *getPassName() const override {
return "AdvSIMD Scalar Operation Optimization"; return "AdvSIMD Scalar Operation Optimization";
} }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG(); AU.setPreservesCFG();
MachineFunctionPass::getAnalysisUsage(AU); MachineFunctionPass::getAnalysisUsage(AU);
} }

View File

@ -56,7 +56,7 @@ public:
MCInstLowering(OutContext, *Mang, *this), SM(*this), ARM64FI(nullptr), MCInstLowering(OutContext, *Mang, *this), SM(*this), ARM64FI(nullptr),
LOHLabelCounter(0) {} LOHLabelCounter(0) {}
virtual const char *getPassName() const { return "ARM64 Assembly Printer"; } const char *getPassName() const override { return "ARM64 Assembly Printer"; }
/// \brief Wrapper for MCInstLowering.lowerOperand() for the /// \brief Wrapper for MCInstLowering.lowerOperand() for the
/// tblgen'erated pseudo lowering. /// tblgen'erated pseudo lowering.
@ -73,14 +73,14 @@ public:
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer, bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,
const MachineInstr *MI); const MachineInstr *MI);
void EmitInstruction(const MachineInstr *MI); void EmitInstruction(const MachineInstr *MI) override;
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AsmPrinter::getAnalysisUsage(AU); AsmPrinter::getAnalysisUsage(AU);
AU.setPreservesAll(); AU.setPreservesAll();
} }
bool runOnMachineFunction(MachineFunction &F) { bool runOnMachineFunction(MachineFunction &F) override {
ARM64FI = F.getInfo<ARM64FunctionInfo>(); ARM64FI = F.getInfo<ARM64FunctionInfo>();
return AsmPrinter::runOnMachineFunction(F); return AsmPrinter::runOnMachineFunction(F);
} }
@ -95,17 +95,17 @@ private:
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum, bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
unsigned AsmVariant, const char *ExtraCode, unsigned AsmVariant, const char *ExtraCode,
raw_ostream &O); raw_ostream &O) override;
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum, bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
unsigned AsmVariant, const char *ExtraCode, unsigned AsmVariant, const char *ExtraCode,
raw_ostream &O); raw_ostream &O) override;
void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS); void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
void EmitFunctionBodyEnd(); void EmitFunctionBodyEnd() override;
MCSymbol *GetCPISymbol(unsigned CPID) const; MCSymbol *GetCPISymbol(unsigned CPID) const override;
void EmitEndOfAsmFile(Module &M); void EmitEndOfAsmFile(Module &M) override;
ARM64FunctionInfo *ARM64FI; ARM64FunctionInfo *ARM64FI;
/// \brief Emit the LOHs contained in ARM64FI. /// \brief Emit the LOHs contained in ARM64FI.

View File

@ -94,9 +94,9 @@ public:
static char ID; static char ID;
ARM64BranchRelaxation() : MachineFunctionPass(ID) {} ARM64BranchRelaxation() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF); bool runOnMachineFunction(MachineFunction &MF) override;
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 branch relaxation pass"; return "ARM64 branch relaxation pass";
} }
}; };

View File

@ -38,7 +38,7 @@ struct LDTLSCleanup : public MachineFunctionPass {
static char ID; static char ID;
LDTLSCleanup() : MachineFunctionPass(ID) {} LDTLSCleanup() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &MF) { bool runOnMachineFunction(MachineFunction &MF) override {
ARM64FunctionInfo *AFI = MF.getInfo<ARM64FunctionInfo>(); ARM64FunctionInfo *AFI = MF.getInfo<ARM64FunctionInfo>();
if (AFI->getNumLocalDynamicTLSAccesses() < 2) { if (AFI->getNumLocalDynamicTLSAccesses() < 2) {
// No point folding accesses if there isn't at least two. // No point folding accesses if there isn't at least two.
@ -129,11 +129,11 @@ struct LDTLSCleanup : public MachineFunctionPass {
return Copy; return Copy;
} }
virtual const char *getPassName() const { const char *getPassName() const override {
return "Local Dynamic TLS Access Clean-up"; return "Local Dynamic TLS Access Clean-up";
} }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG(); AU.setPreservesCFG();
AU.addRequired<MachineDominatorTree>(); AU.addRequired<MachineDominatorTree>();
MachineFunctionPass::getAnalysisUsage(AU); MachineFunctionPass::getAnalysisUsage(AU);

View File

@ -174,13 +174,13 @@ struct ARM64CollectLOH : public MachineFunctionPass {
initializeARM64CollectLOHPass(*PassRegistry::getPassRegistry()); initializeARM64CollectLOHPass(*PassRegistry::getPassRegistry());
} }
virtual bool runOnMachineFunction(MachineFunction &MF); bool runOnMachineFunction(MachineFunction &MF) override;
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 Collect Linker Optimization Hint (LOH)"; return "ARM64 Collect Linker Optimization Hint (LOH)";
} }
void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesAll(); AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU); MachineFunctionPass::getAnalysisUsage(AU);
AU.addRequired<MachineDominatorTree>(); AU.addRequired<MachineDominatorTree>();

View File

@ -736,9 +736,11 @@ class ARM64ConditionalCompares : public MachineFunctionPass {
public: public:
static char ID; static char ID;
ARM64ConditionalCompares() : MachineFunctionPass(ID) {} ARM64ConditionalCompares() : MachineFunctionPass(ID) {}
void getAnalysisUsage(AnalysisUsage &AU) const; void getAnalysisUsage(AnalysisUsage &AU) const override;
bool runOnMachineFunction(MachineFunction &MF); bool runOnMachineFunction(MachineFunction &MF) override;
const char *getPassName() const { return "ARM64 Conditional Compares"; } const char *getPassName() const override {
return "ARM64 Conditional Compares";
}
private: private:
bool tryConvert(MachineBasicBlock *); bool tryConvert(MachineBasicBlock *);

View File

@ -36,11 +36,11 @@ public:
static char ID; // Pass identification, replacement for typeid. static char ID; // Pass identification, replacement for typeid.
explicit ARM64DeadRegisterDefinitions() : MachineFunctionPass(ID) {} explicit ARM64DeadRegisterDefinitions() : MachineFunctionPass(ID) {}
virtual bool runOnMachineFunction(MachineFunction &F); virtual bool runOnMachineFunction(MachineFunction &F) override;
const char *getPassName() const { return "Dead register definitions"; } const char *getPassName() const override { return "Dead register definitions"; }
virtual void getAnalysisUsage(AnalysisUsage &AU) const { virtual void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG(); AU.setPreservesCFG();
MachineFunctionPass::getAnalysisUsage(AU); MachineFunctionPass::getAnalysisUsage(AU);
} }

View File

@ -29,9 +29,9 @@ public:
const ARM64InstrInfo *TII; const ARM64InstrInfo *TII;
virtual bool runOnMachineFunction(MachineFunction &Fn); bool runOnMachineFunction(MachineFunction &Fn) override;
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 pseudo instruction expansion pass"; return "ARM64 pseudo instruction expansion pass";
} }

View File

@ -147,8 +147,8 @@ private:
public: public:
// Backend specific FastISel code. // Backend specific FastISel code.
virtual unsigned TargetMaterializeAlloca(const AllocaInst *AI); unsigned TargetMaterializeAlloca(const AllocaInst *AI) override;
virtual unsigned TargetMaterializeConstant(const Constant *C); unsigned TargetMaterializeConstant(const Constant *C) override;
explicit ARM64FastISel(FunctionLoweringInfo &funcInfo, explicit ARM64FastISel(FunctionLoweringInfo &funcInfo,
const TargetLibraryInfo *libInfo) const TargetLibraryInfo *libInfo)
@ -157,7 +157,7 @@ public:
Context = &funcInfo.Fn->getContext(); Context = &funcInfo.Fn->getContext();
} }
virtual bool TargetSelectInstruction(const Instruction *I); bool TargetSelectInstruction(const Instruction *I) override;
#include "ARM64GenFastISel.inc" #include "ARM64GenFastISel.inc"
}; };

View File

@ -36,38 +36,38 @@ public:
unsigned FramePtr) const; unsigned FramePtr) const;
void eliminateCallFramePseudoInstr(MachineFunction &MF, void eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB, MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const; MachineBasicBlock::iterator I) const override;
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
/// the function. /// the function.
void emitPrologue(MachineFunction &MF) const; void emitPrologue(MachineFunction &MF) const override;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
int getFrameIndexOffset(const MachineFunction &MF, int FI) const; int getFrameIndexOffset(const MachineFunction &MF, int FI) const override;
int getFrameIndexReference(const MachineFunction &MF, int FI, int getFrameIndexReference(const MachineFunction &MF, int FI,
unsigned &FrameReg) const; unsigned &FrameReg) const override;
int resolveFrameIndexReference(const MachineFunction &MF, int FI, int resolveFrameIndexReference(const MachineFunction &MF, int FI,
unsigned &FrameReg, unsigned &FrameReg,
bool PreferFP = false) const; bool PreferFP = false) const;
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const std::vector<CalleeSavedInfo> &CSI, const std::vector<CalleeSavedInfo> &CSI,
const TargetRegisterInfo *TRI) const; const TargetRegisterInfo *TRI) const override;
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI, MachineBasicBlock::iterator MI,
const std::vector<CalleeSavedInfo> &CSI, const std::vector<CalleeSavedInfo> &CSI,
const TargetRegisterInfo *TRI) const; const TargetRegisterInfo *TRI) const override;
/// \brief Can this function use the red zone for local allocations. /// \brief Can this function use the red zone for local allocations.
bool canUseRedZone(const MachineFunction &MF) const; bool canUseRedZone(const MachineFunction &MF) const;
bool hasFP(const MachineFunction &MF) const; bool hasFP(const MachineFunction &MF) const override;
bool hasReservedCallFrame(const MachineFunction &MF) const; bool hasReservedCallFrame(const MachineFunction &MF) const override;
void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, void processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
RegScavenger *RS) const; RegScavenger *RS) const override;
}; };
} // End llvm namespace } // End llvm namespace

View File

@ -47,11 +47,11 @@ public:
: SelectionDAGISel(tm, OptLevel), TM(tm), : SelectionDAGISel(tm, OptLevel), TM(tm),
Subtarget(&TM.getSubtarget<ARM64Subtarget>()), ForCodeSize(false) {} Subtarget(&TM.getSubtarget<ARM64Subtarget>()), ForCodeSize(false) {}
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 Instruction Selection"; return "ARM64 Instruction Selection";
} }
virtual bool runOnMachineFunction(MachineFunction &MF) { bool runOnMachineFunction(MachineFunction &MF) override {
AttributeSet FnAttrs = MF.getFunction()->getAttributes(); AttributeSet FnAttrs = MF.getFunction()->getAttributes();
ForCodeSize = ForCodeSize =
FnAttrs.hasAttribute(AttributeSet::FunctionIndex, FnAttrs.hasAttribute(AttributeSet::FunctionIndex,
@ -60,13 +60,13 @@ public:
return SelectionDAGISel::runOnMachineFunction(MF); return SelectionDAGISel::runOnMachineFunction(MF);
} }
SDNode *Select(SDNode *Node); SDNode *Select(SDNode *Node) override;
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for /// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
/// inline asm expressions. /// inline asm expressions.
virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op, bool SelectInlineAsmMemoryOperand(const SDValue &Op,
char ConstraintCode, char ConstraintCode,
std::vector<SDValue> &OutOps); std::vector<SDValue> &OutOps) override;
SDNode *SelectMLAV64LaneV128(SDNode *N); SDNode *SelectMLAV64LaneV128(SDNode *N);
SDNode *SelectMULLV64LaneV128(unsigned IntNo, SDNode *N); SDNode *SelectMULLV64LaneV128(unsigned IntNo, SDNode *N);

View File

@ -183,7 +183,7 @@ public:
/// KnownZero/KnownOne bitsets. /// KnownZero/KnownOne bitsets.
void computeMaskedBitsForTargetNode(const SDValue Op, APInt &KnownZero, void computeMaskedBitsForTargetNode(const SDValue Op, APInt &KnownZero,
APInt &KnownOne, const SelectionDAG &DAG, APInt &KnownOne, const SelectionDAG &DAG,
unsigned Depth = 0) const; unsigned Depth = 0) const override;
MVT getScalarShiftAmountTy(EVT LHSTy) const override; MVT getScalarShiftAmountTy(EVT LHSTy) const override;
@ -383,33 +383,36 @@ private:
SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const;
SDValue LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const; SDValue LowerFSINCOS(SDValue Op, SelectionDAG &DAG) const;
ConstraintType getConstraintType(const std::string &Constraint) const; ConstraintType
getConstraintType(const std::string &Constraint) const override;
/// Examine constraint string and operand type and determine a weight value. /// Examine constraint string and operand type and determine a weight value.
/// The operand object must already have been set up with the operand type. /// The operand object must already have been set up with the operand type.
ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, ConstraintWeight
const char *constraint) const; getSingleConstraintMatchWeight(AsmOperandInfo &info,
const char *constraint) const override;
std::pair<unsigned, const TargetRegisterClass *> std::pair<unsigned, const TargetRegisterClass *>
getRegForInlineAsmConstraint(const std::string &Constraint, MVT VT) const; getRegForInlineAsmConstraint(const std::string &Constraint,
MVT VT) const override;
void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint, void LowerAsmOperandForConstraint(SDValue Op, std::string &Constraint,
std::vector<SDValue> &Ops, std::vector<SDValue> &Ops,
SelectionDAG &DAG) const; SelectionDAG &DAG) const override;
bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const; bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
bool mayBeEmittedAsTailCall(CallInst *CI) const; bool mayBeEmittedAsTailCall(CallInst *CI) const override;
bool getIndexedAddressParts(SDNode *Op, SDValue &Base, SDValue &Offset, bool getIndexedAddressParts(SDNode *Op, SDValue &Base, SDValue &Offset,
ISD::MemIndexedMode &AM, bool &IsInc, ISD::MemIndexedMode &AM, bool &IsInc,
SelectionDAG &DAG) const; SelectionDAG &DAG) const;
bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset,
ISD::MemIndexedMode &AM, ISD::MemIndexedMode &AM,
SelectionDAG &DAG) const; SelectionDAG &DAG) const override;
bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base,
SDValue &Offset, ISD::MemIndexedMode &AM, SDValue &Offset, ISD::MemIndexedMode &AM,
SelectionDAG &DAG) const; SelectionDAG &DAG) const override;
void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results, void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
SelectionDAG &DAG) const; SelectionDAG &DAG) const override;
}; };
namespace ARM64 { namespace ARM64 {

View File

@ -101,9 +101,9 @@ struct ARM64LoadStoreOpt : public MachineFunctionPass {
bool optimizeBlock(MachineBasicBlock &MBB); bool optimizeBlock(MachineBasicBlock &MBB);
virtual bool runOnMachineFunction(MachineFunction &Fn); bool runOnMachineFunction(MachineFunction &Fn) override;
virtual const char *getPassName() const { const char *getPassName() const override {
return "ARM64 load / store optimization pass"; return "ARM64 load / store optimization pass";
} }

View File

@ -87,11 +87,11 @@ public:
static char ID; static char ID;
ARM64PromoteConstant() : ModulePass(ID) {} ARM64PromoteConstant() : ModulePass(ID) {}
virtual const char *getPassName() const { return "ARM64 Promote Constant"; } const char *getPassName() const override { return "ARM64 Promote Constant"; }
/// Iterate over the functions and promote the interesting constants into /// Iterate over the functions and promote the interesting constants into
/// global variables with module scope. /// global variables with module scope.
bool runOnModule(Module &M) { bool runOnModule(Module &M) override {
DEBUG(dbgs() << getPassName() << '\n'); DEBUG(dbgs() << getPassName() << '\n');
bool Changed = false; bool Changed = false;
for (auto &MF : M) { for (auto &MF : M) {
@ -107,7 +107,7 @@ private:
bool runOnFunction(Function &F); bool runOnFunction(Function &F);
// This transformation requires dominator info // This transformation requires dominator info
virtual void getAnalysisUsage(AnalysisUsage &AU) const { void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG(); AU.setPreservesCFG();
AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<DominatorTreeWrapperPass>();
AU.addPreserved<DominatorTreeWrapperPass>(); AU.addPreserved<DominatorTreeWrapperPass>();

View File

@ -40,7 +40,7 @@ public:
getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override; getCalleeSavedRegs(const MachineFunction *MF = nullptr) const override;
const uint32_t *getCallPreservedMask(CallingConv::ID) const override; const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
unsigned getCSRFirstUseCost() const { unsigned getCSRFirstUseCost() const override {
// The cost will be compared against BlockFrequency where entry has the // The cost will be compared against BlockFrequency where entry has the
// value of 1 << 14. A value of 5 will choose to spill or split really // value of 1 << 14. A value of 5 will choose to spill or split really
// cold path instead of using a callee-saved register. // cold path instead of using a callee-saved register.

View File

@ -100,7 +100,8 @@ public:
const char *getBZeroEntry() const; const char *getBZeroEntry() const;
void overrideSchedPolicy(MachineSchedPolicy &Policy, MachineInstr *begin, void overrideSchedPolicy(MachineSchedPolicy &Policy, MachineInstr *begin,
MachineInstr *end, unsigned NumRegionInstrs) const; MachineInstr *end,
unsigned NumRegionInstrs) const override;
}; };
} // End llvm namespace } // End llvm namespace

View File

@ -104,13 +104,13 @@ public:
return getTM<ARM64TargetMachine>(); return getTM<ARM64TargetMachine>();
} }
virtual bool addPreISel(); bool addPreISel() override;
virtual bool addInstSelector(); bool addInstSelector() override;
virtual bool addILPOpts(); bool addILPOpts() override;
virtual bool addPreRegAlloc(); bool addPreRegAlloc() override;
virtual bool addPostRegAlloc(); bool addPostRegAlloc() override;
virtual bool addPreSched2(); bool addPreSched2() override;
virtual bool addPreEmitPass(); bool addPreEmitPass() override;
}; };
} // namespace } // namespace

View File

@ -77,7 +77,8 @@ private:
bool validateInstruction(MCInst &Inst, SmallVectorImpl<SMLoc> &Loc); bool validateInstruction(MCInst &Inst, SmallVectorImpl<SMLoc> &Loc);
bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode, bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands, MCStreamer &Out, OperandVector &Operands, MCStreamer &Out,
unsigned &ErrorInfo, bool MatchingInlineAsm); unsigned &ErrorInfo,
bool MatchingInlineAsm) override;
/// @name Auto-generated Match Functions /// @name Auto-generated Match Functions
/// { /// {
@ -113,11 +114,12 @@ public:
setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits())); setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
} }
virtual bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name, bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands); SMLoc NameLoc, OperandVector &Operands) override;
virtual bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc); bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) override;
virtual bool ParseDirective(AsmToken DirectiveID); bool ParseDirective(AsmToken DirectiveID) override;
unsigned validateTargetOperandClass(MCParsedAsmOperand *Op, unsigned Kind); unsigned validateTargetOperandClass(MCParsedAsmOperand *Op,
unsigned Kind) override;
static bool classifySymbolRef(const MCExpr *Expr, static bool classifySymbolRef(const MCExpr *Expr,
ARM64MCExpr::VariantKind &ELFRefKind, ARM64MCExpr::VariantKind &ELFRefKind,
@ -293,9 +295,9 @@ public:
} }
/// 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 override { return StartLoc; }
/// getEndLoc - Get the location of the last token of this operand. /// getEndLoc - Get the location of the last token of this operand.
SMLoc getEndLoc() const { return EndLoc; } SMLoc getEndLoc() const override { return EndLoc; }
/// getOffsetLoc - Get the location of the offset of this memory operand. /// getOffsetLoc - Get the location of the offset of this memory operand.
SMLoc getOffsetLoc() const { return OffsetLoc; } SMLoc getOffsetLoc() const { return OffsetLoc; }
@ -324,7 +326,7 @@ public:
return Barrier.Val; return Barrier.Val;
} }
unsigned getReg() const { unsigned getReg() const override {
assert(Kind == k_Register && "Invalid access!"); assert(Kind == k_Register && "Invalid access!");
return Reg.RegNum; return Reg.RegNum;
} }
@ -369,7 +371,7 @@ public:
return Extend.Val; return Extend.Val;
} }
bool isImm() const { return Kind == k_Immediate; } bool isImm() const override { return Kind == k_Immediate; }
bool isSImm9() const { bool isSImm9() const {
if (!isImm()) if (!isImm())
return false; return false;
@ -686,7 +688,7 @@ public:
return IsKnownRegister; return IsKnownRegister;
} }
bool isReg() const { return Kind == k_Register && !Reg.isVector; } bool isReg() const override { return Kind == k_Register && !Reg.isVector; }
bool isVectorReg() const { return Kind == k_Register && Reg.isVector; } bool isVectorReg() const { return Kind == k_Register && Reg.isVector; }
bool isVectorRegLo() const { bool isVectorRegLo() const {
return Kind == k_Register && Reg.isVector && return Kind == k_Register && Reg.isVector &&
@ -723,11 +725,11 @@ public:
bool isVectorIndexD() const { bool isVectorIndexD() const {
return Kind == k_VectorIndex && VectorIndex.Val < 2; return Kind == k_VectorIndex && VectorIndex.Val < 2;
} }
bool isToken() const { return Kind == k_Token; } bool isToken() const override { return Kind == k_Token; }
bool isTokenEqual(StringRef Str) const { bool isTokenEqual(StringRef Str) const {
return Kind == k_Token && getToken() == Str; return Kind == k_Token && getToken() == Str;
} }
bool isMem() const { return Kind == k_Memory; } bool isMem() const override { return Kind == k_Memory; }
bool isSysCR() const { return Kind == k_SysCR; } bool isSysCR() const { return Kind == k_SysCR; }
bool isPrefetch() const { return Kind == k_Prefetch; } bool isPrefetch() const { return Kind == k_Prefetch; }
bool isShifter() const { return Kind == k_Shifter; } bool isShifter() const { return Kind == k_Shifter; }
@ -1594,7 +1596,7 @@ public:
addMemoryWritebackIndexedOperands(Inst, N, 16); addMemoryWritebackIndexedOperands(Inst, N, 16);
} }
virtual void print(raw_ostream &OS) const; void print(raw_ostream &OS) const override;
static ARM64Operand *CreateToken(StringRef Str, bool IsSuffix, SMLoc S, static ARM64Operand *CreateToken(StringRef Str, bool IsSuffix, SMLoc S,
MCContext &Ctx) { MCContext &Ctx) {

View File

@ -29,11 +29,10 @@ public:
~ARM64Disassembler() {} ~ARM64Disassembler() {}
/// getInstruction - See MCDisassembler. /// getInstruction - See MCDisassembler.
MCDisassembler::DecodeStatus getInstruction(MCInst &instr, uint64_t &size, MCDisassembler::DecodeStatus
const MemoryObject &region, getInstruction(MCInst &instr, uint64_t &size, const MemoryObject &region,
uint64_t address, uint64_t address, raw_ostream &vStream,
raw_ostream &vStream, raw_ostream &cStream) const override;
raw_ostream &cStream) const;
}; };
} // namespace llvm } // namespace llvm

View File

@ -28,8 +28,8 @@ public:
ARM64InstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, ARM64InstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override;
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const; void printRegName(raw_ostream &OS, unsigned RegNo) const override;
// Autogenerated by tblgen. // Autogenerated by tblgen.
virtual void printInstruction(const MCInst *MI, raw_ostream &O); virtual void printInstruction(const MCInst *MI, raw_ostream &O);
@ -162,11 +162,11 @@ public:
ARM64AppleInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII, ARM64AppleInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI); const MCRegisterInfo &MRI, const MCSubtargetInfo &STI);
virtual void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot); void printInst(const MCInst *MI, raw_ostream &O, StringRef Annot) override;
virtual void printInstruction(const MCInst *MI, raw_ostream &O); void printInstruction(const MCInst *MI, raw_ostream &O) override;
virtual bool printAliasInstr(const MCInst *MI, raw_ostream &O); bool printAliasInstr(const MCInst *MI, raw_ostream &O) override;
virtual StringRef getRegName(unsigned RegNo) const { StringRef getRegName(unsigned RegNo) const override {
return getRegisterName(RegNo); return getRegisterName(RegNo);
} }
static const char *getRegisterName(unsigned RegNo, static const char *getRegisterName(unsigned RegNo,

View File

@ -29,9 +29,11 @@ class ARM64AsmBackend : public MCAsmBackend {
public: public:
ARM64AsmBackend(const Target &T) : MCAsmBackend() {} ARM64AsmBackend(const Target &T) : MCAsmBackend() {}
unsigned getNumFixupKinds() const { return ARM64::NumTargetFixupKinds; } unsigned getNumFixupKinds() const override {
return ARM64::NumTargetFixupKinds;
}
const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const { const MCFixupKindInfo &getFixupKindInfo(MCFixupKind Kind) const override {
const static MCFixupKindInfo Infos[ARM64::NumTargetFixupKinds] = { const static MCFixupKindInfo Infos[ARM64::NumTargetFixupKinds] = {
// This table *must* be in the order that the fixup_* kinds are defined in // This table *must* be in the order that the fixup_* kinds are defined in
// ARM64FixupKinds.h. // ARM64FixupKinds.h.
@ -63,14 +65,14 @@ public:
} }
void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize, void applyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,
uint64_t Value, bool IsPCRel) const; uint64_t Value, bool IsPCRel) const override;
bool mayNeedRelaxation(const MCInst &Inst) const; bool mayNeedRelaxation(const MCInst &Inst) const override;
bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value, bool fixupNeedsRelaxation(const MCFixup &Fixup, uint64_t Value,
const MCRelaxableFragment *DF, const MCRelaxableFragment *DF,
const MCAsmLayout &Layout) const; const MCAsmLayout &Layout) const override;
void relaxInstruction(const MCInst &Inst, MCInst &Res) const; void relaxInstruction(const MCInst &Inst, MCInst &Res) const override;
bool writeNopData(uint64_t Count, MCObjectWriter *OW) const; bool writeNopData(uint64_t Count, MCObjectWriter *OW) const override;
void HandleAssemblerFlag(MCAssemblerFlag Flag) {} void HandleAssemblerFlag(MCAssemblerFlag Flag) {}
@ -306,12 +308,12 @@ public:
DarwinARM64AsmBackend(const Target &T, const MCRegisterInfo &MRI) DarwinARM64AsmBackend(const Target &T, const MCRegisterInfo &MRI)
: ARM64AsmBackend(T), MRI(MRI) {} : ARM64AsmBackend(T), MRI(MRI) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const { MCObjectWriter *createObjectWriter(raw_ostream &OS) const override {
return createARM64MachObjectWriter(OS, MachO::CPU_TYPE_ARM64, return createARM64MachObjectWriter(OS, MachO::CPU_TYPE_ARM64,
MachO::CPU_SUBTYPE_ARM64_ALL); MachO::CPU_SUBTYPE_ARM64_ALL);
} }
virtual bool doesSectionRequireSymbols(const MCSection &Section) const { bool doesSectionRequireSymbols(const MCSection &Section) const override {
// Any section for which the linker breaks things into atoms needs to // Any section for which the linker breaks things into atoms needs to
// preserve symbols, including assembler local symbols, to identify // preserve symbols, including assembler local symbols, to identify
// those atoms. These sections are: // those atoms. These sections are:
@ -348,9 +350,8 @@ public:
} }
/// \brief Generate the compact unwind encoding from the CFI directives. /// \brief Generate the compact unwind encoding from the CFI directives.
virtual uint32_t uint32_t generateCompactUnwindEncoding(
generateCompactUnwindEncoding(ArrayRef<MCCFIInstruction> Instrs) const ArrayRef<MCCFIInstruction> Instrs) const override {
override {
if (Instrs.empty()) if (Instrs.empty())
return CU::UNWIND_ARM64_MODE_FRAMELESS; return CU::UNWIND_ARM64_MODE_FRAMELESS;
@ -491,7 +492,7 @@ public:
ELFARM64AsmBackend(const Target &T, uint8_t OSABI, bool IsLittleEndian) ELFARM64AsmBackend(const Target &T, uint8_t OSABI, bool IsLittleEndian)
: ARM64AsmBackend(T), OSABI(OSABI), IsLittleEndian(IsLittleEndian) {} : ARM64AsmBackend(T), OSABI(OSABI), IsLittleEndian(IsLittleEndian) {}
MCObjectWriter *createObjectWriter(raw_ostream &OS) const { MCObjectWriter *createObjectWriter(raw_ostream &OS) const override {
return createARM64ELFObjectWriter(OS, OSABI, IsLittleEndian); return createARM64ELFObjectWriter(OS, OSABI, IsLittleEndian);
} }

View File

@ -62,8 +62,8 @@ public:
~ARM64ELFStreamer() {} ~ARM64ELFStreamer() {}
virtual void ChangeSection(const MCSection *Section, void ChangeSection(const MCSection *Section,
const MCExpr *Subsection) { const MCExpr *Subsection) override {
// We have to keep track of the mapping symbol state of any sections we // We have to keep track of the mapping symbol state of any sections we
// use. Each one should start off as EMS_None, which is provided as the // use. Each one should start off as EMS_None, which is provided as the
// default constructor by DenseMap::lookup. // default constructor by DenseMap::lookup.
@ -76,7 +76,8 @@ public:
/// This function is the one used to emit instruction data into the ELF /// This function is the one used to emit instruction data into the ELF
/// streamer. We override it to add the appropriate mapping symbol if /// streamer. We override it to add the appropriate mapping symbol if
/// necessary. /// necessary.
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) { void EmitInstruction(const MCInst &Inst,
const MCSubtargetInfo &STI) override {
EmitA64MappingSymbol(); EmitA64MappingSymbol();
MCELFStreamer::EmitInstruction(Inst, STI); MCELFStreamer::EmitInstruction(Inst, STI);
} }
@ -84,7 +85,7 @@ public:
/// This is one of the functions used to emit data into an ELF section, so the /// This is one of the functions used to emit data into an ELF section, so the
/// ARM64 streamer overrides it to add the appropriate mapping symbol ($d) /// ARM64 streamer overrides it to add the appropriate mapping symbol ($d)
/// if necessary. /// if necessary.
virtual void EmitBytes(StringRef Data) { void EmitBytes(StringRef Data) override {
EmitDataMappingSymbol(); EmitDataMappingSymbol();
MCELFStreamer::EmitBytes(Data); MCELFStreamer::EmitBytes(Data);
} }
@ -92,8 +93,8 @@ public:
/// This is one of the functions used to emit data into an ELF section, so the /// This is one of the functions used to emit data into an ELF section, so the
/// ARM64 streamer overrides it to add the appropriate mapping symbol ($d) /// ARM64 streamer overrides it to add the appropriate mapping symbol ($d)
/// if necessary. /// if necessary.
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size, void EmitValueImpl(const MCExpr *Value, unsigned Size,
const SMLoc &Loc) { const SMLoc &Loc) override {
EmitDataMappingSymbol(); EmitDataMappingSymbol();
MCELFStreamer::EmitValueImpl(Value, Size); MCELFStreamer::EmitValueImpl(Value, Size);
} }

View File

@ -22,9 +22,9 @@ class StringRef;
class MCStreamer; class MCStreamer;
struct ARM64MCAsmInfoDarwin : public MCAsmInfoDarwin { struct ARM64MCAsmInfoDarwin : public MCAsmInfoDarwin {
explicit ARM64MCAsmInfoDarwin(); explicit ARM64MCAsmInfoDarwin();
virtual const MCExpr *getExprForPersonalitySymbol(const MCSymbol *Sym, const MCExpr *
unsigned Encoding, getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding,
MCStreamer &Streamer) const; MCStreamer &Streamer) const override;
}; };
struct ARM64MCAsmInfoELF : public MCAsmInfo { struct ARM64MCAsmInfoELF : public MCAsmInfo {

View File

@ -182,7 +182,7 @@ public:
void EncodeInstruction(const MCInst &MI, raw_ostream &OS, void EncodeInstruction(const MCInst &MI, raw_ostream &OS,
SmallVectorImpl<MCFixup> &Fixups, SmallVectorImpl<MCFixup> &Fixups,
const MCSubtargetInfo &STI) const; const MCSubtargetInfo &STI) const override;
unsigned fixMulHigh(const MCInst &MI, unsigned EncodedValue, unsigned fixMulHigh(const MCInst &MI, unsigned EncodedValue,
const MCSubtargetInfo &STI) const; const MCSubtargetInfo &STI) const;

View File

@ -142,16 +142,16 @@ public:
/// (e.g. ":got:", ":lo12:"). /// (e.g. ":got:", ":lo12:").
StringRef getVariantKindName() const; StringRef getVariantKindName() const;
void PrintImpl(raw_ostream &OS) const; void PrintImpl(raw_ostream &OS) const override;
void AddValueSymbols(MCAssembler *) const; void AddValueSymbols(MCAssembler *) const override;
const MCSection *FindAssociatedSection() const; const MCSection *FindAssociatedSection() const override;
bool EvaluateAsRelocatableImpl(MCValue &Res, bool EvaluateAsRelocatableImpl(MCValue &Res,
const MCAsmLayout *Layout) const; const MCAsmLayout *Layout) const override;
void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const; void fixELFSymbolsInTLSFixups(MCAssembler &Asm) const override;
static bool classof(const MCExpr *E) { static bool classof(const MCExpr *E) {
return E->getKind() == MCExpr::Target; return E->getKind() == MCExpr::Target;

View File

@ -36,7 +36,7 @@ public:
void RecordRelocation(MachObjectWriter *Writer, const MCAssembler &Asm, void RecordRelocation(MachObjectWriter *Writer, const MCAssembler &Asm,
const MCAsmLayout &Layout, const MCFragment *Fragment, const MCAsmLayout &Layout, const MCFragment *Fragment,
const MCFixup &Fixup, MCValue Target, const MCFixup &Fixup, MCValue Target,
uint64_t &FixedValue); uint64_t &FixedValue) override;
}; };
} }