I edit two files named test.h,test.cpp as follow: ///////////////test.h////////////////////////////////////////////////////////////////class TestClass { private: int fTotal; public: TestClass(); ~TestClass(); };///////////test.cpp/////////////////////////////////////////////////////////////////////////////#include "test.h" TestClass::TestClass() { fTotal = 2; } TestClass::~TestClass() { fTotal = 3; } int main() { TestClass short_name; return 0; } and I run: clang++ -c test.cpp -emit-llvm -o test.bc and lli test.bc, I get follow error: assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!"); How can I fix it? Thank you. p.s I try on llvm 2.9/3.0/3.1 and they all get that error, by the way I compile llvm used VS2010 on win7. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120823/7dcaa286/attachment.html>
You could put TestClass constructor and destructor function inside the class itself. Then it would work. But I'm not sure about the underlying reason for that. It may have something to do with the linkage type of different function defintions. Hope for others' advanced explanation :-) 2012/8/23 侯硕 <hoskylucky at 163.com>:> I edit two files named test.h,test.cpp as follow: > > ///////////////test.h//////////////////////////////////////////////////////////////// > > class TestClass > { > private: > int fTotal; > public: > TestClass(); > ~TestClass();change to: TestClass(){fTotal = 3;} ~TestClass(){fTotal = 4;}> }; > > ///////////test.cpp///////////////////////////////////////////////////////////////////////////// > > #include "test.h" > > TestClass::TestClass() > { > fTotal = 2; > } > > TestClass::~TestClass() > { > fTotal = 3; > }Remove above two definitions.> > int main() > { > TestClass short_name; > return 0; > } > > > and I run: clang++ -c test.cpp -emit-llvm -o test.bc > > and lli test.bc, > > I get follow error: > > assert(!isAlreadyCodeGenerating && "Error: Recursive compilation > detected!"); > > How can I fix it? Thank you. > > p.s I try on llvm 2.9/3.0/3.1 and they all get that error, by the way I > compile llvm used VS2010 on win7. > > > > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >