PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.

While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.

llvm-svn: 132861
diff --git a/clang/test/CodeGenCXX/internal-linkage.cpp b/clang/test/CodeGenCXX/internal-linkage.cpp
index 39bce85..56cb810 100644
--- a/clang/test/CodeGenCXX/internal-linkage.cpp
+++ b/clang/test/CodeGenCXX/internal-linkage.cpp
@@ -54,3 +54,11 @@
     // CHECK: @extern_nonconst_xyzzy = global
     return &extern_nonconst_xyzzy;
 }
+
+// PR10120
+template <typename T> class klass {
+    virtual void f();
+};
+namespace { struct S; }
+void foo () { klass<S> x; }
+// CHECK: @_ZTV5klassIN12_GLOBAL__N_11SEE = internal unnamed_addr constant