> > --------------------- include/llvm/Module.h --------------------------- > > class Module { > > public: > > typedef iplist<GlobalVariable> GlobalListType; > > typedef iplist<Function> FunctionListType; > > typedef iplist<GlobalAlias> AliasListType; > > > > Constant *getOrInsertFunction(StringRef Name, const FunctionType *T, > > AttrListPtr AttributeList); > > > > Constant *getOrInsertFunction(StringRef Name, const FunctionType *T); > > > > private: > > FunctionListType FunctionList; ///< The Functions in the module > > ----------------------------------------------------------------------- > > > > 对,就是这样,类似C++的class。 我想它就是 C++ 的 class。我不知道你為什會覺得它是 "类似C++的class"。 LLVM 基本是用 C++ 實現,但是捨棄一些 C++ 的特性不用,例如 RTTI。這有 它的考量在。[1] > C++还有隐式构造函数等等,llvm里面都是显式的。对C++的处理确实很难。 的確,寫好 C++ 不容易。閱讀 LLVM 代碼可以多學一點。XD [1] http://stackoverflow.com/questions/5134975/what-can-make-c-rtti-undesirable -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667