Jajoo, Malhar via llvm-dev
2017-Jun-08 16:52 UTC
[llvm-dev] Error just after program execution
Hi, I keep getting the following error after I have generated llvm IR ( using a Module->print(errs(),nullptr) ) - "pure virtual method called terminate called without an active exception." On the last line of the program , after everything has been executed , I get this error. Can anyone explain this ? Following is my LLVM IR - ( Kindly do not pay attention to semantics as it is for a personal project) When compiled using llvm-as and then lli , it works as expected. ; ModuleID = 'myTest' source_filename = "myTest" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @str = private unnamed_addr constant [14 x i8] c"value = %+d,\0A\00" define i32 @UInt(i2 %x) { entry: %x1 = alloca i2 store i2 %x, i2* %x1 ret i32 2 } define i8 @test2() { entry: %datasize = alloca i32 store i32 0, i32* %datasize %x = alloca i2 store i2 -2, i2* %x %x1 = load i2, i2* %x %calltmp = call i32 @UInt(i2 %x1) switch i32 %calltmp, label %sw.bb.0 [ i32 1, label %sw.bb.1 i32 2, label %sw.bb.2 i32 3, label %sw.bb.3 ] sw.bb.0: ; preds = %entry %resclone0 = alloca i10 store i10 -113, i10* %resclone0 ret i8 0 sw.bb.1: ; preds = %entry %resclone2 = alloca i20 store i20 -113, i20* %resclone2 ret i8 0 sw.bb.2: ; preds = %entry %resclone4 = alloca i30 store i30 -113, i30* %resclone4 ret i8 34 sw.bb.3: ; preds = %entry %resclone6 = alloca i40 store i40 -113, i40* %resclone6 ret i8 0 } define i32 @main() { entry: %calltmp = call i8 @test2() %x = alloca i8 store i8 %calltmp, i8* %x %x1 = load i8, i8* %x %calltmp2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i32 0, i32 0), i8 %x1) ret i32 0 } declare i32 @printf(i8*, ...) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170608/fdd8a56d/attachment.html>