According to https://llvm.org/docs/LangRef.html#functions
LLVM function definitions consist of the “define” keyword, an optional linkage type, an optional runtime preemption specifier, an optional visibility style, an optional DLL storage class, an optional calling convention, an optional unnamed_addr attribute, a return type, an optional parameter attribute for the return type…
So, return type, then parameter attribute for the return type.
But given:
int main() {
std::cout << "Hello, world!n";
return 0;
}
Clang emits:
define dso_local noundef i32 @main() #0 {
i32
is a return type and noundef
is a parameter attribute, but the latter is being placed before the former.
What am I missing?