Allow const functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-05-09 03:27:41 +00:00
parent eccf8d05ee
commit e0e72177c0
2 changed files with 5 additions and 4 deletions

View File

@ -45,12 +45,12 @@ struct MachineCodeEmitter {
/// specifies the total size required by the stub. Stubs are not allowed to /// specifies the total size required by the stub. Stubs are not allowed to
/// have constant pools, the can only use the other emit* methods. /// have constant pools, the can only use the other emit* methods.
/// ///
virtual void startFunctionStub(Function &F, unsigned StubSize) {} virtual void startFunctionStub(const Function &F, unsigned StubSize) {}
/// finishFunctionStub - This callback is invoked to terminate a function /// finishFunctionStub - This callback is invoked to terminate a function
/// stub. /// stub.
/// ///
virtual void finishFunctionStub(Function &F) {} virtual void *finishFunctionStub(const Function &F) { return 0; }
/// emitByte - This callback is invoked when a byte needs to be written to the /// emitByte - This callback is invoked when a byte needs to be written to the
/// output stream. /// output stream.

View File

@ -22,11 +22,12 @@ namespace {
std::cout << "\n--- Basic Block: " << BB.getBasicBlock()->getName()<<"\n"; std::cout << "\n--- Basic Block: " << BB.getBasicBlock()->getName()<<"\n";
} }
void startFunctionStub(Function &F, unsigned StubSize) { void startFunctionStub(const Function &F, unsigned StubSize) {
std::cout << "\n--- Function stub for function: " << F.getName() << "\n"; std::cout << "\n--- Function stub for function: " << F.getName() << "\n";
} }
void finishFunctionStub(Function &F) { void *finishFunctionStub(const Function &F) {
std::cout << "\n"; std::cout << "\n";
return 0;
} }
void emitByte(unsigned char B) { void emitByte(unsigned char B) {