Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/AttrImpl.cpp b/lib/AST/AttrImpl.cpp
index 3ca7d4d..cffcc65 100644
--- a/lib/AST/AttrImpl.cpp
+++ b/lib/AST/AttrImpl.cpp
@@ -19,4 +19,8 @@
 
 Attr::~Attr() { }
 
+void InheritableAttr::anchor() { }
+
+void InheritableParamAttr::anchor() { }
+
 #include "clang/AST/AttrImpl.inc"
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 305c41c..9028a09 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -624,6 +624,8 @@
   }
 }
 
+void NamedDecl::anchor() { }
+
 void NamedDecl::ClearLinkageCache() {
   // Note that we can't skip clearing the linkage of children just
   // because the parent doesn't have cached linkage:  we don't cache
@@ -2424,6 +2426,8 @@
 // EnumDecl Implementation
 //===----------------------------------------------------------------------===//
 
+void EnumDecl::anchor() { }
+
 EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC,
                            SourceLocation StartLoc, SourceLocation IdLoc,
                            IdentifierInfo *Id,
@@ -2587,10 +2591,14 @@
 // Other Decl Allocation/Deallocation Method Implementations
 //===----------------------------------------------------------------------===//
 
+void TranslationUnitDecl::anchor() { }
+
 TranslationUnitDecl *TranslationUnitDecl::Create(ASTContext &C) {
   return new (C) TranslationUnitDecl(C);
 }
 
+void LabelDecl::anchor() { }
+
 LabelDecl *LabelDecl::Create(ASTContext &C, DeclContext *DC,
                              SourceLocation IdentL, IdentifierInfo *II) {
   return new (C) LabelDecl(DC, IdentL, II, 0, IdentL);
@@ -2603,6 +2611,7 @@
   return new (C) LabelDecl(DC, IdentL, II, 0, GnuLabelL);
 }
 
+void NamespaceDecl::anchor() { }
 
 NamespaceDecl *NamespaceDecl::Create(ASTContext &C, DeclContext *DC,
                                      SourceLocation StartLoc,
@@ -2615,6 +2624,10 @@
                        NextNamespace.get(getASTContext().getExternalSource()));
 }
 
+void ValueDecl::anchor() { }
+
+void ImplicitParamDecl::anchor() { }
+
 ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
                                              SourceLocation IdLoc,
                                              IdentifierInfo *Id,
@@ -2649,6 +2662,8 @@
   return new (C) EnumConstantDecl(CD, L, Id, T, E, V);
 }
 
+void IndirectFieldDecl::anchor() { }
+
 IndirectFieldDecl *
 IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                           IdentifierInfo *Id, QualType T, NamedDecl **CH,
@@ -2663,12 +2678,16 @@
   return SourceRange(getLocation(), End);
 }
 
+void TypeDecl::anchor() { }
+
 TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
                                  SourceLocation StartLoc, SourceLocation IdLoc,
                                  IdentifierInfo *Id, TypeSourceInfo *TInfo) {
   return new (C) TypedefDecl(DC, StartLoc, IdLoc, Id, TInfo);
 }
 
+void TypedefNameDecl::anchor() { }
+
 TypeAliasDecl *TypeAliasDecl::Create(ASTContext &C, DeclContext *DC,
                                      SourceLocation StartLoc,
                                      SourceLocation IdLoc, IdentifierInfo *Id,
@@ -2692,6 +2711,8 @@
   return SourceRange(getLocStart(), RangeEnd);
 }
 
+void FileScopeAsmDecl::anchor() { }
+
 FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC,
                                            StringLiteral *Str,
                                            SourceLocation AsmLoc,
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index b86cf28..ddb61e5 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -28,6 +28,8 @@
 // Decl Allocation/Deallocation Method Implementations
 //===----------------------------------------------------------------------===//
 
+void AccessSpecDecl::anchor() { }
+
 CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D)
   : UserDeclaredConstructor(false), UserDeclaredCopyConstructor(false),
     UserDeclaredMoveConstructor(false), UserDeclaredCopyAssignment(false),
@@ -1155,6 +1157,8 @@
   return false;
 }
 
+void CXXMethodDecl::anchor() { }
+
 CXXMethodDecl *
 CXXMethodDecl::Create(ASTContext &C, CXXRecordDecl *RD,
                       SourceLocation StartLoc,
@@ -1404,6 +1408,8 @@
   return SourceRange(getSourceLocation(), getRParenLoc());
 }
 
+void CXXConstructorDecl::anchor() { }
+
 CXXConstructorDecl *
 CXXConstructorDecl::Create(ASTContext &C, EmptyShell Empty) {
   return new (C) CXXConstructorDecl(0, SourceLocation(), DeclarationNameInfo(),
@@ -1548,6 +1554,8 @@
   addOverriddenMethod(BaseCtor);
 }
 
+void CXXDestructorDecl::anchor() { }
+
 CXXDestructorDecl *
 CXXDestructorDecl::Create(ASTContext &C, EmptyShell Empty) {
   return new (C) CXXDestructorDecl(0, SourceLocation(), DeclarationNameInfo(),
@@ -1567,6 +1575,8 @@
                                    isImplicitlyDeclared);
 }
 
+void CXXConversionDecl::anchor() { }
+
 CXXConversionDecl *
 CXXConversionDecl::Create(ASTContext &C, EmptyShell Empty) {
   return new (C) CXXConversionDecl(0, SourceLocation(), DeclarationNameInfo(),
@@ -1589,6 +1599,8 @@
                                    EndLocation);
 }
 
+void LinkageSpecDecl::anchor() { }
+
 LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C,
                                          DeclContext *DC,
                                          SourceLocation ExternLoc,
@@ -1598,6 +1610,8 @@
   return new (C) LinkageSpecDecl(DC, ExternLoc, LangLoc, Lang, RBraceLoc);
 }
 
+void UsingDirectiveDecl::anchor() { }
+
 UsingDirectiveDecl *UsingDirectiveDecl::Create(ASTContext &C, DeclContext *DC,
                                                SourceLocation L,
                                                SourceLocation NamespaceLoc,
@@ -1618,6 +1632,8 @@
   return cast_or_null<NamespaceDecl>(NominatedNamespace);
 }
 
+void NamespaceAliasDecl::anchor() { }
+
 NamespaceAliasDecl *NamespaceAliasDecl::Create(ASTContext &C, DeclContext *DC,
                                                SourceLocation UsingLoc,
                                                SourceLocation AliasLoc,
@@ -1631,6 +1647,8 @@
                                     QualifierLoc, IdentLoc, Namespace);
 }
 
+void UsingShadowDecl::anchor() { }
+
 UsingDecl *UsingShadowDecl::getUsingDecl() const {
   const UsingShadowDecl *Shadow = this;
   while (const UsingShadowDecl *NextShadow =
@@ -1639,6 +1657,8 @@
   return cast<UsingDecl>(Shadow->UsingOrNextShadow);
 }
 
+void UsingDecl::anchor() { }
+
 void UsingDecl::addShadowDecl(UsingShadowDecl *S) {
   assert(std::find(shadow_begin(), shadow_end(), S) == shadow_end() &&
          "declaration already in set");
@@ -1676,6 +1696,8 @@
   return new (C) UsingDecl(DC, UL, QualifierLoc, NameInfo, IsTypeNameArg);
 }
 
+void UnresolvedUsingValueDecl::anchor() { }
+
 UnresolvedUsingValueDecl *
 UnresolvedUsingValueDecl::Create(ASTContext &C, DeclContext *DC,
                                  SourceLocation UsingLoc,
@@ -1685,6 +1707,8 @@
                                           QualifierLoc, NameInfo);
 }
 
+void UnresolvedUsingTypenameDecl::anchor() { }
+
 UnresolvedUsingTypenameDecl *
 UnresolvedUsingTypenameDecl::Create(ASTContext &C, DeclContext *DC,
                                     SourceLocation UsingLoc,
@@ -1697,6 +1721,8 @@
                                              TargetName.getAsIdentifierInfo());
 }
 
+void StaticAssertDecl::anchor() { }
+
 StaticAssertDecl *StaticAssertDecl::Create(ASTContext &C, DeclContext *DC,
                                            SourceLocation StaticAssertLoc,
                                            Expr *AssertExpr,
diff --git a/lib/AST/DeclFriend.cpp b/lib/AST/DeclFriend.cpp
index 99bfe40..e44333e 100644
--- a/lib/AST/DeclFriend.cpp
+++ b/lib/AST/DeclFriend.cpp
@@ -16,6 +16,8 @@
 #include "clang/AST/DeclTemplate.h"
 using namespace clang;
 
+void FriendDecl::anchor() { }
+
 FriendDecl *FriendDecl::Create(ASTContext &C, DeclContext *DC,
                                SourceLocation L,
                                FriendUnion Friend,
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 18be26d..2960b13 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -46,6 +46,8 @@
 // ObjCInterfaceDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCContainerDecl::anchor() { }
+
 /// getIvarDecl - This method looks up an ivar in this ContextDecl.
 ///
 ObjCIvarDecl *
@@ -147,6 +149,8 @@
   return 0;
 }
 
+void ObjCInterfaceDecl::anchor() { }
+
 /// FindPropertyVisibleInPrimaryClass - Finds declaration of the property
 /// with name 'PropertyId' in the primary class; including those in protocols
 /// (direct or indirect) used by the primary class.
@@ -876,6 +880,8 @@
 // ObjCIvarDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCIvarDecl::anchor() { }
+
 ObjCIvarDecl *ObjCIvarDecl::Create(ASTContext &C, ObjCContainerDecl *DC,
                                    SourceLocation StartLoc,
                                    SourceLocation IdLoc, IdentifierInfo *Id,
@@ -946,6 +952,8 @@
 // ObjCAtDefsFieldDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCAtDefsFieldDecl::anchor() { }
+
 ObjCAtDefsFieldDecl
 *ObjCAtDefsFieldDecl::Create(ASTContext &C, DeclContext *DC,
                              SourceLocation StartLoc,  SourceLocation IdLoc,
@@ -957,6 +965,8 @@
 // ObjCProtocolDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCProtocolDecl::anchor() { }
+
 ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C, DeclContext *DC,
                                            IdentifierInfo *Id,
                                            SourceLocation nameLoc,
@@ -1026,6 +1036,8 @@
 // ObjCForwardProtocolDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCForwardProtocolDecl::anchor() { }
+
 ObjCForwardProtocolDecl::
 ObjCForwardProtocolDecl(DeclContext *DC, SourceLocation L,
                         ObjCProtocolDecl *const *Elts, unsigned nElts,
@@ -1048,6 +1060,8 @@
 // ObjCCategoryDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCCategoryDecl::anchor() { }
+
 ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, DeclContext *DC,
                                            SourceLocation AtLoc, 
                                            SourceLocation ClassNameLoc,
@@ -1089,6 +1103,8 @@
 // ObjCCategoryImplDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCCategoryImplDecl::anchor() { }
+
 ObjCCategoryImplDecl *
 ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC,
                              IdentifierInfo *Id,
@@ -1108,6 +1124,8 @@
 }
 
 
+void ObjCImplDecl::anchor() { }
+
 void ObjCImplDecl::addPropertyImplementation(ObjCPropertyImplDecl *property) {
   // FIXME: The context should be correct before we get here.
   property->setLexicalDeclContext(this);
@@ -1170,6 +1188,8 @@
 // ObjCImplementationDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCImplementationDecl::anchor() { }
+
 ObjCImplementationDecl *
 ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC,
                                ObjCInterfaceDecl *ClassInterface,
@@ -1203,6 +1223,8 @@
 // ObjCCompatibleAliasDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCCompatibleAliasDecl::anchor() { }
+
 ObjCCompatibleAliasDecl *
 ObjCCompatibleAliasDecl::Create(ASTContext &C, DeclContext *DC,
                                 SourceLocation L,
@@ -1215,6 +1237,8 @@
 // ObjCPropertyDecl
 //===----------------------------------------------------------------------===//
 
+void ObjCPropertyDecl::anchor() { }
+
 ObjCPropertyDecl *ObjCPropertyDecl::Create(ASTContext &C, DeclContext *DC,
                                            SourceLocation L,
                                            IdentifierInfo *Id,
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index 558a4cc..a2d5a2d 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/lib/AST/DeclTemplate.cpp
@@ -537,6 +537,8 @@
 // TemplateTemplateParmDecl Method Implementations
 //===----------------------------------------------------------------------===//
 
+void TemplateTemplateParmDecl::anchor() { }
+
 TemplateTemplateParmDecl *
 TemplateTemplateParmDecl::Create(const ASTContext &C, DeclContext *DC,
                                  SourceLocation L, unsigned D, unsigned P,
@@ -582,6 +584,12 @@
 }
 
 //===----------------------------------------------------------------------===//
+// TemplateDecl Implementation
+//===----------------------------------------------------------------------===//
+
+void TemplateDecl::anchor() { }
+
+//===----------------------------------------------------------------------===//
 // ClassTemplateSpecializationDecl Implementation
 //===----------------------------------------------------------------------===//
 ClassTemplateSpecializationDecl::
@@ -682,6 +690,8 @@
 //===----------------------------------------------------------------------===//
 // ClassTemplatePartialSpecializationDecl Implementation
 //===----------------------------------------------------------------------===//
+void ClassTemplatePartialSpecializationDecl::anchor() { }
+
 ClassTemplatePartialSpecializationDecl::
 ClassTemplatePartialSpecializationDecl(ASTContext &Context, TagKind TK,
                                        DeclContext *DC,
@@ -749,6 +759,8 @@
 // FriendTemplateDecl Implementation
 //===----------------------------------------------------------------------===//
 
+void FriendTemplateDecl::anchor() { }
+
 FriendTemplateDecl *FriendTemplateDecl::Create(ASTContext &Context,
                                                DeclContext *DC,
                                                SourceLocation L,
@@ -796,3 +808,8 @@
   return CommonPtr;
 }
 
+//===----------------------------------------------------------------------===//
+// ClassScopeFunctionSpecializationDecl Implementation
+//===----------------------------------------------------------------------===//
+
+void ClassScopeFunctionSpecializationDecl::anchor() { }
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index 1bbf849..285d38c 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -1023,4 +1023,4 @@
   return TemplateArgument(Arguments, NumArguments);
 }
 
-
+void ArrayTypeTraitExpr::anchor() { }
diff --git a/lib/AST/Mangle.cpp b/lib/AST/Mangle.cpp
index 5cb8f47..68e0098 100644
--- a/lib/AST/Mangle.cpp
+++ b/lib/AST/Mangle.cpp
@@ -59,6 +59,8 @@
 
 }
 
+void MangleContext::anchor() { }
+
 void MangleContext::mangleGlobalBlock(const BlockDecl *BD,
                                       raw_ostream &Out) {
   Out << "__block_global_" << getBlockId(BD, false);