Have slang emit a warning on renderscript deprecation.

This CL modifies the slang compiler to emit a warning on renderscript
deprecation. The warning can be suppressed by supplying
"-Wno-deprecated-declarations".

Bug: 183116940
Test: m
Test: CtsRenderscriptTestCases
Test: CtsRsCppTestCases
Test: CtsRsBlasTestCases
Change-Id: Idfd79040b56d256f11c4ece4a34c593296b2bb89
diff --git a/llvm-rs-cc.cpp b/llvm-rs-cc.cpp
index a51e672..0c1143d 100644
--- a/llvm-rs-cc.cpp
+++ b/llvm-rs-cc.cpp
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 
+#include "clang/Basic/AllDiagnostics.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Driver/DriverDiagnostic.h"
 #include "clang/Driver/Options.h"
@@ -223,6 +224,14 @@
     return "detect_leaks=0";
 }
 
+static void emitDeprecationWarning(clang::DiagnosticsEngine *DiagEngine) {
+  DiagEngine->Report(clang::diag::warn_deprecated_message)
+      << "Renderscript"
+      << "Please refer to the migration guide "
+         "(https://developer.android.com/guide/topics/renderscript/migration-guide) "
+         "for the proposed alternatives.";
+}
+
 int main(int argc, const char **argv) {
   llvm::llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
   LLVMInitializeARMTargetInfo();
@@ -263,6 +272,7 @@
   (void)DiagEngine.setSeverityForGroup(clang::diag::Flavor::WarningOrError,
                                        "implicit-function-declaration",
                                        clang::diag::Severity::Error);
+  emitDeprecationWarning(&DiagEngine);
 
   // Report error if no input file
   if (Inputs.empty()) {