[clang] [APINotes] Upstream APINotesWriter (PR #65187)

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 1 15:49:53 PDT 2023


================
@@ -1200,5 +1235,128 @@ APINotesWriter::~APINotesWriter() = default;
 void APINotesWriter::writeToStream(llvm::raw_ostream &OS) {
   Implementation->writeToStream(OS);
 }
+
+ContextID APINotesWriter::addObjCContext(std::optional<ContextID> ParentCtxID,
+                                         StringRef Name, ContextKind Kind,
+                                         const ObjCContextInfo &Info,
+                                         VersionTuple SwiftVersion) {
+  IdentifierID NameID = Implementation->getIdentifier(Name);
+
+  uint32_t RawParentCtxID = ParentCtxID ? ParentCtxID->Value : -1;
+  ContextTableKey Key(RawParentCtxID, (uint8_t)Kind, NameID);
----------------
compnerd wrote:

```suggestion
  ContextTableKey Key(RawParentCtxID, static_cast<uint8_t>(Kind), NameID);
```

https://github.com/llvm/llvm-project/pull/65187


More information about the cfe-commits mailing list