顯示具有 compiler 標籤的文章。 顯示所有文章
顯示具有 compiler 標籤的文章。 顯示所有文章

2021年4月24日 星期六

Calling Convention in LLVM (2)

Photo by John Gamell on Unsplash
Introduction

In the previous article, two files related to calling convention are introduced: <Arch>CallingConv.td and <Arch>ISelLowering.cpp. However, in <Arch>ISelLowering.cpp, we only discuss LowerFormalArguments(). The other two functions, LowerReturn() and LowerCall() would be discussed in this article and we still take the source code of Sparc architecture as an example.

2021年3月27日 星期六

Calling Convention in LLVM

Photo by Pavan Trikutam on Unsplash

Introduction

The calling convention is a specification which describes how parameters are passed to a function or how a return value is returned from a function. Different processor architectures may have different calling conventions. For example, in x86, function parameters would be put in the stack. In ARM, some of the function parameters would be put in the registers and the others would be put in the stack.