summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-12-02 02:42:07 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-12-02 02:42:07 +0000
commit2003d39f7c929a02120e530b21ab84718cc945db (patch)
tree7da55010cc8eb0239ed85681aa1a31fe1b1108cd
parenta91d38a435431672404a65030f6b5896e4564d0e (diff)
downloadbcm5719-llvm-2003d39f7c929a02120e530b21ab84718cc945db.tar.gz
bcm5719-llvm-2003d39f7c929a02120e530b21ab84718cc945db.zip
build: Add ModuleName per-subdir variable as a way to organize the different
sets of functions/objects into high level groups. Currently we have "builtins" (the main compiler-rt code), "profile", and "asan". - Use this to define CommonFunctions and ArchFunctions to only reference the builtins functions. llvm-svn: 145674
-rw-r--r--compiler-rt/lib/Makefile.mk1
-rw-r--r--compiler-rt/lib/arm/Makefile.mk1
-rw-r--r--compiler-rt/lib/asan/Makefile.mk1
-rw-r--r--compiler-rt/lib/asan/mach_override/Makefile.mk1
-rw-r--r--compiler-rt/lib/asan/sysinfo/Makefile.mk1
-rw-r--r--compiler-rt/lib/i386/Makefile.mk1
-rw-r--r--compiler-rt/lib/ppc/Makefile.mk1
-rw-r--r--compiler-rt/lib/profile/Makefile.mk1
-rw-r--r--compiler-rt/lib/x86_64/Makefile.mk1
-rw-r--r--compiler-rt/make/lib_info.mk12
-rw-r--r--compiler-rt/make/subdir.mk3
11 files changed, 21 insertions, 3 deletions
diff --git a/compiler-rt/lib/Makefile.mk b/compiler-rt/lib/Makefile.mk
index 4a0c98a8210..8394af3a8ac 100644
--- a/compiler-rt/lib/Makefile.mk
+++ b/compiler-rt/lib/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := builtins
SubDirs :=
# Add arch specific optimized implementations.
diff --git a/compiler-rt/lib/arm/Makefile.mk b/compiler-rt/lib/arm/Makefile.mk
index cde97c3f99a..e7bbd7b615d 100644
--- a/compiler-rt/lib/arm/Makefile.mk
+++ b/compiler-rt/lib/arm/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := builtins
SubDirs :=
OnlyArchs := armv5 armv6 armv7
diff --git a/compiler-rt/lib/asan/Makefile.mk b/compiler-rt/lib/asan/Makefile.mk
index 3f61d4e6e98..4d9e58d6746 100644
--- a/compiler-rt/lib/asan/Makefile.mk
+++ b/compiler-rt/lib/asan/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := asan
SubDirs := mach_override sysinfo
Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
diff --git a/compiler-rt/lib/asan/mach_override/Makefile.mk b/compiler-rt/lib/asan/mach_override/Makefile.mk
index c99267dcae0..78be0b38397 100644
--- a/compiler-rt/lib/asan/mach_override/Makefile.mk
+++ b/compiler-rt/lib/asan/mach_override/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := asan
SubDirs :=
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
diff --git a/compiler-rt/lib/asan/sysinfo/Makefile.mk b/compiler-rt/lib/asan/sysinfo/Makefile.mk
index 082ae7b1738..bc4a2ffdc98 100644
--- a/compiler-rt/lib/asan/sysinfo/Makefile.mk
+++ b/compiler-rt/lib/asan/sysinfo/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := asan
SubDirs :=
Sources := $(foreach file,$(wildcard $(Dir)/*.cc),$(notdir $(file)))
diff --git a/compiler-rt/lib/i386/Makefile.mk b/compiler-rt/lib/i386/Makefile.mk
index 20f95e65148..1f5c680c08f 100644
--- a/compiler-rt/lib/i386/Makefile.mk
+++ b/compiler-rt/lib/i386/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := builtins
SubDirs :=
OnlyArchs := i386
diff --git a/compiler-rt/lib/ppc/Makefile.mk b/compiler-rt/lib/ppc/Makefile.mk
index 519d6546731..b78d3860c53 100644
--- a/compiler-rt/lib/ppc/Makefile.mk
+++ b/compiler-rt/lib/ppc/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := builtins
SubDirs :=
OnlyArchs := ppc
diff --git a/compiler-rt/lib/profile/Makefile.mk b/compiler-rt/lib/profile/Makefile.mk
index aca08bddfbf..7689c9a068c 100644
--- a/compiler-rt/lib/profile/Makefile.mk
+++ b/compiler-rt/lib/profile/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := profile
SubDirs :=
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
diff --git a/compiler-rt/lib/x86_64/Makefile.mk b/compiler-rt/lib/x86_64/Makefile.mk
index 09037b9fbc8..ee3f9ce8f14 100644
--- a/compiler-rt/lib/x86_64/Makefile.mk
+++ b/compiler-rt/lib/x86_64/Makefile.mk
@@ -7,6 +7,7 @@
#
#===------------------------------------------------------------------------===#
+ModuleName := builtins
SubDirs :=
OnlyArchs := x86_64
diff --git a/compiler-rt/make/lib_info.mk b/compiler-rt/make/lib_info.mk
index 095b1e8ab58..2e85f6402b2 100644
--- a/compiler-rt/make/lib_info.mk
+++ b/compiler-rt/make/lib_info.mk
@@ -14,6 +14,14 @@
# AvailableIn.<function> - The list of subdir keys where 'function' is
# defined.
+# Determine the set of available modules.
+AvailableModules := $(sort $(foreach key,$(SubDirKeys),\
+ $($(key).ModuleName)))
+
+# Build a per-module map of subdir keys.
+$(foreach key,$(SubDirKeys),\
+ $(call Append,ModuleSubDirKeys.$($(key).ModuleName),$(key)))
+
AvailableArchs := $(sort $(foreach key,$(SubDirKeys),\
$($(key).OnlyArchs)))
@@ -21,12 +29,12 @@ AvailableFunctions := $(sort $(foreach key,$(SubDirKeys),\
$(basename $($(key).ObjNames))))
CommonFunctions := $(sort\
- $(foreach key,$(SubDirKeys),\
+ $(foreach key,$(ModuleSubDirKeys.builtins),\
$(if $(call strneq,,$(strip $($(key).OnlyArchs) $($(key).OnlyConfigs))),,\
$(basename $($(key).ObjNames)))))
# Compute common arch functions.
-$(foreach key,$(SubDirKeys),\
+$(foreach key,$(ModuleSubDirKeys.builtins),\
$(if $(call strneq,,$($(key).OnlyConfigs)),,\
$(foreach arch,$($(key).OnlyArchs),\
$(call Append,ArchFunctions.$(arch),$(sort \
diff --git a/compiler-rt/make/subdir.mk b/compiler-rt/make/subdir.mk
index 900f7e6ab7b..5b3c1f0fb2d 100644
--- a/compiler-rt/make/subdir.mk
+++ b/compiler-rt/make/subdir.mk
@@ -20,7 +20,8 @@ endif
# The list of variables which are intended to be overridden in a subdirectory
# makefile.
-RequiredSubdirVariables := SubDirs ObjNames Implementation Dependencies
+RequiredSubdirVariables := \
+ ModuleName SubDirs ObjNames Implementation Dependencies
OptionalSubdirVariables := OnlyArchs OnlyConfigs
# Template: subdir_traverse_template subdir
OpenPOWER on IntegriCloud