[LLVMdev] Windows assertion failure

Óscar Fuentes ofv at wanadoo.es
Mon May 28 10:00:47 PDT 2012


"Paul J. Lucas" <paul at lucasmail.org> writes:

> Given this small program:
>
>> #include <llvm/DerivedTypes.h>
>> #include <llvm/LLVMContext.h>
>> 
>> using namespace llvm;
>> 
>> int main( int argc, char const *argv[] ) {
>>   LLVMContext &ctx = getGlobalContext();
>> 
>>   Type *void_type( Type::getVoidTy( ctx ) );
>>   PointerType *void_ptr_type( void_type->getPointerTo() );
>> 
>>   return 0;
>> }
>
> When compiled using the clang binaries with MinGW32 and run, I get:
>
>> Assertion failed: isValidElementType(EltTy) && "Invalid type for
>> pointer element!", file
>> /Users/asl/Projects/llvm/release/3.1/src/lib/VMCore/Type.cpp, line
>> 748
>
> Why?

In LLVM there are no pointers to void. Try a pointer to i8 (a.k.a. char
for most C/C++ programmers).




More information about the llvm-dev mailing list