Revert "Revert "Handle kernel launch calls""

Bug: 23535985

This reverts commit 5d9263d3a3a7457b9e5fe6e518c0d822dcdfcda6.

This also fixes issues in change list 172074, which caused some
slang tests to fail due to changed hehavior in error handling.

The fix was based on changes originally posted by srhines@.

To keep single-source functionality working, I separated kernel
name logging from the final export processing code. We would
build a map from kernel funciton names to slot numbers as we parse
the script. The map is used when translating a rsParallelFor call
to a call to the internal rsForEachInternal API, so that we can find
the proper slot numbers.

Here is Steve's original commit message.

Only call processExports() after a successful C99 compilation.

This refactoring fixes a bug in the previous single-source patch, where
exported functions/variables/kernels were being processed during the
regular compilation steps. This wastes compile time, since we don't need
to actually prepare for outputting reflected Java/C++ code if the
compile is going to fail for regular C99 reasons.

Change-Id: I81d88731188f4258f12f4c90ae8dd8abc8c2d641
diff --git a/Android.mk b/Android.mk
index e2b991d..3f56193 100644
--- a/Android.mk
+++ b/Android.mk
@@ -148,6 +148,7 @@
 LOCAL_SRC_FILES :=	\
 	llvm-rs-cc.cpp	\
 	rs_cc_options.cpp \
+	slang_rs_foreach_lowering.cpp \
 	slang_rs_ast_replace.cpp	\
 	slang_rs_check_ast.cpp	\
 	slang_rs_context.cpp	\