Give external linkage and mangling to lambdas inside inline variables and variable templates.

This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33

This reinstates r313827, reverted in r313856, with a fix for the 'out-of-bounds
enumeration value' ubsan error in that change.

llvm-svn: 313955
diff --git a/clang/lib/AST/Linkage.h b/clang/lib/AST/Linkage.h
index b577901..e6489c7 100644
--- a/clang/lib/AST/Linkage.h
+++ b/clang/lib/AST/Linkage.h
@@ -117,10 +117,12 @@
                        LVComputationKind computation);
 
   LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,
-                                         LVComputationKind computation);
+                                         LVComputationKind computation,
+                                         bool IgnoreVarTypeLinkage);
 
   LinkageInfo getLVForClassMember(const NamedDecl *D,
-                                  LVComputationKind computation);
+                                  LVComputationKind computation,
+                                  bool IgnoreVarTypeLinkage);
 
   LinkageInfo getLVForClosure(const DeclContext *DC, Decl *ContextDecl,
                               LVComputationKind computation);
@@ -135,7 +137,8 @@
 
 public:
   LinkageInfo computeLVForDecl(const NamedDecl *D,
-                               LVComputationKind computation);
+                               LVComputationKind computation,
+                               bool IgnoreVarTypeLinkage = false);
 
   LinkageInfo getLVForDecl(const NamedDecl *D, LVComputationKind computation);