Use LINK_COMPONENTS to specify *components* to link against instead of
using USED_LIBS to specify *libraries* to link against.

llvm-svn: 30090
diff --git a/llvm/tools/bugpoint/Makefile b/llvm/tools/bugpoint/Makefile
index b713650..4c4aa0c 100644
--- a/llvm/tools/bugpoint/Makefile
+++ b/llvm/tools/bugpoint/Makefile
@@ -10,13 +10,8 @@
 
 TOOLNAME = bugpoint
 
-OPTLIBS  = LLVMTransforms.a LLVMInstrumentation.a
-ANALIBS  = LLVMDataStructure LLVMipa.a LLVMTarget.a 
-
-USEDLIBS = LLVMipo.a LLVMScalarOpts.a $(OPTLIBS) $(ANALIBS) LLVMAnalysis.a \
-	   LLVMTransformUtils.a \
-	   LLVMAsmParser.a LLVMLinker.a LLVMBCReader.a LLVMBCWriter.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS := bcreader bcwriter asmparser instrumentation scalaropts ipo \
+                   datastructure transforms linker
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/gccas/Makefile b/llvm/tools/gccas/Makefile
index 1f62ade..8664354 100644
--- a/llvm/tools/gccas/Makefile
+++ b/llvm/tools/gccas/Makefile
@@ -9,9 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = gccas
-USEDLIBS = LLVMAsmParser.a LLVMBCWriter.a LLVMTransforms.a LLVMipo.a LLVMipa.a \
-           LLVMScalarOpts.a LLVMAnalysis.a LLVMTarget.a LLVMTransformUtils.a \
-           LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = asmparser bcwriter scalaropts ipo ipa transforms
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/gccld/Makefile b/llvm/tools/gccld/Makefile
index 7638f7f..38261d9 100644
--- a/llvm/tools/gccld/Makefile
+++ b/llvm/tools/gccld/Makefile
@@ -10,10 +10,7 @@
 LEVEL = ../..
 
 TOOLNAME = gccld
-USEDLIBS = LLVMipo.a LLVMTransforms.a LLVMScalarOpts.a LLVMAnalysis.a \
-           LLVMipa.a LLVMTransformUtils.a LLVMTarget.a LLVMLinker.a \
-           LLVMArchive.a LLVMBCReader.a LLVMBCWriter.a \
-           LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = bcreader bcwriter ipo scalaropts ipa linker
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llc/Makefile b/llvm/tools/llc/Makefile
index 812e59a..847a175 100644
--- a/llvm/tools/llc/Makefile
+++ b/llvm/tools/llc/Makefile
@@ -13,24 +13,10 @@
 
 # Include this here so we can get the configuration of the targets
 # that have been configured for construction. We have to do this 
-# early so we can set up USEDLIBS properly before includeing Makefile.rules
+# early so we can set up LINK_COMPONENTS before including Makefile.rules
 include $(LEVEL)/Makefile.config
 
-USEDLIBS := $(addprefix LLVM,$(TARGETS_TO_BUILD)) \
-	LLVMTarget.a \
-	LLVMCodeGen.a \
-	LLVMSelectionDAG.a \
-	LLVMipa.a \
-	LLVMTransforms.a \
-	LLVMScalarOpts.a \
-	LLVMTransformUtils.a \
-	LLVMAnalysis.a \
-	LLVMBCReader.a \
-	LLVMBCWriter.a \
-	LLVMCore.a \
-	LLVMSupport.a \
-	LLVMbzip2.a \
-	LLVMSystem.a
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) bcreader
 
 include $(LLVM_SRC_ROOT)/Makefile.rules
 
diff --git a/llvm/tools/llvm-ar/Makefile b/llvm/tools/llvm-ar/Makefile
index 18da617..bf15167 100644
--- a/llvm/tools/llvm-ar/Makefile
+++ b/llvm/tools/llvm-ar/Makefile
@@ -9,8 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-ar
-USEDLIBS = LLVMArchive.a LLVMBCReader.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = archive bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-bcanalyzer/Makefile b/llvm/tools/llvm-bcanalyzer/Makefile
index b3acd01..65be921 100644
--- a/llvm/tools/llvm-bcanalyzer/Makefile
+++ b/llvm/tools/llvm-bcanalyzer/Makefile
@@ -9,7 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-bcanalyzer
-USEDLIBS = LLVMBCReader.a LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS := bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-db/Makefile b/llvm/tools/llvm-db/Makefile
index 3bf9d54..7c0d58a 100644
--- a/llvm/tools/llvm-db/Makefile
+++ b/llvm/tools/llvm-db/Makefile
@@ -9,8 +9,7 @@
 
 LEVEL = ../..
 TOOLNAME = llvm-db
-USEDLIBS = LLVMDebugger.a LLVMBCReader.a LLVMCore.a LLVMSupport.a \
-	  LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS := debugger bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-extract/Makefile b/llvm/tools/llvm-extract/Makefile
index 20a107c..8efe423 100644
--- a/llvm/tools/llvm-extract/Makefile
+++ b/llvm/tools/llvm-extract/Makefile
@@ -9,9 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-extract
-USEDLIBS = LLVMBCReader.a LLVMBCWriter.a LLVMTransforms.a LLVMipo.a \
-	   LLVMTarget.a LLVMAnalysis.a LLVMTransformUtils.a LLVMipa.a \
-           LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS := bcreader bcwriter ipo
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-ld/Makefile b/llvm/tools/llvm-ld/Makefile
index 636aea4..dc8bffb 100644
--- a/llvm/tools/llvm-ld/Makefile
+++ b/llvm/tools/llvm-ld/Makefile
@@ -10,10 +10,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-ld
-USEDLIBS = LLVMipo.a LLVMTransforms.a LLVMScalarOpts.a LLVMAnalysis.a \
-	   LLVMipa.a LLVMTransformUtils.a LLVMTarget.a LLVMLinker.a \
-	   LLVMArchive.a LLVMBCReader.a LLVMBCWriter.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = ipo scalaropts linker archive bcreader bcwriter
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-link/Makefile b/llvm/tools/llvm-link/Makefile
index 0663396..f976135 100644
--- a/llvm/tools/llvm-link/Makefile
+++ b/llvm/tools/llvm-link/Makefile
@@ -9,8 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-link
-USEDLIBS = LLVMLinker.a LLVMBCReader.a LLVMBCWriter.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = linker bcreader bcwriter
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-nm/Makefile b/llvm/tools/llvm-nm/Makefile
index c7502e2..5e18c4a 100644
--- a/llvm/tools/llvm-nm/Makefile
+++ b/llvm/tools/llvm-nm/Makefile
@@ -9,8 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-nm
-USEDLIBS = LLVMArchive.a LLVMBCReader.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = archive bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-prof/Makefile b/llvm/tools/llvm-prof/Makefile
index 9774f64..b745e65 100644
--- a/llvm/tools/llvm-prof/Makefile
+++ b/llvm/tools/llvm-prof/Makefile
@@ -9,8 +9,7 @@
 LEVEL = ../..
 
 TOOLNAME = llvm-prof
-USEDLIBS = LLVMAnalysis.a LLVMBCReader.a \
-           LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = bcreader analysis
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm-ranlib/Makefile b/llvm/tools/llvm-ranlib/Makefile
index 1379532..ca4d0ce 100644
--- a/llvm/tools/llvm-ranlib/Makefile
+++ b/llvm/tools/llvm-ranlib/Makefile
@@ -9,8 +9,7 @@
 
 LEVEL = ../..
 TOOLNAME = llvm-ranlib
-USEDLIBS = LLVMArchive.a LLVMBCReader.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = archive bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvm2cpp/Makefile b/llvm/tools/llvm2cpp/Makefile
index cc3169c..88db590 100644
--- a/llvm/tools/llvm2cpp/Makefile
+++ b/llvm/tools/llvm2cpp/Makefile
@@ -8,10 +8,9 @@
 ##===----------------------------------------------------------------------===##
 LEVEL = ../..
 TOOLNAME = llvm2cpp
-USEDLIBS = LLVMBCReader.a LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a
+LINK_COMPONENTS = bcreader
 REQUIRES_EH := 1
 
 include $(LEVEL)/Makefile.common
 
 CompileCommonOpts := $(filter-out -pedantic,$(CompileCommonOpts))
-CompileCommonOpts := $(filter-out -Wno-long-long,$(CompileCommonOpts))
diff --git a/llvm/tools/llvmc/Makefile b/llvm/tools/llvmc/Makefile
index 2ccf85a5..335ac59 100644
--- a/llvm/tools/llvmc/Makefile
+++ b/llvm/tools/llvmc/Makefile
@@ -8,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 LEVEL = ../..
 TOOLNAME = llvmc
-USEDLIBS = LLVMCore.a LLVMSupport.a LLVMSystem.a
+LINK_COMPONENTS = support system
 CONFIG_FILES = c cpp ll
 EXTRA_DIST = c cpp ll ConfigLexer.cpp.cvs ConfigLexer.l.cvs
 REQUIRES_EH := 1
diff --git a/llvm/tools/llvmc/llvmc.cpp b/llvm/tools/llvmc/llvmc.cpp
index f2e7c1f..3b22149 100644
--- a/llvm/tools/llvmc/llvmc.cpp
+++ b/llvm/tools/llvmc/llvmc.cpp
@@ -295,7 +295,6 @@
     if (KeepTemps)      flags |= CompilerDriver::KEEP_TEMPS_FLAG;
     if (ShowStats)      flags |= CompilerDriver::SHOW_STATS_FLAG;
     if (TimeActions)    flags |= CompilerDriver::TIME_ACTIONS_FLAG;
-    if (TimePassesIsEnabled) flags |= CompilerDriver::TIME_PASSES_FLAG;
     if (StripOutput)    flags |= CompilerDriver::STRIP_OUTPUT_FLAG;
     CD->setDriverFlags(flags);
 
diff --git a/llvm/tools/lto/Makefile b/llvm/tools/lto/Makefile
index c2daead..c7befa4 100644
--- a/llvm/tools/lto/Makefile
+++ b/llvm/tools/lto/Makefile
@@ -17,14 +17,10 @@
 
 # Include this here so we can get the configuration of the targets
 # that have been configured for construction. We have to do this 
-# early so we can set up USEDLIBS properly before includeing Makefile.rules
+# early so we can set up LINK_COMPONENTS before includeing Makefile.rules
 include $(LEVEL)/Makefile.config
 
-USEDLIBS := $(addprefix LLVM,$(TARGETS_TO_BUILD)) \
-	LLVMSelectionDAG.a LLVMCodeGen.a LLVMipo.a LLVMTransforms.a \
-	LLVMScalarOpts.a LLVMipa.a LLVMTransformUtils.a LLVMAnalysis.a \
-	LLVMTarget.a LLVMBCReader.a LLVMBCWriter.a LLVMSystem.a LLVMLinker.a \
-	LLVMCore.a LLVMSupport.a LLVMbzip2.a
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) ipo scalaropts bcreader bcwriter
 
 include $(LEVEL)/Makefile.common
 
diff --git a/llvm/tools/opt/Makefile b/llvm/tools/opt/Makefile
index 4bb9ed5..787136e 100644
--- a/llvm/tools/opt/Makefile
+++ b/llvm/tools/opt/Makefile
@@ -10,9 +10,7 @@
 TOOLNAME = opt
 REQUIRES_EH := 1
 
-USEDLIBS = LLVMBCReader.a LLVMBCWriter.a LLVMInstrumentation.a \
-	   LLVMScalarOpts.a LLVMipo.a LLVMipa.a LLVMDataStructure \
-	   LLVMTransforms.a LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a \
-	   LLVMCore.a LLVMSupport.a LLVMbzip2.a LLVMSystem.a 
+LINK_COMPONENTS := bcreader bcwriter instrumentation scalaropts ipo \
+                   datastructure transforms
 
 include $(LEVEL)/Makefile.common