[PM] Add pass run listeners to the pass manager.
authorJuergen Ributzka <juergen@apple.com>
Mon, 28 Apr 2014 18:19:25 +0000 (18:19 +0000)
committerJuergen Ributzka <juergen@apple.com>
Mon, 28 Apr 2014 18:19:25 +0000 (18:19 +0000)
commit4e0cc51d7974029aa2bbffce08e2c878f529f98a
treee4a77f03d3c3cce1cf840ca93491a4d4244d2222
parentc430d3ffcde596bad10e1d089cfd15ba8d915204
[PM] Add pass run listeners to the pass manager.

This commit provides the necessary C/C++ APIs and infastructure to enable fine-
grain progress report and safe suspension points after each pass in the pass
manager.

Clients can provide a callback function to the pass manager to call after each
pass. This can be used in a variety of ways (progress report, dumping of IR
between passes, safe suspension of threads, etc).

The run listener list is maintained in the LLVMContext, which allows a multi-
threaded client to be only informed for it's own thread. This of course assumes
that the client created a LLVMContext for each thread.

This fixes <rdar://problem/16728690>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207430 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/Core.h
include/llvm/IR/LLVMContext.h
include/llvm/Pass.h
include/llvm/PassSupport.h
lib/IR/Core.cpp
lib/IR/LLVMContext.cpp
lib/IR/LLVMContextImpl.cpp
lib/IR/LLVMContextImpl.h
lib/IR/LegacyPassManager.cpp
lib/IR/Pass.cpp
unittests/ExecutionEngine/MCJIT/MCJITCAPITest.cpp