Make sure lli compiles all code before invalidating instruction caches.
authorTim Northover <Tim.Northover@arm.com>
Thu, 20 Sep 2012 08:46:30 +0000 (08:46 +0000)
committerTim Northover <Tim.Northover@arm.com>
Thu, 20 Sep 2012 08:46:30 +0000 (08:46 +0000)
Patch from Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164296 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lli/lli.cpp

index 4004b6c4d408cabf04725356a108f9d9d848955a..c5645ec6015f632099f583930ee0994b948e648a 100644 (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();