Add a finishParse() callback to the targer asm parser

This callback is invoked when the parse has finished successfuly. It
will be used to write out ARM constant pools to implement the ldr
pseudo.

llvm-svn: 197706
This commit is contained in:
David Peixotto 2013-12-19 18:08:08 +00:00
parent a570b5adb5
commit 308e7e4367
2 changed files with 9 additions and 0 deletions

View File

@ -182,6 +182,11 @@ public:
return 0;
}
/// Allow a target to perform any actions after the parse completes
/// successfully. For example, to write out constant pools for ldr pseudo on
/// ARM.
virtual void finishParse() {};
virtual void onLabelParsed(MCSymbol *Symbol) { };
};

View File

@ -677,6 +677,10 @@ bool AsmParser::Run(bool NoInitialTextSection, bool NoFinalize) {
}
}
// Callback to the target parser in case it needs to do anything.
if (!HadError)
getTargetParser().finishParse();
// Finalize the output stream if there are no errors and if the client wants
// us to.
if (!HadError && !NoFinalize)