Update aosp/master Clang for rebase to r275480
Bug: http://b/31320715
This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.
Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)
Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
diff --git a/compiler_wrapper b/compiler_wrapper
new file mode 100755
index 0000000..2091f1d
--- /dev/null
+++ b/compiler_wrapper
@@ -0,0 +1,31 @@
+#!/usr/bin/python
+
+import os
+import sys
+
+flags_to_append = []
+flags_to_insert = []
+
+myargs = sys.argv[1:]
+
+myargs = flags_to_insert + myargs + flags_to_append
+
+real_compiler = sys.argv[0] + '.real'
+argv0 = real_compiler
+
+def get_gomacc_command():
+ """Return the gomacc command if it is found in $GOMACC_PATH."""
+ gomacc = os.environ.get('GOMACC_PATH')
+ if gomacc and os.path.isfile(gomacc):
+ return gomacc
+ return None
+
+execargs = []
+gomacc = get_gomacc_command()
+if gomacc:
+ argv0 = gomacc
+ execargs += [gomacc]
+
+execargs += [real_compiler] + myargs
+
+os.execv(argv0, execargs)