Initial version of debug info pass for RS.

This introduces a new LLVM pass into libbcc called
RSAddDebugInfoPass. Its purpose is to add debug information metadata
to LLVM constructs generated by the other parts of libbcc. The
generated code generally lacks sufficient debugging information as it
has not been processed by the clang-based front-end.

The initial version of RSAddDebugInfoPass provides the following:
1. It annotates the expanded function generated by RSExpandKernel pass
   with debug information, stating the name of the function and
   source file indicating that the function has been generated.
2. It annotates the instructions of the *.expand function with
   filename/line indicating that the function code has been generated.

The source file of both the generated function definition and
the instructions that make up the function is mapped to the source
location of /opt/renderscriptdebugger/1/generated.rs:1. That might be
source-mapped by the debugger to an appropriate file in the SDK, the
contents of which clearly indicate that the user is dealing with
generated code (i.e. one without a "physical" source file).

Change-Id: I2e566160a448d7bfbb3f8d16680e09e43c845693
diff --git a/include/bcc/Compiler.h b/include/bcc/Compiler.h
index 8a30c38..a0925b8 100644
--- a/include/bcc/Compiler.h
+++ b/include/bcc/Compiler.h
@@ -82,6 +82,7 @@
 
   bool addInternalizeSymbolsPass(Script &pScript, llvm::legacy::PassManager &pPM);
   void addExpandKernelPass(llvm::legacy::PassManager &pPM);
+  void addDebugInfoPass(Script &pScript, llvm::legacy::PassManager &pPM);
   void addGlobalInfoPass(Script &pScript, llvm::legacy::PassManager &pPM);
   void addInvariantPass(llvm::legacy::PassManager &pPM);
   void addInvokeHelperPass(llvm::legacy::PassManager &pPM);
diff --git a/include/bcc/Renderscript/RSTransforms.h b/include/bcc/Renderscript/RSTransforms.h
index 6dcfedd..3c81860 100644
--- a/include/bcc/Renderscript/RSTransforms.h
+++ b/include/bcc/Renderscript/RSTransforms.h
@@ -43,6 +43,8 @@
 
 llvm::ModulePass * createRSX86_64CallConvPass();
 
+llvm::ModulePass * createRSAddDebugInfoPass();
+
 } // end namespace bcc
 
 #endif // BCC_RS_TRANSFORMS_H
diff --git a/include/bcc/Source.h b/include/bcc/Source.h
index 54263a2..e6bef2e 100644
--- a/include/bcc/Source.h
+++ b/include/bcc/Source.h
@@ -82,6 +82,10 @@
 
   void addBuildChecksumMetadata(const char *) const;
 
+  // Get whether debugging has been enabled for this module by checking
+  // for presence of debug info in the module.
+  bool getDebugInfoEnabled() const;
+
   ~Source();
 };