llvm-project
d1dbd484 - [CIR] Generalize the special member attribute into func_info and add a callee resolver (#207261)

Commit
4 days ago
[CIR] Generalize the special member attribute into func_info and add a callee resolver (#207261) The `cxx_special_member` slot on `cir.func` becomes a general slot named `func_info`, so facts about a function that are not special member facts can join later without redesign. Nothing about the special member forms changes. The attribute stays the same union of the constructor, destructor, and assignment forms. Each form keeps its shape and its embedded record type, and the CXX ABI lowering still replaces that type with the converted one. The FuncOp helpers keep their names, so passes that read the special member facts do not change. The printed keyword on `cir.func` changes from `special_member` to `func_info`, so the old spelling no longer parses. The existing tests update their check lines with no other change. Calls gain a resolver named `resolveCallee` that returns the function a direct call targets, so a pass standing at a call can read the facts recorded on its callee. It returns null when the call is indirect, when the callee symbol does not resolve, and when the target is not a `cir.func`. A second form takes a symbol table collection so a pass can reuse its cached lookup. Both `cir.call` and `cir.try_call` get the resolver through one shared implementation, and a unit test drives all of these cases.
Author
Parents
Loading