[clang] e5a7d27 - [NFC][clang][extract-api] Add missing virtual anchors

Zixu Wang via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 24 15:05:20 PDT 2022


Author: Zixu Wang
Date: 2022-03-24T14:30:14-07:00
New Revision: e5a7d272ab04aef47bf9ae5a34ca34878353197c

URL: https://github.com/llvm/llvm-project/commit/e5a7d272ab04aef47bf9ae5a34ca34878353197c
DIFF: https://github.com/llvm/llvm-project/commit/e5a7d272ab04aef47bf9ae5a34ca34878353197c.diff

LOG: [NFC][clang][extract-api] Add missing virtual anchors

Add missing virtual method anchors for structs in ExtractAPI/API.h

Added: 
    

Modified: 
    clang/include/clang/ExtractAPI/API.h
    clang/lib/ExtractAPI/API.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/ExtractAPI/API.h b/clang/include/clang/ExtractAPI/API.h
index beedda6464438..eb72450f87d23 100644
--- a/clang/include/clang/ExtractAPI/API.h
+++ b/clang/include/clang/ExtractAPI/API.h
@@ -142,6 +142,9 @@ struct EnumConstantRecord : APIRecord {
   static bool classof(const APIRecord *Record) {
     return Record->getKind() == RK_EnumConstant;
   }
+
+private:
+  virtual void anchor();
 };
 
 /// This holds information associated with enums.
@@ -157,6 +160,9 @@ struct EnumRecord : APIRecord {
   static bool classof(const APIRecord *Record) {
     return Record->getKind() == RK_Enum;
   }
+
+private:
+  virtual void anchor();
 };
 
 /// This holds information associated with struct fields.
@@ -171,6 +177,9 @@ struct StructFieldRecord : APIRecord {
   static bool classof(const APIRecord *Record) {
     return Record->getKind() == RK_StructField;
   }
+
+private:
+  virtual void anchor();
 };
 
 /// This holds information associated with structs.
@@ -187,6 +196,9 @@ struct StructRecord : APIRecord {
   static bool classof(const APIRecord *Record) {
     return Record->getKind() == RK_Struct;
   }
+
+private:
+  virtual void anchor();
 };
 
 /// APISet holds the set of API records collected from given inputs.

diff  --git a/clang/lib/ExtractAPI/API.cpp b/clang/lib/ExtractAPI/API.cpp
index 6b60d2c2a1b42..92c4e0ea48383 100644
--- a/clang/lib/ExtractAPI/API.cpp
+++ b/clang/lib/ExtractAPI/API.cpp
@@ -131,3 +131,7 @@ StringRef APISet::copyString(StringRef String) {
 APIRecord::~APIRecord() {}
 
 void GlobalRecord::anchor() {}
+void EnumConstantRecord::anchor() {}
+void EnumRecord::anchor() {}
+void StructFieldRecord::anchor() {}
+void StructRecord::anchor() {}


        


More information about the cfe-commits mailing list