================
@@ -354,6 +359,57 @@ inline bool operator==(const SingleDeclTableKey &lhs,
return lhs.parentContextID == rhs.parentContextID && lhs.nameID ==
rhs.nameID;
}
+/// A stored C or C++ function declaration, represented by the ID of its parent
+/// context, the name of the declaration, and optional exact parameter types.
+constexpr uint8_t FunctionKeyHasParameterSelector = 0x01;
+constexpr unsigned FunctionTableKeyBaseLength =
+ sizeof(uint32_t) + sizeof(uint32_t) + sizeof(uint8_t) + sizeof(uint16_t);
+
+struct FunctionTableKey {
+ uint32_t parentContextID;
+ uint32_t nameID;
+ std::optional<llvm::SmallVector<IdentifierID, 2>> parameterTypeIDs;
+
+ FunctionTableKey() : parentContextID(-1), nameID(-1) {}
+
+ FunctionTableKey(uint32_t ParentContextID, uint32_t NameID)
+ : parentContextID(ParentContextID), nameID(NameID) {}
+
+ FunctionTableKey(uint32_t ParentContextID, uint32_t NameID,
+ llvm::SmallVector<IdentifierID, 2> ParameterTypeIDs)
----------------
Xazax-hun wrote:
Nit: in LLVM we often take `SmallVectorImpl<T>&` because that reference can
bind to SmallVectors with any inline buffer length.
https://github.com/llvm/llvm-project/pull/204147
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits