================
@@ -1298,6 +1298,48 @@ def CIR_CXXSpecialMemberAttr : AnyAttrOf<[
CIR_CXXAssignAttr
]>;
+//===----------------------------------------------------------------------===//
+// FuncInfoAttr
+//===----------------------------------------------------------------------===//
+
+def CIR_FuncInfoAttr : CIR_Attr<"FuncInfo", "func_info"> {
+ let summary = "Holds the source level identity of a function";
+ let description = [{
+ Carries facts about the source declaration a function was emitted from,
+ precomputed during CIRGen while the AST is available. Passes that want
+ to reason about what the source calls read this attribute instead of
+ the AST.
+
+ The `name` parameter holds the plain function name as written in the
+ source, without mangling, qualification, or template arguments.
+ Functions without a plain identifier, for example overloaded operators
+ and constructors, carry no attribute, and neither do static member
+ functions, so a free function and a static member with the same name
+ stay apart. The `in_std_namespace` parameter is true when the function
+ is declared directly in the `std` namespace, looking through inline
+ namespaces. For a member function the enclosing record decides. The
+ `instance_method` parameter is true for a member function that is not
+ static.
+
+ Example:
+ ```
+ #cir.func_info<name = "find", in_std_namespace = true>
----------------
erichkeane wrote:
I'm a bit concerned about this to be honest. `std::find` is one thing, but
does this differentiate between this and `std::__1::find` and `std::find`? The
problem here is that library implementations will often use aliases/using
declarations to do abi-compatible implementations of standard functions.
So I suspect strongly that this isn't nearly enough information for us.
https://github.com/llvm/llvm-project/pull/207261
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits