Re-implement clspv-opt as a standalone driver (#346)

* Fix #307 and #322.

This re-implements clspv-opt as a standalone driver.  The initial
implementation used the plugin facility for LLVM opt, but this is
difficult to implement in Windows (#307).

The driver only supports LLVM scalar transformations and all of clspv
transformations.  To do this, passes must be declared using LLVM's
INITIALIZE_PASS macro.  Additionally, the function
initializeClspvPasses() must include a call to the initialize*()
function generated by INITIALIZE_PASS.

This change also adds tests for all the existing passes in clspv.  It
does not check for specific transformations.  It checks that the flags
are accepted by clspv-opt.

Finally, this change reduces the build time for LLVM by building no
target backends by default.
diff --git a/lib/Passes.cpp b/lib/Passes.cpp
new file mode 100644
index 0000000..eef6501
--- /dev/null
+++ b/lib/Passes.cpp
@@ -0,0 +1,55 @@
+// Copyright 2019 The Clspv Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "Passes.h"
+
+namespace llvm {
+
+void initializeClspvPasses(PassRegistry &r) {
+  initializeAllocateDescriptorsPassPass(r);
+  initializeClusterModuleScopeConstantVarsPass(r);
+  initializeClusterPodKernelArgumentsPassPass(r);
+  initializeDirectResourceAccessPassPass(r);
+  initializeDefineOpenCLWorkItemBuiltinsPassPass(r);
+  initializeFunctionInternalizerPassPass(r);
+  initializeHideConstantLoadsPassPass(r);
+  initializeUnhideConstantLoadsPassPass(r);
+  initializeInlineEntryPointsPassPass(r);
+  initializeInlineFuncWithPointerBitCastArgPassPass(r);
+  initializeInlineFuncWithPointerToFunctionArgPassPass(r);
+  initializeInlineFuncWithSingleCallSitePassPass(r);
+  initializeOpenCLInlinerPassPass(r);
+  initializeRemoveUnusedArgumentsPass(r);
+  initializeReorderBasicBlocksPassPass(r);
+  initializeReplaceLLVMIntrinsicsPassPass(r);
+  initializeReplaceOpenCLBuiltinPassPass(r);
+  initializeReplacePointerBitcastPassPass(r);
+  initializeRewriteInsertsPassPass(r);
+  initializeScalarizePassPass(r);
+  initializeShareModuleScopeVariablesPassPass(r);
+  initializeSignedCompareFixupPassPass(r);
+  initializeSimplifyPointerBitcastPassPass(r);
+  initializeSplatArgPassPass(r);
+  initializeSplatSelectConditionPassPass(r);
+  initializeUBOTypeTransformPassPass(r);
+  initializeUndoBoolPassPass(r);
+  initializeUndoByvalPassPass(r);
+  initializeUndoGetElementPtrConstantExprPassPass(r);
+  initializeUndoSRetPassPass(r);
+  initializeUndoTranslateSamplerFoldPassPass(r);
+  initializeUndoTruncatedSwitchConditionPassPass(r);
+  initializeZeroInitializeAllocasPassPass(r);
+}
+
+} // namespace llvm