[hellogcc] Re: Re: [投稿] LLVM Introduction - How to use JIT 2/3

  • From: 陳韋任 <chenwj@xxxxxxxxxxxxxx>
  • To: hellogcc@xxxxxxxxxxxxx
  • Date: Sat, 22 Oct 2011 22:05:33 +0800

> 补充一点。LLVM的PU是module而不是func。
> 可以牵强的说LLVM每次为一个func emit code,但是实际上module才是一个PU。
> 好像是再很多情况下一个module只包含一个func和一些其他类似与定义的东西,包含多个func的情况是什么呢?

  你是問什麼時候一個 Module 會包含多個 func 嗎?

Function *gcd =
      cast<Function>(M->getOrInsertFunction("gcd", ...)

  Module 的成員函式 getOrInsertFunction 可以在 Module 插入多個
func。這完全看程序員怎麼使用。

-- 
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667

Other related posts:

  • » [hellogcc] Re: Re: [投稿] LLVM Introduction - How to use JIT 2/3 - 陳韋任