From 2274c71150ba70116a456578394755e9e692d78b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 9 May 2003 03:27:41 +0000 Subject: [PATCH] Allow const functions llvm-svn: 6056 --- llvm/include/llvm/CodeGen/MachineCodeEmitter.h | 4 ++-- llvm/lib/CodeGen/MachineCodeEmitter.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h index d3e2414f1559..5c4802eacdc8 100644 --- a/llvm/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/llvm/include/llvm/CodeGen/MachineCodeEmitter.h @@ -45,12 +45,12 @@ struct MachineCodeEmitter { /// specifies the total size required by the stub. Stubs are not allowed to /// 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 /// 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 /// output stream. diff --git a/llvm/lib/CodeGen/MachineCodeEmitter.cpp b/llvm/lib/CodeGen/MachineCodeEmitter.cpp index 270a7b903899..d91efe2cc1b5 100644 --- a/llvm/lib/CodeGen/MachineCodeEmitter.cpp +++ b/llvm/lib/CodeGen/MachineCodeEmitter.cpp @@ -22,11 +22,12 @@ namespace { 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"; } - void finishFunctionStub(Function &F) { + void *finishFunctionStub(const Function &F) { std::cout << "\n"; + return 0; } void emitByte(unsigned char B) {