0

main.c

int main()
{
    return 0;
}

clang -S -emit-llvm main.c generates:

define dso_local i32 @main() #0 {
%1 = alloca i32, align 4          ; (why?)
store i32 0, i32* %1, align 4     ; (why?)
ret i32 0
}

why the first two lines? This also gets generated only for the main function. (Using clang-12 && LLVM-12)

Tony
  • 81
  • 9

0 Answers0