mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-14 03:26:08 +00:00
add target hooks for emitting random gunk before and after the function body.
llvm-svn: 94732
This commit is contained in:
parent
346af88396
commit
c968f4475e
@ -233,6 +233,14 @@ namespace llvm {
|
|||||||
assert(0 && "EmitInstruction not implemented");
|
assert(0 && "EmitInstruction not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// EmitFunctionBodyStart - Targets can override this to emit stuff before
|
||||||
|
/// the first basic block in the function.
|
||||||
|
virtual void EmitFunctionBodyStart() {}
|
||||||
|
|
||||||
|
/// EmitFunctionBodyEnd - Targets can override this to emit stuff after
|
||||||
|
/// the last basic block in the function.
|
||||||
|
virtual void EmitFunctionBodyEnd() {}
|
||||||
|
|
||||||
/// EmitConstantPool - Print to the current output stream assembly
|
/// EmitConstantPool - Print to the current output stream assembly
|
||||||
/// representations of the constants in the constant pool MCP. This is
|
/// representations of the constants in the constant pool MCP. This is
|
||||||
/// used to print out constants which have been "spilled to memory" by
|
/// used to print out constants which have been "spilled to memory" by
|
||||||
|
@ -344,6 +344,9 @@ void AsmPrinter::EmitFunctionEntryLabel() {
|
|||||||
/// EmitFunctionBody - This method emits the body and trailer for a
|
/// EmitFunctionBody - This method emits the body and trailer for a
|
||||||
/// function.
|
/// function.
|
||||||
void AsmPrinter::EmitFunctionBody() {
|
void AsmPrinter::EmitFunctionBody() {
|
||||||
|
// Emit target-specific gunk before the function body.
|
||||||
|
EmitFunctionBodyStart();
|
||||||
|
|
||||||
// Print out code for the function.
|
// Print out code for the function.
|
||||||
bool HasAnyRealCode = false;
|
bool HasAnyRealCode = false;
|
||||||
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
|
for (MachineFunction::const_iterator I = MF->begin(), E = MF->end();
|
||||||
@ -378,6 +381,9 @@ void AsmPrinter::EmitFunctionBody() {
|
|||||||
if (MAI->hasSubsectionsViaSymbols() && !HasAnyRealCode)
|
if (MAI->hasSubsectionsViaSymbols() && !HasAnyRealCode)
|
||||||
OutStreamer.EmitIntValue(0, 1, 0/*addrspace*/);
|
OutStreamer.EmitIntValue(0, 1, 0/*addrspace*/);
|
||||||
|
|
||||||
|
// Emit target-specific gunk after the function body.
|
||||||
|
EmitFunctionBodyEnd();
|
||||||
|
|
||||||
if (MAI->hasDotTypeDotSizeDirective())
|
if (MAI->hasDotTypeDotSizeDirective())
|
||||||
O << "\t.size\t" << *CurrentFnSym << ", .-" << *CurrentFnSym << '\n';
|
O << "\t.size\t" << *CurrentFnSym << ", .-" << *CurrentFnSym << '\n';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user