You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CIR][CodeGen] Refactor setExtraAttributesForFunc to better align with OG (#830)
Previously the body of `setExtraAttributesForFunc` corresponds to
`SetLLVMFunctionAttributesForDefinition`, but the callsite of it does
not reside at the right position. This PR rename it and adjust the calls
to it following OG CodeGen.
To be specific, `setExtraAttributesForFunc` is called right after the
initialization of `FuncOp`. But in OG CodeGen, the list of attributes is
constructed by several more functions: `SetLLVMFunctionAttributes` and
`SetLLVMFunctionAttributesForDefinition`.
This results in diff in attributes of function declarations, which is
reflected by the changes of test files. Apart from them, there is no
functional change. In other words, the two code path calling
`setCIRFunctionAttributesForDefinition` are tested by existing tests:
* Caller `buildGlobalFunctionDefinition`: tested by
`CIR/CodeGen/function-attrs.cpp`, ...
* Caller `codegenCXXStructor`: tested by
`CIR/CodeGen/delegating-ctor.cpp`, `defined-pure-virtual-func.cpp`, ...
0 commit comments