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

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

> 对应高级语言,module是对应C++的class的吧,其实是class的子集,是这样么?一个class有多个func,生成一个含有多个func的module。这个我也没有搞的十分明白。

  題外話。我原本以為你是問 C++ class 在 LLVM 中是怎麼實現的。

------- example.cpp ------
class A {
public:
  A(int i) : _i(i) {}
  int _i;
};

int main() {
  A a(1);
}
--------------------------

  把代碼丟上 http://llvm.org/demo/index.cgi。;

  - Source language 選 C++
  - Optimization level 選 None
  - Target 選 LLVM Assembly

  點 Compile Source Code。底下可以看到 LLVM 怎麼實現 C++ class。

-- 
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: