Make sure lli compiles all code before invalidating instruction caches.

Patch from Amara Emerson.

llvm-svn: 164296
This commit is contained in:
Tim Northover 2012-09-20 08:46:30 +00:00
parent 4aa6a010d2
commit 572d0698d2
1 changed files with 3 additions and 0 deletions

View File

@ -656,6 +656,9 @@ int main(int argc, char **argv, char * const *envp) {
Target.stop();
} else {
// Trigger compilation separately so code regions that need to be
// invalidated will be known.
(void)EE->getPointerToFunction(EntryFn);
// Clear instruction cache before code will be executed.
if (JMM)
static_cast<LLIMCJITMemoryManager*>(JMM)->invalidateInstructionCache();