Remove GCC checks
Clang is always used now, so we can remove all the GCC checks. Removing
GCC-specific configuration will happen in the next CL.
Test: m
Change-Id: I4835ecf6062159315d0dfb07b098e60bff033a8a
diff --git a/cc/builder.go b/cc/builder.go
index d1bc23f..d16efd0 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -242,7 +242,6 @@
aidlFlags string
rsFlags string
toolchain config.Toolchain
- clang bool
tidy bool
coverage bool
sAbiDump bool
@@ -290,7 +289,7 @@
objFiles := make(android.Paths, len(srcFiles))
var tidyFiles android.Paths
- if flags.tidy && flags.clang {
+ if flags.tidy {
tidyFiles = make(android.Paths, 0, len(srcFiles))
}
var coverageFiles android.Paths
@@ -333,19 +332,14 @@
}, " ")
var sAbiDumpFiles android.Paths
- if flags.sAbiDump && flags.clang {
+ if flags.sAbiDump {
sAbiDumpFiles = make(android.Paths, 0, len(srcFiles))
}
- if flags.clang {
- cflags += " ${config.NoOverrideClangGlobalCflags}"
- toolingCflags += " ${config.NoOverrideClangGlobalCflags}"
- cppflags += " ${config.NoOverrideClangGlobalCflags}"
- toolingCppflags += " ${config.NoOverrideClangGlobalCflags}"
- } else {
- cflags += " ${config.NoOverrideGlobalCflags}"
- cppflags += " ${config.NoOverrideGlobalCflags}"
- }
+ cflags += " ${config.NoOverrideClangGlobalCflags}"
+ toolingCflags += " ${config.NoOverrideClangGlobalCflags}"
+ cppflags += " ${config.NoOverrideClangGlobalCflags}"
+ toolingCppflags += " ${config.NoOverrideClangGlobalCflags}"
for i, srcFile := range srcFiles {
objFile := android.ObjPathWithExt(ctx, subdir, srcFile, "o")
@@ -385,23 +379,23 @@
var moduleCflags string
var moduleToolingCflags string
var ccCmd string
- tidy := flags.tidy && flags.clang
+ tidy := flags.tidy
coverage := flags.coverage
- dump := flags.sAbiDump && flags.clang
+ dump := flags.sAbiDump
switch srcFile.Ext() {
case ".S", ".s":
- ccCmd = "gcc"
+ ccCmd = "clang"
moduleCflags = asflags
tidy = false
coverage = false
dump = false
case ".c":
- ccCmd = "gcc"
+ ccCmd = "clang"
moduleCflags = cflags
moduleToolingCflags = toolingCflags
case ".cpp", ".cc", ".mm":
- ccCmd = "g++"
+ ccCmd = "clang++"
moduleCflags = cppflags
moduleToolingCflags = toolingCppflags
default:
@@ -409,24 +403,9 @@
continue
}
- if flags.clang {
- switch ccCmd {
- case "gcc":
- ccCmd = "clang"
- case "g++":
- ccCmd = "clang++"
- default:
- panic("unrecoginzied ccCmd")
- }
- }
-
ccDesc := ccCmd
- if flags.clang {
- ccCmd = "${config.ClangBin}/" + ccCmd
- } else {
- ccCmd = gccCmd(flags.toolchain, ccCmd)
- }
+ ccCmd = "${config.ClangBin}/" + ccCmd
var implicitOutputs android.WritablePaths
if coverage {
@@ -611,12 +590,7 @@
objFiles, sharedLibs, staticLibs, lateStaticLibs, wholeStaticLibs, deps android.Paths,
crtBegin, crtEnd android.OptionalPath, groupLate bool, flags builderFlags, outputFile android.WritablePath) {
- var ldCmd string
- if flags.clang {
- ldCmd = "${config.ClangBin}/clang++"
- } else {
- ldCmd = gccCmd(flags.toolchain, "g++")
- }
+ ldCmd := "${config.ClangBin}/clang++"
var libFlagsList []string
@@ -777,12 +751,7 @@
func TransformObjsToObj(ctx android.ModuleContext, objFiles android.Paths,
flags builderFlags, outputFile android.WritablePath) {
- var ldCmd string
- if flags.clang {
- ldCmd = "${config.ClangBin}/clang++"
- } else {
- ldCmd = gccCmd(flags.toolchain, "g++")
- }
+ ldCmd := "${config.ClangBin}/clang++"
ctx.Build(pctx, android.BuildParams{
Rule: partialLd,