Add GetCompilationUnit() to CompilerLLVM.

(cherry picked from commit f12475c0024534a17c0f007e1a8f8ac981932296)

Change-Id: I1579f8e93722e7098657becbb70117c9f6a109a1
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index d528615..48c6062 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -79,10 +79,11 @@
 }
 
 // The Guard to Shutdown LLVM
-//llvm::llvm_shutdown_obj llvm_guard;
-// TODO: We are commenting this line because this will cause SEGV.  This may
-// related to two possible reasons: (1) the order of the destruction of static
-// objects, and (2) dlopen/dlclose side-effect on static objects.
+// llvm::llvm_shutdown_obj llvm_guard;
+// TODO: We are commenting out this line because this will cause SEGV from
+// time to time.
+// Two reasons: (1) the order of the destruction of static objects, or
+//              (2) dlopen/dlclose side-effect on static objects.
 
 } // anonymous namespace
 
diff --git a/src/compiler_llvm/compiler_llvm.h b/src/compiler_llvm/compiler_llvm.h
index 7481c8c..562a1d2 100644
--- a/src/compiler_llvm/compiler_llvm.h
+++ b/src/compiler_llvm/compiler_llvm.h
@@ -68,6 +68,14 @@
     return insn_set_;
   }
 
+  size_t GetNumCompilationUnits() const {
+    return cunits_.size();
+  }
+
+  const CompilationUnit* GetCompilationUnit(size_t i) const {
+    return cunits_[i];
+  }
+
   void SetElfFileName(std::string const& filename) {
     elf_filename_ = filename;
   }