Add GetElfImages() method to CompilerLLVM.

(cherry picked from commit 950fc6e6a6b568f0cf511c092bee3d31547dc857)

Change-Id: I1ded5909bae4d87ed05b2c192fcb2362eaa37461
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index 65d53b9..e02c913 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -225,6 +225,17 @@
 }
 
 
+std::vector<ElfImage> CompilerLLVM::GetElfImages() const {
+  std::vector<ElfImage> result;
+
+  for (size_t i = 0; i < cunits_.size(); ++i) {
+    result.push_back(cunits_[i]->GetElfImage());
+  }
+
+  return result;
+}
+
+
 CompiledMethod* CompilerLLVM::
 CompileDexMethod(OatCompilationUnit* oat_compilation_unit) {
   MutexLock GUARD(compiler_lock_);
@@ -362,6 +373,10 @@
   return compiler_llvm->GetMethodInvokeStubAddr(cm, method);
 }
 
+extern "C" std::vector<art::ElfImage> compilerLLVMGetElfImages(const art::Compiler& compiler) {
+  return ContextOf(compiler)->GetElfImages();
+}
+
 // Note: Using this function carefully!!! This is temporary solution, we will remove it.
 extern "C" art::MutexLock* compilerLLVMMutexLock(art::Compiler& compiler) {
   return new art::MutexLock(ContextOf(compiler)->compiler_lock_);