Add extra cflags for LLVM_NEXT

The staging compiler update sometimes needs additional cflags to build, but those flags may not be recognised by the current compiler. Add a
new `llvmNextExtraCommonGlobalCflags` section and only append those
flags when LLVM_NEXT is set.

Test: LLVM_NEXT=true m
Bug: 236798112
Change-Id: Icc4687950acd44798b2cf09131a425ddfd919214
diff --git a/cc/config/global.go b/cc/config/global.go
index c5fde55..6999089 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -280,6 +280,11 @@
 		"-Wno-string-concatenation",
 	}
 
+	llvmNextExtraCommonGlobalCflags = []string{
+		"-Wno-unqualified-std-cast-call",
+		"-Wno-deprecated-non-prototype",
+	}
+
 	IllegalFlags = []string{
 		"-w",
 	}
@@ -361,6 +366,11 @@
 		if ctx.Config().IsEnvTrue("USE_CCACHE") {
 			flags = append(flags, "-Wno-unused-command-line-argument")
 		}
+
+		if ctx.Config().IsEnvTrue("LLVM_NEXT") {
+			flags = append(flags, llvmNextExtraCommonGlobalCflags...)
+		}
+
 		return strings.Join(flags, " ")
 	})