On Sat, Oct 22, 2011 at 10:05 PM, ???f任 <chenwj@xxxxxxxxxxxxxx> wrote: >> 补充一点。LLVM的PU是module而不是func。 >> 可以牵强的说LLVM每次为一个func emit code,但是实际上module才是一个PU。 >> 好像是再很多情况下一个module只包含一个func和一些其他类似与定义的东西,包含多个func的情况是什么呢? > > 你是??什?N?r候一?? Module ??包含多?? func ??? > > Function *gcd = > cast<Function>(M->getOrInsertFunction("gcd", ...) > > Module 的成?T函式 getOrInsertFunction 可以在 Module 插入多?? > func。?@完全看程序?T怎?N使用。 > 恩,确实是可以这么写。 对应高级语言,module是对应C++的class的吧,其实是class的子集,是这样么?一个class有多个func,生成一个含有多个func的module。这个我也没有搞的十分明白。 > -- > Wei-Ren Chen (???f任) > Computer Systems Lab, Institute of Information Science, > Academia Sinica, Taiwan (R.O.C.) > Tel:886-2-2788-3799 #1667 > >