[LLVMdev] Error: "Recursive compilation" when run lli

Jianfei Hu hujianfei258 at gmail.com
Sat Aug 25 02:59:16 PDT 2012


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
>




More information about the llvm-dev mailing list