[C++11] Add 'override' keyword to virtual methods that override their base class.

llvm-svn: 203344
This commit is contained in:
Craig Topper 2014-03-08 07:51:20 +00:00
parent 5f9eb0af72
commit b51ff603ea
16 changed files with 229 additions and 237 deletions

View File

@ -56,7 +56,7 @@ protected:
/// while providing a common ObjectBuffer interface for access to the /// while providing a common ObjectBuffer interface for access to the
/// memory once the object has been generated. /// memory once the object has been generated.
class ObjectBufferStream : public ObjectBuffer { class ObjectBufferStream : public ObjectBuffer {
virtual void anchor(); void anchor() override;
public: public:
ObjectBufferStream() : OS(SV) {} ObjectBufferStream() : OS(SV) {}
virtual ~ObjectBufferStream() {} virtual ~ObjectBufferStream() {}

View File

@ -48,19 +48,18 @@ public:
/// ///
/// The value of \p Alignment must be a power of two. If \p Alignment is zero /// The value of \p Alignment must be a power of two. If \p Alignment is zero
/// a default alignment of 16 will be used. /// a default alignment of 16 will be used.
virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, unsigned SectionID,
StringRef SectionName); StringRef SectionName) override;
/// \brief Allocates a memory block of (at least) the given size suitable for /// \brief Allocates a memory block of (at least) the given size suitable for
/// executable code. /// executable code.
/// ///
/// The value of \p Alignment must be a power of two. If \p Alignment is zero /// The value of \p Alignment must be a power of two. If \p Alignment is zero
/// a default alignment of 16 will be used. /// a default alignment of 16 will be used.
virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, unsigned SectionID, StringRef SectionName,
StringRef SectionName, bool isReadOnly) override;
bool isReadOnly);
/// \brief Update section-specific memory permissions and other attributes. /// \brief Update section-specific memory permissions and other attributes.
/// ///
@ -73,7 +72,7 @@ public:
/// operations needed to reliably use the memory are also performed. /// operations needed to reliably use the memory are also performed.
/// ///
/// \returns true if an error occurred, false otherwise. /// \returns true if an error occurred, false otherwise.
virtual bool finalizeMemory(std::string *ErrMsg = 0); bool finalizeMemory(std::string *ErrMsg = 0) override;
/// \brief Invalidate instruction cache for code sections. /// \brief Invalidate instruction cache for code sections.
/// ///

View File

@ -97,7 +97,7 @@ public:
return static_cast<char*>(RawMemory) + sizeof(GVMemoryBlock); return static_cast<char*>(RawMemory) + sizeof(GVMemoryBlock);
} }
virtual void deleted() { void deleted() override {
// We allocated with operator new and with some extra memory hanging off the // We allocated with operator new and with some extra memory hanging off the
// end, so don't just delete this. I'm not sure if this is actually // end, so don't just delete this. I'm not sure if this is actually
// required. // required.

View File

@ -361,15 +361,15 @@ public:
void *Opaque); void *Opaque);
virtual ~SimpleBindingMemoryManager(); virtual ~SimpleBindingMemoryManager();
virtual uint8_t *allocateCodeSection( uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
uintptr_t Size, unsigned Alignment, unsigned SectionID, unsigned SectionID,
StringRef SectionName); StringRef SectionName) override;
virtual uint8_t *allocateDataSection( uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
uintptr_t Size, unsigned Alignment, unsigned SectionID, unsigned SectionID, StringRef SectionName,
StringRef SectionName, bool isReadOnly); bool isReadOnly) override;
virtual bool finalizeMemory(std::string *ErrMsg); bool finalizeMemory(std::string *ErrMsg) override;
private: private:
SimpleBindingMMFunctions Functions; SimpleBindingMMFunctions Functions;

View File

@ -112,11 +112,11 @@ public:
/// run - Start execution with the specified function and arguments. /// run - Start execution with the specified function and arguments.
/// ///
virtual GenericValue runFunction(Function *F, GenericValue runFunction(Function *F,
const std::vector<GenericValue> &ArgValues); const std::vector<GenericValue> &ArgValues) override;
virtual void *getPointerToNamedFunction(const std::string &Name, void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true) { bool AbortOnFailure = true) override {
// FIXME: not implemented. // FIXME: not implemented.
return 0; return 0;
} }
@ -124,13 +124,13 @@ public:
/// recompileAndRelinkFunction - For the interpreter, functions are always /// recompileAndRelinkFunction - For the interpreter, functions are always
/// up-to-date. /// up-to-date.
/// ///
virtual void *recompileAndRelinkFunction(Function *F) { void *recompileAndRelinkFunction(Function *F) override {
return getPointerToFunction(F); return getPointerToFunction(F);
} }
/// freeMachineCodeForFunction - The interpreter does not generate any code. /// freeMachineCodeForFunction - The interpreter does not generate any code.
/// ///
void freeMachineCodeForFunction(Function *F) { } void freeMachineCodeForFunction(Function *F) override { }
// Methods used to execute code: // Methods used to execute code:
// Place a call on the stack // Place a call on the stack
@ -212,8 +212,8 @@ private: // Helper functions
// //
void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF); void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF);
void *getPointerToFunction(Function *F) { return (void*)F; } void *getPointerToFunction(Function *F) override { return (void*)F; }
void *getPointerToBasicBlock(BasicBlock *BB) { return (void*)BB; } void *getPointerToBasicBlock(BasicBlock *BB) override { return (void*)BB; }
void initializeExecutionEngine() { } void initializeExecutionEngine() { }
void initializeExternalFunctions(); void initializeExternalFunctions();

View File

@ -450,9 +450,8 @@ void JIT::runJITOnFunction(Function *F, MachineCodeInfo *MCI) {
MachineCodeInfo *const MCI; MachineCodeInfo *const MCI;
public: public:
MCIListener(MachineCodeInfo *mci) : MCI(mci) {} MCIListener(MachineCodeInfo *mci) : MCI(mci) {}
virtual void NotifyFunctionEmitted(const Function &, void NotifyFunctionEmitted(const Function &, void *Code, size_t Size,
void *Code, size_t Size, const EmittedFunctionDetails &) override {
const EmittedFunctionDetails &) {
MCI->setAddress(Code); MCI->setAddress(Code);
MCI->setSize(Size); MCI->setSize(Size);
} }

View File

@ -106,16 +106,16 @@ public:
RM, CMM); RM, CMM);
} }
virtual void addModule(Module *M); void addModule(Module *M) override;
/// removeModule - Remove a Module from the list of modules. Returns true if /// removeModule - Remove a Module from the list of modules. Returns true if
/// M is found. /// M is found.
virtual bool removeModule(Module *M); bool removeModule(Module *M) override;
/// runFunction - Start execution with the specified function and arguments. /// runFunction - Start execution with the specified function and arguments.
/// ///
virtual GenericValue runFunction(Function *F, GenericValue runFunction(Function *F,
const std::vector<GenericValue> &ArgValues); const std::vector<GenericValue> &ArgValues) override;
/// getPointerToNamedFunction - This method returns the address of the /// getPointerToNamedFunction - This method returns the address of the
/// specified function by using the MemoryManager. As such it is only /// specified function by using the MemoryManager. As such it is only
@ -125,8 +125,8 @@ public:
/// found, this function silently returns a null pointer. Otherwise, /// found, this function silently returns a null pointer. Otherwise,
/// it prints a message to stderr and aborts. /// it prints a message to stderr and aborts.
/// ///
virtual void *getPointerToNamedFunction(const std::string &Name, void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true); bool AbortOnFailure = true) override;
// CompilationCallback - Invoked the first time that a call site is found, // CompilationCallback - Invoked the first time that a call site is found,
// which causes lazy compilation of the target function. // which causes lazy compilation of the target function.
@ -136,7 +136,7 @@ public:
/// getPointerToFunction - This returns the address of the specified function, /// getPointerToFunction - This returns the address of the specified function,
/// compiling it if necessary. /// compiling it if necessary.
/// ///
void *getPointerToFunction(Function *F); void *getPointerToFunction(Function *F) override;
/// addPointerToBasicBlock - Adds address of the specific basic block. /// addPointerToBasicBlock - Adds address of the specific basic block.
void addPointerToBasicBlock(const BasicBlock *BB, void *Addr); void addPointerToBasicBlock(const BasicBlock *BB, void *Addr);
@ -146,18 +146,18 @@ public:
/// getPointerToBasicBlock - This returns the address of the specified basic /// getPointerToBasicBlock - This returns the address of the specified basic
/// block, assuming function is compiled. /// block, assuming function is compiled.
void *getPointerToBasicBlock(BasicBlock *BB); void *getPointerToBasicBlock(BasicBlock *BB) override;
/// getOrEmitGlobalVariable - Return the address of the specified global /// getOrEmitGlobalVariable - Return the address of the specified global
/// variable, possibly emitting it to memory if needed. This is used by the /// variable, possibly emitting it to memory if needed. This is used by the
/// Emitter. /// Emitter.
void *getOrEmitGlobalVariable(const GlobalVariable *GV); void *getOrEmitGlobalVariable(const GlobalVariable *GV) override;
/// getPointerToFunctionOrStub - If the specified function has been /// getPointerToFunctionOrStub - If the specified function has been
/// code-gen'd, return a pointer to the function. If not, compile it, or use /// code-gen'd, return a pointer to the function. If not, compile it, or use
/// a stub to implement lazy compilation if available. /// a stub to implement lazy compilation if available.
/// ///
void *getPointerToFunctionOrStub(Function *F); void *getPointerToFunctionOrStub(Function *F) override;
/// recompileAndRelinkFunction - This method is used to force a function /// recompileAndRelinkFunction - This method is used to force a function
/// which has already been compiled, to be compiled again, possibly /// which has already been compiled, to be compiled again, possibly
@ -165,12 +165,12 @@ public:
/// with a branch to the new copy. If there was no old copy, this acts /// with a branch to the new copy. If there was no old copy, this acts
/// just like JIT::getPointerToFunction(). /// just like JIT::getPointerToFunction().
/// ///
void *recompileAndRelinkFunction(Function *F); void *recompileAndRelinkFunction(Function *F) override;
/// freeMachineCodeForFunction - deallocate memory used to code-generate this /// freeMachineCodeForFunction - deallocate memory used to code-generate this
/// Function. /// Function.
/// ///
void freeMachineCodeForFunction(Function *F); void freeMachineCodeForFunction(Function *F) override;
/// addPendingFunction - while jitting non-lazily, a called but non-codegen'd /// addPendingFunction - while jitting non-lazily, a called but non-codegen'd
/// function was encountered. Add it to a pending list to be processed after /// function was encountered. Add it to a pending list to be processed after
@ -189,12 +189,12 @@ public:
TargetMachine *TM); TargetMachine *TM);
// Run the JIT on F and return information about the generated code // Run the JIT on F and return information about the generated code
void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0); void runJITOnFunction(Function *F, MachineCodeInfo *MCI = 0) override;
virtual void RegisterJITEventListener(JITEventListener *L); void RegisterJITEventListener(JITEventListener *L) override;
virtual void UnregisterJITEventListener(JITEventListener *L); void UnregisterJITEventListener(JITEventListener *L) override;
virtual TargetMachine *getTargetMachine() { return &TM; } TargetMachine *getTargetMachine() override { return &TM; }
/// These functions correspond to the methods on JITEventListener. They /// These functions correspond to the methods on JITEventListener. They
/// iterate over the registered listeners and call the corresponding method on /// iterate over the registered listeners and call the corresponding method on
@ -220,7 +220,7 @@ private:
protected: protected:
/// getMemoryforGV - Allocate memory for a global variable. /// getMemoryforGV - Allocate memory for a global variable.
virtual char* getMemoryForGV(const GlobalVariable* GV); char* getMemoryForGV(const GlobalVariable* GV) override;
}; };

View File

@ -375,8 +375,8 @@ namespace {
JITResolver &getJITResolver() { return Resolver; } JITResolver &getJITResolver() { return Resolver; }
virtual void startFunction(MachineFunction &F); void startFunction(MachineFunction &F) override;
virtual bool finishFunction(MachineFunction &F); bool finishFunction(MachineFunction &F) override;
void emitConstantPool(MachineConstantPool *MCP); void emitConstantPool(MachineConstantPool *MCP);
void initJumpTableInfo(MachineJumpTableInfo *MJTI); void initJumpTableInfo(MachineJumpTableInfo *MJTI);
@ -386,24 +386,23 @@ namespace {
unsigned StubSize, unsigned Alignment = 1); unsigned StubSize, unsigned Alignment = 1);
void startGVStub(void *Buffer, unsigned StubSize); void startGVStub(void *Buffer, unsigned StubSize);
void finishGVStub(); void finishGVStub();
virtual void *allocIndirectGV(const GlobalValue *GV, void *allocIndirectGV(const GlobalValue *GV, const uint8_t *Buffer,
const uint8_t *Buffer, size_t Size, size_t Size, unsigned Alignment) override;
unsigned Alignment);
/// allocateSpace - Reserves space in the current block if any, or /// allocateSpace - Reserves space in the current block if any, or
/// allocate a new one of the given size. /// allocate a new one of the given size.
virtual void *allocateSpace(uintptr_t Size, unsigned Alignment); void *allocateSpace(uintptr_t Size, unsigned Alignment) override;
/// allocateGlobal - Allocate memory for a global. Unlike allocateSpace, /// allocateGlobal - Allocate memory for a global. Unlike allocateSpace,
/// this method does not allocate memory in the current output buffer, /// this method does not allocate memory in the current output buffer,
/// because a global may live longer than the current function. /// because a global may live longer than the current function.
virtual void *allocateGlobal(uintptr_t Size, unsigned Alignment); void *allocateGlobal(uintptr_t Size, unsigned Alignment) override;
virtual void addRelocation(const MachineRelocation &MR) { void addRelocation(const MachineRelocation &MR) override {
Relocations.push_back(MR); Relocations.push_back(MR);
} }
virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) { void StartMachineBasicBlock(MachineBasicBlock *MBB) override {
if (MBBLocations.size() <= (unsigned)MBB->getNumber()) if (MBBLocations.size() <= (unsigned)MBB->getNumber())
MBBLocations.resize((MBB->getNumber()+1)*2); MBBLocations.resize((MBB->getNumber()+1)*2);
MBBLocations[MBB->getNumber()] = getCurrentPCValue(); MBBLocations[MBB->getNumber()] = getCurrentPCValue();
@ -414,10 +413,11 @@ namespace {
<< (void*) getCurrentPCValue() << "]\n"); << (void*) getCurrentPCValue() << "]\n");
} }
virtual uintptr_t getConstantPoolEntryAddress(unsigned Entry) const; uintptr_t getConstantPoolEntryAddress(unsigned Entry) const override;
virtual uintptr_t getJumpTableEntryAddress(unsigned Entry) const; uintptr_t getJumpTableEntryAddress(unsigned Entry) const override;
virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const{ uintptr_t
getMachineBasicBlockAddress(MachineBasicBlock *MBB) const override {
assert(MBBLocations.size() > (unsigned)MBB->getNumber() && assert(MBBLocations.size() > (unsigned)MBB->getNumber() &&
MBBLocations[MBB->getNumber()] && "MBB not emitted!"); MBBLocations[MBB->getNumber()] && "MBB not emitted!");
return MBBLocations[MBB->getNumber()]; return MBBLocations[MBB->getNumber()];
@ -432,22 +432,22 @@ namespace {
/// function body. /// function body.
void deallocateMemForFunction(const Function *F); void deallocateMemForFunction(const Function *F);
virtual void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn); void processDebugLoc(DebugLoc DL, bool BeforePrintingInsn) override;
virtual void emitLabel(MCSymbol *Label) { void emitLabel(MCSymbol *Label) override {
LabelLocations[Label] = getCurrentPCValue(); LabelLocations[Label] = getCurrentPCValue();
} }
virtual DenseMap<MCSymbol*, uintptr_t> *getLabelLocations() { DenseMap<MCSymbol*, uintptr_t> *getLabelLocations() override {
return &LabelLocations; return &LabelLocations;
} }
virtual uintptr_t getLabelAddress(MCSymbol *Label) const { uintptr_t getLabelAddress(MCSymbol *Label) const override {
assert(LabelLocations.count(Label) && "Label not emitted!"); assert(LabelLocations.count(Label) && "Label not emitted!");
return LabelLocations.find(Label)->second; return LabelLocations.find(Label)->second;
} }
virtual void setModuleInfo(MachineModuleInfo* Info) { void setModuleInfo(MachineModuleInfo* Info) override {
MMI = Info; MMI = Info;
} }

View File

@ -274,8 +274,8 @@ namespace {
public: public:
JITSlabAllocator(DefaultJITMemoryManager &jmm) : JMM(jmm) { } JITSlabAllocator(DefaultJITMemoryManager &jmm) : JMM(jmm) { }
virtual ~JITSlabAllocator() { } virtual ~JITSlabAllocator() { }
virtual MemSlab *Allocate(size_t Size); MemSlab *Allocate(size_t Size) override;
virtual void Deallocate(MemSlab *Slab); void Deallocate(MemSlab *Slab) override;
}; };
/// DefaultJITMemoryManager - Manage memory for the JIT code generation. /// DefaultJITMemoryManager - Manage memory for the JIT code generation.
@ -332,23 +332,24 @@ namespace {
/// getPointerToNamedFunction - This method returns the address of the /// getPointerToNamedFunction - This method returns the address of the
/// specified function by using the dlsym function call. /// specified function by using the dlsym function call.
virtual void *getPointerToNamedFunction(const std::string &Name, void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true); bool AbortOnFailure = true) override;
void AllocateGOT(); void AllocateGOT() override;
// Testing methods. // Testing methods.
virtual bool CheckInvariants(std::string &ErrorStr); bool CheckInvariants(std::string &ErrorStr) override;
size_t GetDefaultCodeSlabSize() { return DefaultCodeSlabSize; } size_t GetDefaultCodeSlabSize() override { return DefaultCodeSlabSize; }
size_t GetDefaultDataSlabSize() { return DefaultSlabSize; } size_t GetDefaultDataSlabSize() override { return DefaultSlabSize; }
size_t GetDefaultStubSlabSize() { return DefaultSlabSize; } size_t GetDefaultStubSlabSize() override { return DefaultSlabSize; }
unsigned GetNumCodeSlabs() { return CodeSlabs.size(); } unsigned GetNumCodeSlabs() override { return CodeSlabs.size(); }
unsigned GetNumDataSlabs() { return DataAllocator.GetNumSlabs(); } unsigned GetNumDataSlabs() override { return DataAllocator.GetNumSlabs(); }
unsigned GetNumStubSlabs() { return StubAllocator.GetNumSlabs(); } unsigned GetNumStubSlabs() override { return StubAllocator.GetNumSlabs(); }
/// startFunctionBody - When a function starts, allocate a block of free /// startFunctionBody - When a function starts, allocate a block of free
/// executable memory, returning a pointer to it and its actual size. /// executable memory, returning a pointer to it and its actual size.
uint8_t *startFunctionBody(const Function *F, uintptr_t &ActualSize) { uint8_t *startFunctionBody(const Function *F,
uintptr_t &ActualSize) override {
FreeRangeHeader* candidateBlock = FreeMemoryList; FreeRangeHeader* candidateBlock = FreeMemoryList;
FreeRangeHeader* head = FreeMemoryList; FreeRangeHeader* head = FreeMemoryList;
@ -422,7 +423,7 @@ namespace {
/// endFunctionBody - The function F is now allocated, and takes the memory /// endFunctionBody - The function F is now allocated, and takes the memory
/// in the range [FunctionStart,FunctionEnd). /// in the range [FunctionStart,FunctionEnd).
void endFunctionBody(const Function *F, uint8_t *FunctionStart, void endFunctionBody(const Function *F, uint8_t *FunctionStart,
uint8_t *FunctionEnd) { uint8_t *FunctionEnd) override {
assert(FunctionEnd > FunctionStart); assert(FunctionEnd > FunctionStart);
assert(FunctionStart == (uint8_t *)(CurBlock+1) && assert(FunctionStart == (uint8_t *)(CurBlock+1) &&
"Mismatched function start/end!"); "Mismatched function start/end!");
@ -435,7 +436,7 @@ namespace {
/// allocateSpace - Allocate a memory block of the given size. This method /// allocateSpace - Allocate a memory block of the given size. This method
/// cannot be called between calls to startFunctionBody and endFunctionBody. /// cannot be called between calls to startFunctionBody and endFunctionBody.
uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) { uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) override {
CurBlock = FreeMemoryList; CurBlock = FreeMemoryList;
FreeMemoryList = FreeMemoryList->AllocateBlock(); FreeMemoryList = FreeMemoryList->AllocateBlock();
@ -453,18 +454,19 @@ namespace {
/// allocateStub - Allocate memory for a function stub. /// allocateStub - Allocate memory for a function stub.
uint8_t *allocateStub(const GlobalValue* F, unsigned StubSize, uint8_t *allocateStub(const GlobalValue* F, unsigned StubSize,
unsigned Alignment) { unsigned Alignment) override {
return (uint8_t*)StubAllocator.Allocate(StubSize, Alignment); return (uint8_t*)StubAllocator.Allocate(StubSize, Alignment);
} }
/// allocateGlobal - Allocate memory for a global. /// allocateGlobal - Allocate memory for a global.
uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) { uint8_t *allocateGlobal(uintptr_t Size, unsigned Alignment) override {
return (uint8_t*)DataAllocator.Allocate(Size, Alignment); return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
} }
/// allocateCodeSection - Allocate memory for a code section. /// allocateCodeSection - Allocate memory for a code section.
uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, StringRef SectionName) { unsigned SectionID,
StringRef SectionName) override {
// Grow the required block size to account for the block header // Grow the required block size to account for the block header
Size += sizeof(*CurBlock); Size += sizeof(*CurBlock);
@ -511,15 +513,15 @@ namespace {
/// allocateDataSection - Allocate memory for a data section. /// allocateDataSection - Allocate memory for a data section.
uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, StringRef SectionName, unsigned SectionID, StringRef SectionName,
bool IsReadOnly) { bool IsReadOnly) override {
return (uint8_t*)DataAllocator.Allocate(Size, Alignment); return (uint8_t*)DataAllocator.Allocate(Size, Alignment);
} }
bool finalizeMemory(std::string *ErrMsg) { bool finalizeMemory(std::string *ErrMsg) override {
return false; return false;
} }
uint8_t *getGOTBase() const { uint8_t *getGOTBase() const override {
return GOTBase; return GOTBase;
} }
@ -539,28 +541,26 @@ namespace {
/// deallocateFunctionBody - Deallocate all memory for the specified /// deallocateFunctionBody - Deallocate all memory for the specified
/// function body. /// function body.
void deallocateFunctionBody(void *Body) { void deallocateFunctionBody(void *Body) override {
if (Body) deallocateBlock(Body); if (Body) deallocateBlock(Body);
} }
/// setMemoryWritable - When code generation is in progress, /// setMemoryWritable - When code generation is in progress,
/// the code pages may need permissions changed. /// the code pages may need permissions changed.
void setMemoryWritable() void setMemoryWritable() override {
{
for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i) for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i)
sys::Memory::setWritable(CodeSlabs[i]); sys::Memory::setWritable(CodeSlabs[i]);
} }
/// setMemoryExecutable - When code generation is done and we're ready to /// setMemoryExecutable - When code generation is done and we're ready to
/// start execution, the code pages may need permissions changed. /// start execution, the code pages may need permissions changed.
void setMemoryExecutable() void setMemoryExecutable() override {
{
for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i) for (unsigned i = 0, e = CodeSlabs.size(); i != e; ++i)
sys::Memory::setExecutable(CodeSlabs[i]); sys::Memory::setExecutable(CodeSlabs[i]);
} }
/// setPoisonMemory - Controls whether we write garbage over freed memory. /// setPoisonMemory - Controls whether we write garbage over freed memory.
/// ///
void setPoisonMemory(bool poison) { void setPoisonMemory(bool poison) override {
PoisonMemory = poison; PoisonMemory = poison;
} }
}; };

View File

@ -31,46 +31,47 @@ public:
LinkingMemoryManager(MCJIT *Parent, RTDyldMemoryManager *MM) LinkingMemoryManager(MCJIT *Parent, RTDyldMemoryManager *MM)
: ParentEngine(Parent), ClientMM(MM) {} : ParentEngine(Parent), ClientMM(MM) {}
virtual uint64_t getSymbolAddress(const std::string &Name); uint64_t getSymbolAddress(const std::string &Name) override;
// Functions deferred to client memory manager // Functions deferred to client memory manager
virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, StringRef SectionName) { unsigned SectionID,
StringRef SectionName) override {
return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName); return ClientMM->allocateCodeSection(Size, Alignment, SectionID, SectionName);
} }
virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment, uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID, StringRef SectionName, unsigned SectionID, StringRef SectionName,
bool IsReadOnly) { bool IsReadOnly) override {
return ClientMM->allocateDataSection(Size, Alignment, return ClientMM->allocateDataSection(Size, Alignment,
SectionID, SectionName, IsReadOnly); SectionID, SectionName, IsReadOnly);
} }
virtual void reserveAllocationSpace( void reserveAllocationSpace(uintptr_t CodeSize, uintptr_t DataSizeRO,
uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) { uintptr_t DataSizeRW) override {
return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW); return ClientMM->reserveAllocationSpace(CodeSize, DataSizeRO, DataSizeRW);
} }
virtual bool needsToReserveAllocationSpace() { bool needsToReserveAllocationSpace() override {
return ClientMM->needsToReserveAllocationSpace(); return ClientMM->needsToReserveAllocationSpace();
} }
virtual void notifyObjectLoaded(ExecutionEngine *EE, void notifyObjectLoaded(ExecutionEngine *EE,
const ObjectImage *Obj) { const ObjectImage *Obj) override {
ClientMM->notifyObjectLoaded(EE, Obj); ClientMM->notifyObjectLoaded(EE, Obj);
} }
virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) { void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr,
size_t Size) override {
ClientMM->registerEHFrames(Addr, LoadAddr, Size); ClientMM->registerEHFrames(Addr, LoadAddr, Size);
} }
virtual void deregisterEHFrames(uint8_t *Addr, void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr,
uint64_t LoadAddr, size_t Size) override {
size_t Size) {
ClientMM->deregisterEHFrames(Addr, LoadAddr, Size); ClientMM->deregisterEHFrames(Addr, LoadAddr, Size);
} }
virtual bool finalizeMemory(std::string *ErrMsg = 0) { bool finalizeMemory(std::string *ErrMsg = 0) override {
return ClientMM->finalizeMemory(ErrMsg); return ClientMM->finalizeMemory(ErrMsg);
} }
@ -237,20 +238,20 @@ public:
/// @name ExecutionEngine interface implementation /// @name ExecutionEngine interface implementation
/// @{ /// @{
virtual void addModule(Module *M); void addModule(Module *M) override;
virtual void addObjectFile(object::ObjectFile *O); void addObjectFile(object::ObjectFile *O) override;
virtual void addArchive(object::Archive *O); void addArchive(object::Archive *O) override;
virtual bool removeModule(Module *M); bool removeModule(Module *M) override;
/// FindFunctionNamed - Search all of the active modules to find the one that /// FindFunctionNamed - Search all of the active modules to find the one that
/// defines FnName. This is very slow operation and shouldn't be used for /// defines FnName. This is very slow operation and shouldn't be used for
/// general code. /// general code.
virtual Function *FindFunctionNamed(const char *FnName); Function *FindFunctionNamed(const char *FnName) override;
/// Sets the object manager that MCJIT should use to avoid compilation. /// Sets the object manager that MCJIT should use to avoid compilation.
virtual void setObjectCache(ObjectCache *manager); void setObjectCache(ObjectCache *manager) override;
virtual void generateCodeForModule(Module *M); void generateCodeForModule(Module *M) override;
/// finalizeObject - ensure the module is fully processed and is usable. /// finalizeObject - ensure the module is fully processed and is usable.
/// ///
@ -261,7 +262,7 @@ public:
/// object. /// object.
/// Is it OK to finalize a set of modules, add modules and finalize again. /// Is it OK to finalize a set of modules, add modules and finalize again.
// FIXME: Do we really need both of these? // FIXME: Do we really need both of these?
virtual void finalizeObject(); void finalizeObject() override;
virtual void finalizeModule(Module *); virtual void finalizeModule(Module *);
void finalizeLoadedModules(); void finalizeLoadedModules();
@ -269,18 +270,18 @@ public:
/// the static constructors or destructors for a program. /// the static constructors or destructors for a program.
/// ///
/// \param isDtors - Run the destructors instead of constructors. /// \param isDtors - Run the destructors instead of constructors.
void runStaticConstructorsDestructors(bool isDtors); void runStaticConstructorsDestructors(bool isDtors) override;
virtual void *getPointerToBasicBlock(BasicBlock *BB); void *getPointerToBasicBlock(BasicBlock *BB) override;
virtual void *getPointerToFunction(Function *F); void *getPointerToFunction(Function *F) override;
virtual void *recompileAndRelinkFunction(Function *F); void *recompileAndRelinkFunction(Function *F) override;
virtual void freeMachineCodeForFunction(Function *F); void freeMachineCodeForFunction(Function *F) override;
virtual GenericValue runFunction(Function *F, GenericValue runFunction(Function *F,
const std::vector<GenericValue> &ArgValues); const std::vector<GenericValue> &ArgValues) override;
/// getPointerToNamedFunction - This method returns the address of the /// getPointerToNamedFunction - This method returns the address of the
/// specified function by using the dlsym function call. As such it is only /// specified function by using the dlsym function call. As such it is only
@ -290,27 +291,27 @@ public:
/// found, this function silently returns a null pointer. Otherwise, /// found, this function silently returns a null pointer. Otherwise,
/// it prints a message to stderr and aborts. /// it prints a message to stderr and aborts.
/// ///
virtual void *getPointerToNamedFunction(const std::string &Name, void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true); bool AbortOnFailure = true) override;
/// mapSectionAddress - map a section to its target address space value. /// mapSectionAddress - map a section to its target address space value.
/// Map the address of a JIT section as returned from the memory manager /// Map the address of a JIT section as returned from the memory manager
/// to the address in the target process as the running code will see it. /// to the address in the target process as the running code will see it.
/// This is the address which will be used for relocation resolution. /// This is the address which will be used for relocation resolution.
virtual void mapSectionAddress(const void *LocalAddress, void mapSectionAddress(const void *LocalAddress,
uint64_t TargetAddress) { uint64_t TargetAddress) override {
Dyld.mapSectionAddress(LocalAddress, TargetAddress); Dyld.mapSectionAddress(LocalAddress, TargetAddress);
} }
virtual void RegisterJITEventListener(JITEventListener *L); void RegisterJITEventListener(JITEventListener *L) override;
virtual void UnregisterJITEventListener(JITEventListener *L); void UnregisterJITEventListener(JITEventListener *L) override;
// If successful, these function will implicitly finalize all loaded objects. // If successful, these function will implicitly finalize all loaded objects.
// To get a function address within MCJIT without causing a finalize, use // To get a function address within MCJIT without causing a finalize, use
// getSymbolAddress. // getSymbolAddress.
virtual uint64_t getGlobalValueAddress(const std::string &Name); uint64_t getGlobalValueAddress(const std::string &Name) override;
virtual uint64_t getFunctionAddress(const std::string &Name); uint64_t getFunctionAddress(const std::string &Name) override;
virtual TargetMachine *getTargetMachine() { return TM; } TargetMachine *getTargetMachine() override { return TM; }
/// @} /// @}
/// @name (Private) Registration Interfaces /// @name (Private) Registration Interfaces

View File

@ -84,12 +84,12 @@ public:
/// Creates an entry in the JIT registry for the buffer @p Object, /// Creates an entry in the JIT registry for the buffer @p Object,
/// which must contain an object file in executable memory with any /// which must contain an object file in executable memory with any
/// debug information for the debugger. /// debug information for the debugger.
void registerObject(const ObjectBuffer &Object); void registerObject(const ObjectBuffer &Object) override;
/// Removes the internal registration of @p Object, and /// Removes the internal registration of @p Object, and
/// frees associated resources. /// frees associated resources.
/// Returns true if @p Object was found in ObjectBufferMap. /// Returns true if @p Object was found in ObjectBufferMap.
bool deregisterObject(const ObjectBuffer &Object); bool deregisterObject(const ObjectBuffer &Object) override;
private: private:
/// Deregister the debug info for the given object file from the debugger /// Deregister the debug info for the given object file from the debugger

View File

@ -27,7 +27,7 @@ namespace object {
class ObjectImageCommon : public ObjectImage { class ObjectImageCommon : public ObjectImage {
ObjectImageCommon(); // = delete ObjectImageCommon(); // = delete
ObjectImageCommon(const ObjectImageCommon &other); // = delete ObjectImageCommon(const ObjectImageCommon &other); // = delete
virtual void anchor(); void anchor() override;
protected: protected:
object::ObjectFile *ObjFile; object::ObjectFile *ObjFile;
@ -51,33 +51,33 @@ public:
: ObjectImage(NULL), ObjFile(Input) {} : ObjectImage(NULL), ObjFile(Input) {}
virtual ~ObjectImageCommon() { delete ObjFile; } virtual ~ObjectImageCommon() { delete ObjFile; }
virtual object::symbol_iterator begin_symbols() const object::symbol_iterator begin_symbols() const override
{ return ObjFile->symbol_begin(); } { return ObjFile->symbol_begin(); }
virtual object::symbol_iterator end_symbols() const object::symbol_iterator end_symbols() const override
{ return ObjFile->symbol_end(); } { return ObjFile->symbol_end(); }
virtual object::section_iterator begin_sections() const object::section_iterator begin_sections() const override
{ return ObjFile->section_begin(); } { return ObjFile->section_begin(); }
virtual object::section_iterator end_sections() const object::section_iterator end_sections() const override
{ return ObjFile->section_end(); } { return ObjFile->section_end(); }
virtual /* Triple::ArchType */ unsigned getArch() const /* Triple::ArchType */ unsigned getArch() const override
{ return ObjFile->getArch(); } { return ObjFile->getArch(); }
virtual StringRef getData() const { return ObjFile->getData(); } StringRef getData() const override { return ObjFile->getData(); }
virtual object::ObjectFile* getObjectFile() const { return ObjFile; } object::ObjectFile* getObjectFile() const override { return ObjFile; }
// Subclasses can override these methods to update the image with loaded // Subclasses can override these methods to update the image with loaded
// addresses for sections and common symbols // addresses for sections and common symbols
virtual void updateSectionAddress(const object::SectionRef &Sec, void updateSectionAddress(const object::SectionRef &Sec,
uint64_t Addr) {} uint64_t Addr) override {}
virtual void updateSymbolAddress(const object::SymbolRef &Sym, uint64_t Addr) void updateSymbolAddress(const object::SymbolRef &Sym,
{} uint64_t Addr) override {}
// Subclasses can override these methods to provide JIT debugging support // Subclasses can override these methods to provide JIT debugging support
virtual void registerWithDebugger() {} void registerWithDebugger() override {}
virtual void deregisterWithDebugger() {} void deregisterWithDebugger() override {}
}; };
} // end namespace llvm } // end namespace llvm

View File

@ -94,23 +94,19 @@ class ELFObjectImage : public ObjectImageCommon {
// Subclasses can override these methods to update the image with loaded // Subclasses can override these methods to update the image with loaded
// addresses for sections and common symbols // addresses for sections and common symbols
virtual void updateSectionAddress(const SectionRef &Sec, uint64_t Addr) void updateSectionAddress(const SectionRef &Sec, uint64_t Addr) override {
{
DyldObj->updateSectionAddress(Sec, Addr); DyldObj->updateSectionAddress(Sec, Addr);
} }
virtual void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr) void updateSymbolAddress(const SymbolRef &Sym, uint64_t Addr) override {
{
DyldObj->updateSymbolAddress(Sym, Addr); DyldObj->updateSymbolAddress(Sym, Addr);
} }
virtual void registerWithDebugger() void registerWithDebugger() override {
{
JITRegistrar::getGDBRegistrar().registerObject(*Buffer); JITRegistrar::getGDBRegistrar().registerObject(*Buffer);
Registered = true; Registered = true;
} }
virtual void deregisterWithDebugger() void deregisterWithDebugger() override {
{
JITRegistrar::getGDBRegistrar().deregisterObject(*Buffer); JITRegistrar::getGDBRegistrar().deregisterObject(*Buffer);
} }
}; };

View File

@ -82,7 +82,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
uint32_t Type, uint32_t Type,
int64_t Addend); int64_t Addend);
unsigned getMaxStubSize() { unsigned getMaxStubSize() override {
if (Arch == Triple::aarch64) if (Arch == Triple::aarch64)
return 20; // movz; movk; movk; movk; br return 20; // movz; movk; movk; movk; br
if (Arch == Triple::arm || Arch == Triple::thumb) if (Arch == Triple::arm || Arch == Triple::thumb)
@ -99,7 +99,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
return 0; return 0;
} }
unsigned getStubAlignment() { unsigned getStubAlignment() override {
if (Arch == Triple::systemz) if (Arch == Triple::systemz)
return 8; return 8;
else else
@ -114,7 +114,7 @@ class RuntimeDyldELF : public RuntimeDyldImpl {
uint64_t findGOTEntry(uint64_t LoadAddr, uint64_t Offset); uint64_t findGOTEntry(uint64_t LoadAddr, uint64_t Offset);
size_t getGOTEntrySize(); size_t getGOTEntrySize();
virtual void updateGOTEntries(StringRef Name, uint64_t Addr); void updateGOTEntries(StringRef Name, uint64_t Addr) override;
// Relocation entries for symbols whose position-independent offset is // Relocation entries for symbols whose position-independent offset is
// updated in a global offset table. // updated in a global offset table.
@ -132,20 +132,18 @@ public:
RuntimeDyldELF(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) RuntimeDyldELF(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm)
{} {}
virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value); void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
virtual void processRelocationRef(unsigned SectionID, void processRelocationRef(unsigned SectionID, RelocationRef RelI,
RelocationRef RelI, ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
ObjectImage &Obj,
ObjSectionToIDMap &ObjSectionToID,
const SymbolTableMap &Symbols, const SymbolTableMap &Symbols,
StubMap &Stubs); StubMap &Stubs) override;
virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const; bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
virtual bool isCompatibleFile(const object::ObjectFile *Buffer) const; bool isCompatibleFile(const object::ObjectFile *Buffer) const override;
virtual ObjectImage *createObjectImage(ObjectBuffer *InputBuffer); ObjectImage *createObjectImage(ObjectBuffer *InputBuffer) override;
virtual ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj); ObjectImage *createObjectImageFromFile(object::ObjectFile *Obj) override;
virtual void registerEHFrames(); void registerEHFrames() override;
virtual void deregisterEHFrames(); void deregisterEHFrames() override;
virtual void finalizeLoad(ObjSectionToIDMap &SectionMap); void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
virtual ~RuntimeDyldELF(); virtual ~RuntimeDyldELF();
}; };

View File

@ -55,7 +55,7 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
bool isPCRel, bool isPCRel,
unsigned Size); unsigned Size);
unsigned getMaxStubSize() { unsigned getMaxStubSize() override {
if (Arch == Triple::arm || Arch == Triple::thumb) if (Arch == Triple::arm || Arch == Triple::thumb)
return 8; // 32-bit instruction and 32-bit address return 8; // 32-bit instruction and 32-bit address
else if (Arch == Triple::x86_64) else if (Arch == Triple::x86_64)
@ -64,7 +64,7 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
return 0; return 0;
} }
unsigned getStubAlignment() { unsigned getStubAlignment() override {
return 1; return 1;
} }
@ -86,17 +86,15 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
public: public:
RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {} RuntimeDyldMachO(RTDyldMemoryManager *mm) : RuntimeDyldImpl(mm) {}
virtual void resolveRelocation(const RelocationEntry &RE, uint64_t Value); void resolveRelocation(const RelocationEntry &RE, uint64_t Value) override;
virtual void processRelocationRef(unsigned SectionID, void processRelocationRef(unsigned SectionID, RelocationRef RelI,
RelocationRef RelI, ObjectImage &Obj, ObjSectionToIDMap &ObjSectionToID,
ObjectImage &Obj,
ObjSectionToIDMap &ObjSectionToID,
const SymbolTableMap &Symbols, const SymbolTableMap &Symbols,
StubMap &Stubs); StubMap &Stubs) override;
virtual bool isCompatibleFormat(const ObjectBuffer *Buffer) const; bool isCompatibleFormat(const ObjectBuffer *Buffer) const override;
virtual bool isCompatibleFile(const object::ObjectFile *Obj) const; bool isCompatibleFile(const object::ObjectFile *Obj) const override;
virtual void registerEHFrames(); void registerEHFrames() override;
virtual void finalizeLoad(ObjSectionToIDMap &SectionMap); void finalizeLoad(ObjSectionToIDMap &SectionMap) override;
}; };
} // end namespace llvm } // end namespace llvm

View File

@ -643,75 +643,76 @@ namespace {
RecordStreamer(MCContext &Context) : MCStreamer(Context) {} RecordStreamer(MCContext &Context) : MCStreamer(Context) {}
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) { void EmitInstruction(const MCInst &Inst,
const MCSubtargetInfo &STI) override {
// Scan for values. // Scan for values.
for (unsigned i = Inst.getNumOperands(); i--; ) for (unsigned i = Inst.getNumOperands(); i--; )
if (Inst.getOperand(i).isExpr()) if (Inst.getOperand(i).isExpr())
AddValueSymbols(Inst.getOperand(i).getExpr()); AddValueSymbols(Inst.getOperand(i).getExpr());
} }
virtual void EmitLabel(MCSymbol *Symbol) { void EmitLabel(MCSymbol *Symbol) override {
Symbol->setSection(*getCurrentSection().first); Symbol->setSection(*getCurrentSection().first);
markDefined(*Symbol); markDefined(*Symbol);
} }
virtual void EmitDebugLabel(MCSymbol *Symbol) { void EmitDebugLabel(MCSymbol *Symbol) override {
EmitLabel(Symbol); EmitLabel(Symbol);
} }
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override {
// FIXME: should we handle aliases? // FIXME: should we handle aliases?
markDefined(*Symbol); markDefined(*Symbol);
} }
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) { bool EmitSymbolAttribute(MCSymbol *Symbol,
MCSymbolAttr Attribute) override {
if (Attribute == MCSA_Global) if (Attribute == MCSA_Global)
markGlobal(*Symbol); markGlobal(*Symbol);
return true; return true;
} }
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol, void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
uint64_t Size , unsigned ByteAlignment) { uint64_t Size , unsigned ByteAlignment) override {
markDefined(*Symbol); markDefined(*Symbol);
} }
virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) { unsigned ByteAlignment) override {
markDefined(*Symbol); markDefined(*Symbol);
} }
virtual void EmitBundleAlignMode(unsigned AlignPow2) {} void EmitBundleAlignMode(unsigned AlignPow2) override {}
virtual void EmitBundleLock(bool AlignToEnd) {} void EmitBundleLock(bool AlignToEnd) override {}
virtual void EmitBundleUnlock() {} void EmitBundleUnlock() override {}
// Noop calls. // Noop calls.
virtual void ChangeSection(const MCSection *Section, void ChangeSection(const MCSection *Section,
const MCExpr *Subsection) {} const MCExpr *Subsection) override {}
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {} void EmitAssemblerFlag(MCAssemblerFlag Flag) override {}
virtual void EmitThumbFunc(MCSymbol *Func) {} void EmitThumbFunc(MCSymbol *Func) override {}
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {} void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override {}
virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {} void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override {}
virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {} void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
virtual void EmitCOFFSymbolStorageClass(int StorageClass) {} void EmitCOFFSymbolStorageClass(int StorageClass) override {}
virtual void EmitCOFFSymbolType(int Type) {} void EmitCOFFSymbolType(int Type) override {}
virtual void EndCOFFSymbolDef() {} void EndCOFFSymbolDef() override {}
virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {} void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override {}
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) {} unsigned ByteAlignment) override {}
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol, void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
uint64_t Size, unsigned ByteAlignment) {} uint64_t Size, unsigned ByteAlignment) override {}
virtual void EmitBytes(StringRef Data) {} void EmitBytes(StringRef Data) override {}
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size) {} void EmitValueImpl(const MCExpr *Value, unsigned Size) override {}
virtual void EmitULEB128Value(const MCExpr *Value) {} void EmitULEB128Value(const MCExpr *Value) override {}
virtual void EmitSLEB128Value(const MCExpr *Value) {} void EmitSLEB128Value(const MCExpr *Value) override {}
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value, void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
unsigned ValueSize, unsigned ValueSize,
unsigned MaxBytesToEmit) {} unsigned MaxBytesToEmit) override {}
virtual void EmitCodeAlignment(unsigned ByteAlignment, void EmitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit) {} unsigned MaxBytesToEmit) override {}
virtual bool EmitValueToOffset(const MCExpr *Offset, bool EmitValueToOffset(const MCExpr *Offset,
unsigned char Value ) { return false; } unsigned char Value) override { return false; }
virtual void EmitFileDirective(StringRef Filename) {} void EmitFileDirective(StringRef Filename) override {}
virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta, void EmitDwarfAdvanceLineAddr(int64_t LineDelta, const MCSymbol *LastLabel,
const MCSymbol *LastLabel,
const MCSymbol *Label, const MCSymbol *Label,
unsigned PointerSize) {} unsigned PointerSize) override {}
virtual void FinishImpl() {} void FinishImpl() override {}
virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) { void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override {
RecordProcEnd(Frame); RecordProcEnd(Frame);
} }
}; };