Introduce stubs for long-vector support (#638)

* Ensure DeclVisitor and IsSupportedType fully recurse

Add test cases covering errors on long-vector types.

Ensure all the children of clang::Decl are visited by implementing more
specific methods of RecursiveASTVisitor.

Update IsSupportedType to cover additional cases and to abort on type
not explicitly covered.

* Add stubs for lowering long-vector types

Add a new, experimental command line option, --long-vector, to turn on
support for lowering long-vector types which is implemented by
LongVectorLoweringPass. For now, this pass does nothing; subsequent
commits will gradually bring in new features.

When this option is provided, accept long-vector types except when used
as kernel parameters. This feature is intentionally left unsupported for
now and should be revisited when there is definite proof that kernel
parameters can be safely lowered as well.

Add tests covering the frontend changes.

Introduce CustomDiagnosticUnsupportedKernelArgs. Remove explicit
diagnostic ID and rely on C++ to generate appropriate values for the
CustomDiagnosticType enumeration.

Update options.ll test to ensure it can be used with clspv-opt.

Signed-off-by: Marco Antognini <marco.antognini@arm.com>
diff --git a/lib/Compiler.cpp b/lib/Compiler.cpp
index 4e805d7..705b2a6 100644
--- a/lib/Compiler.cpp
+++ b/lib/Compiler.cpp
@@ -608,6 +608,13 @@
   }
   pm->add(clspv::createReplaceOpenCLBuiltinPass());
 
+  // Lower longer vectors when requested. Note that this pass depends on
+  // ReplaceOpenCLBuiltinPass and expects DeadCodeEliminationPass to be run
+  // afterwards.
+  if (clspv::Option::LongVectorSupport()) {
+    pm->add(clspv::createLongVectorLoweringPass());
+  }
+
   // We need to run mem2reg and inst combine early because our
   // createInlineFuncWithPointerBitCastArgPass pass cannot handle the pattern
   //   %1 = alloca i32 1